@@ -34,11 +34,11 @@ import { TomlError } from './error.js'
3434
3535const enum Type { DOTTED , EXPLICIT , ARRAY , ARRAY_DOTTED }
3636
37- type MetaState = { t : Type , d : boolean , i : number , c : MetaRecord }
37+ type MetaState = { t : Type ; d : boolean ; i : number ; c : MetaRecord }
3838type MetaRecord = { [ k : string ] : MetaState }
39- type PeekResult = [ string , TomlTable , MetaRecord ] | null
39+ type PeekResult = [ string , TomlTable , MetaRecord ] | null
4040
41- function peekTable ( key : string [ ] , table : TomlTable , meta : MetaRecord , type : Type ) : PeekResult {
41+ function peekTable ( key : string [ ] , table : TomlTable , meta : MetaRecord , type : Type ) : PeekResult {
4242 let t : any = table
4343 let m = meta
4444 let k : string
@@ -111,17 +111,17 @@ function peekTable (key: string[], table: TomlTable, meta: MetaRecord, type: Typ
111111 return null
112112 }
113113
114- return [ k ! , t , state . c ]
114+ return [ k ! , t , state . c ]
115115}
116116
117117export interface ParseOptions {
118118 maxDepth ?: number
119119 integersAsBigInt ?: IntegersAsBigInt
120120}
121121
122- export function parse ( toml : string , options ?: ParseOptions & { integersAsBigInt : Exclude < IntegersAsBigInt , undefined | false > } ) : TomlTable ;
123- export function parse ( toml : string , options ?: ParseOptions ) : TomlTableWithoutBigInt ;
124- export function parse ( toml : string , { maxDepth = 1000 , integersAsBigInt } : ParseOptions = { } ) : TomlTable {
122+ export function parse ( toml : string , options ?: ParseOptions & { integersAsBigInt : Exclude < IntegersAsBigInt , undefined | false > } ) : TomlTable
123+ export function parse ( toml : string , options ?: ParseOptions ) : TomlTableWithoutBigInt
124+ export function parse ( toml : string , { maxDepth = 1000 , integersAsBigInt } : ParseOptions = { } ) : TomlTable {
125125 let res = { }
126126 let meta = { }
127127
@@ -131,7 +131,7 @@ export function parse(toml: string, { maxDepth = 1000, integersAsBigInt }: Parse
131131 for ( let ptr = skipVoid ( toml , 0 ) ; ptr < toml . length ; ) {
132132 if ( toml [ ptr ] === '[' ) {
133133 let isTableArray = toml [ ++ ptr ] === '['
134- let k = parseKey ( toml , ptr += + isTableArray , ']' )
134+ let k = parseKey ( toml , ( ptr += + isTableArray ) , ']' )
135135
136136 if ( isTableArray ) {
137137 if ( toml [ k [ 1 ] - 1 ] !== ']' ) {
@@ -165,16 +165,16 @@ export function parse(toml: string, { maxDepth = 1000, integersAsBigInt }: Parse
165165 } )
166166 }
167167
168- let v = extractValue ( toml , k [ 1 ] , void 0 , maxDepth , integersAsBigInt ) ;
169- p [ 1 ] [ p [ 0 ] ] = v [ 0 ] ;
170- ptr = v [ 1 ] ;
168+ let v = extractValue ( toml , k [ 1 ] , void 0 , maxDepth , integersAsBigInt )
169+ p [ 1 ] [ p [ 0 ] ] = v [ 0 ]
170+ ptr = v [ 1 ]
171171 }
172172
173173 ptr = skipVoid ( toml , ptr , true )
174174 if ( toml [ ptr ] && toml [ ptr ] !== '\n' && toml [ ptr ] !== '\r' ) {
175175 throw new TomlError ( 'each key-value declaration must be followed by an end-of-line' , {
176176 toml : toml ,
177- ptr : ptr
177+ ptr : ptr ,
178178 } )
179179 }
180180 ptr = skipVoid ( toml , ptr )
0 commit comments