Skip to content

DJS. JSON extensions #77

@sergey-shandar

Description

@sergey-shandar
  • trailing comma in objects
    { "a": "35", }
  • support for one-line comments
  • support for multiline comments
  • support for export default and module.exports =
    // data.d.mjs
    export default ...
    // data.d.cjs
    module.exports = ...
  • support for identifiers in an object
    { a: false }
  • support for const
    const a = { a: false }
    export default [a, a]
  • support for BigInt 123n
  • support for exporting a module
    // b.d.mjs
    import a from 'a.d.mjs'
    // a.d.cjs
    const a = require('a.d.cjs')
  • asynchronous parser (state)
  • a parser should return a type of the file:
    • .json, JSON
    • .d.mjs, data ES module
    • .d.cjs, data CommonJs module
  • add new line token #97

FunctionsScript

  • support for expressions
  • support for functions
  • a parser may return these additional types of the file:
    • .f.mjs, FunctionalScript ES module
    • .f.cjs, FunctionalScript CommonJS module

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions