How to use the json5/package.json.main function in json5

To help you get started, we’ve selected a few json5 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kulshekhar / ts-jest / src / config / config-set.spec.ts View on Github external
it('should resolve node paths', () => {
    const cs = createConfigSet({ jestConfig: { rootDir: '/root', cwd: '/cwd' } as any, resolve: null })
    const doResolve = (path: string) => cs.resolvePath(path, { throwIfMissing: false, nodeResolve: true })
    expect(doResolve('json5')).toBe(resolve(__dirname, '../../node_modules/json5', require('json5/package.json').main))
    expect(doResolve('./bar.js')).toBe(resolve('/cwd/bar.js'))
    expect(doResolve('bar.js')).toBe(resolve('/root/bar.js'))
    expect(doResolve('/bar.js')).toBe(resolve('/root//bar.js'))
  })
  it('should throw for invalid paths', () => {

json5

JSON for Humans

MIT
Latest version published 1 year ago

Package Health Score

79 / 100
Full package analysis