UNPKG

jsonc-simple-parser

Version:

A simple JSON parser that supports comments and optional trailing commas.

19 lines (9 loc) 292 B
/* IMPORT */ import type {Token, LookupToken} from './types'; /* MAIN */ const detokenize = ( token: Token | LookupToken ): string => { if ( 'source' in token ) return token.source; return token.children.map ( detokenize ).join ( '' ); }; /* EXPORT */ export default detokenize;