cdktn 0.23.1 → 0.23.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +1592 -1591
- package/.spec.swcrc +22 -0
- package/README.md +1 -1
- package/jest.config.js +18 -15
- package/lib/_tokens.js +1 -1
- package/lib/annotations.js +2 -2
- package/lib/app.js +2 -2
- package/lib/aspect.js +2 -2
- package/lib/backends/azurerm-backend.js +3 -3
- package/lib/backends/cloud-backend.js +5 -5
- package/lib/backends/consul-backend.js +3 -3
- package/lib/backends/cos-backend.js +3 -3
- package/lib/backends/gcs-backend.js +3 -3
- package/lib/backends/http-backend.js +3 -3
- package/lib/backends/index.js +1 -1
- package/lib/backends/local-backend.js +3 -3
- package/lib/backends/oss-backend.js +3 -3
- package/lib/backends/pg-backend.js +3 -3
- package/lib/backends/remote-backend.js +5 -5
- package/lib/backends/s3-backend.js +3 -3
- package/lib/backends/swift-backend.js +3 -3
- package/lib/complex-computed-list.js +25 -25
- package/lib/errors.d.ts +1 -2
- package/lib/errors.js +11 -8
- package/lib/features.js +1 -1
- package/lib/functions/helpers.js +1 -1
- package/lib/functions/terraform-functions.generated.js +2 -2
- package/lib/hcl/render.js +1 -1
- package/lib/importable-resource.js +2 -2
- package/lib/index.js +1 -1
- package/lib/manifest.js +4 -5
- package/lib/private/fs.d.ts +20 -5
- package/lib/private/fs.js +43 -69
- package/lib/private/unique.js +1 -1
- package/lib/resource.js +2 -2
- package/lib/runtime.js +1 -1
- package/lib/synthesize/index.js +1 -1
- package/lib/synthesize/synthesizer.js +4 -5
- package/lib/synthesize/types.js +1 -1
- package/lib/terraform-addressable.js +1 -1
- package/lib/terraform-asset.js +2 -2
- package/lib/terraform-backend.js +2 -2
- package/lib/terraform-conditions.js +1 -1
- package/lib/terraform-count.js +2 -2
- package/lib/terraform-data-resource.js +2 -2
- package/lib/terraform-data-source.js +2 -2
- package/lib/terraform-dependable.js +1 -1
- package/lib/terraform-dynamic-block.js +2 -2
- package/lib/terraform-dynamic-expression.js +2 -2
- package/lib/terraform-element.js +2 -2
- package/lib/terraform-functions.js +2 -2
- package/lib/terraform-hcl-module.js +2 -2
- package/lib/terraform-iterator.js +6 -6
- package/lib/terraform-local.js +2 -2
- package/lib/terraform-module-asset.js +1 -1
- package/lib/terraform-module.js +2 -2
- package/lib/terraform-operators.js +2 -2
- package/lib/terraform-output.js +2 -2
- package/lib/terraform-provider.js +2 -2
- package/lib/terraform-provisioner.js +2 -2
- package/lib/terraform-remote-state.js +2 -2
- package/lib/terraform-resource-targets.js +2 -2
- package/lib/terraform-resource.js +2 -2
- package/lib/terraform-stack.js +2 -2
- package/lib/terraform-variable.js +3 -3
- package/lib/testing/adapters/jest.js +1 -1
- package/lib/testing/index.js +7 -8
- package/lib/testing/matchers.js +2 -2
- package/lib/tfExpression.js +1 -1
- package/lib/tokens/index.js +1 -1
- package/lib/tokens/lazy.js +4 -4
- package/lib/tokens/private/dependency.js +1 -1
- package/lib/tokens/private/encoding.js +1 -1
- package/lib/tokens/private/intrinsic.d.ts +0 -5
- package/lib/tokens/private/intrinsic.js +2 -9
- package/lib/tokens/private/resolve.js +1 -1
- package/lib/tokens/private/stack-trace.d.ts +6 -0
- package/lib/tokens/private/stack-trace.js +14 -1
- package/lib/tokens/private/token-map.js +1 -1
- package/lib/tokens/private/uniqueid.js +1 -1
- package/lib/tokens/resolvable.js +4 -4
- package/lib/tokens/string-fragments.js +2 -2
- package/lib/tokens/token.js +3 -3
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/upgrade-id-aspect.js +2 -2
- package/lib/util.js +1 -1
- package/lib/validateEnvironment.js +1 -1
- package/lib/validations/index.js +1 -1
- package/lib/validations/validate-binary-version.js +1 -1
- package/lib/validations/validate-provider-presence.js +1 -1
- package/lib/validations/validate-terraform-version.js +1 -1
- package/node_modules/fflate/CHANGELOG.md +115 -0
- package/node_modules/{has-property-descriptors → fflate}/LICENSE +2 -2
- package/node_modules/fflate/README.md +558 -0
- package/node_modules/fflate/esm/browser.d.ts +1501 -0
- package/node_modules/fflate/esm/browser.js +2665 -0
- package/node_modules/fflate/esm/index.d.mts +1501 -0
- package/node_modules/fflate/esm/index.mjs +2679 -0
- package/node_modules/fflate/lib/browser.cjs +2688 -0
- package/node_modules/fflate/lib/browser.d.cts +1501 -0
- package/node_modules/fflate/lib/index.cjs +2668 -0
- package/node_modules/fflate/lib/index.d.ts +1501 -0
- package/node_modules/fflate/lib/node-worker.cjs +32 -0
- package/node_modules/fflate/lib/node.cjs +2700 -0
- package/node_modules/fflate/lib/node.d.cts +1501 -0
- package/node_modules/fflate/lib/worker.cjs +20 -0
- package/node_modules/fflate/package.json +127 -0
- package/node_modules/fflate/umd/index.js +1 -0
- package/node_modules/{yazl → safe-stable-stringify}/LICENSE +1 -1
- package/node_modules/safe-stable-stringify/esm/package.json +4 -0
- package/node_modules/safe-stable-stringify/esm/wrapper.d.ts +4 -0
- package/node_modules/safe-stable-stringify/esm/wrapper.js +6 -0
- package/node_modules/safe-stable-stringify/index.d.ts +22 -0
- package/node_modules/safe-stable-stringify/index.js +625 -0
- package/node_modules/safe-stable-stringify/package.json +65 -0
- package/node_modules/safe-stable-stringify/readme.md +179 -0
- package/package.json +21 -15
- package/tsconfig.json +6 -3
- package/tsconfig.test.json +12 -0
- package/lib/testing/__tests__/matchers.test.d.ts +0 -1
- package/lib/testing/__tests__/matchers.test.js +0 -205
- package/lib/testing/adapters/__tests__/index.test.d.ts +0 -1
- package/lib/testing/adapters/__tests__/index.test.js +0 -67
- package/lib/testing/adapters/__tests__/jest.test.d.ts +0 -1
- package/lib/testing/adapters/__tests__/jest.test.js +0 -41
- package/node_modules/buffer-crc32/LICENSE +0 -19
- package/node_modules/buffer-crc32/README.md +0 -55
- package/node_modules/buffer-crc32/dist/index.cjs +0 -306
- package/node_modules/buffer-crc32/dist/index.d.cts +0 -35
- package/node_modules/buffer-crc32/dist/index.d.mts +0 -35
- package/node_modules/buffer-crc32/dist/index.mjs +0 -304
- package/node_modules/buffer-crc32/index.d.ts +0 -35
- package/node_modules/buffer-crc32/package.json +0 -54
- package/node_modules/call-bind/.eslintignore +0 -1
- package/node_modules/call-bind/.eslintrc +0 -16
- package/node_modules/call-bind/.github/FUNDING.yml +0 -12
- package/node_modules/call-bind/.nycrc +0 -9
- package/node_modules/call-bind/CHANGELOG.md +0 -106
- package/node_modules/call-bind/LICENSE +0 -21
- package/node_modules/call-bind/README.md +0 -64
- package/node_modules/call-bind/callBound.js +0 -15
- package/node_modules/call-bind/index.js +0 -24
- package/node_modules/call-bind/package.json +0 -93
- package/node_modules/call-bind/test/callBound.js +0 -54
- package/node_modules/call-bind/test/index.js +0 -74
- package/node_modules/call-bind-apply-helpers/.eslintrc +0 -17
- package/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +0 -12
- package/node_modules/call-bind-apply-helpers/.nycrc +0 -9
- package/node_modules/call-bind-apply-helpers/CHANGELOG.md +0 -30
- package/node_modules/call-bind-apply-helpers/LICENSE +0 -21
- package/node_modules/call-bind-apply-helpers/README.md +0 -62
- package/node_modules/call-bind-apply-helpers/actualApply.d.ts +0 -1
- package/node_modules/call-bind-apply-helpers/actualApply.js +0 -10
- package/node_modules/call-bind-apply-helpers/applyBind.d.ts +0 -19
- package/node_modules/call-bind-apply-helpers/applyBind.js +0 -10
- package/node_modules/call-bind-apply-helpers/functionApply.d.ts +0 -1
- package/node_modules/call-bind-apply-helpers/functionApply.js +0 -4
- package/node_modules/call-bind-apply-helpers/functionCall.d.ts +0 -1
- package/node_modules/call-bind-apply-helpers/functionCall.js +0 -4
- package/node_modules/call-bind-apply-helpers/index.d.ts +0 -64
- package/node_modules/call-bind-apply-helpers/index.js +0 -15
- package/node_modules/call-bind-apply-helpers/package.json +0 -85
- package/node_modules/call-bind-apply-helpers/reflectApply.d.ts +0 -3
- package/node_modules/call-bind-apply-helpers/reflectApply.js +0 -4
- package/node_modules/call-bind-apply-helpers/test/index.js +0 -63
- package/node_modules/call-bind-apply-helpers/tsconfig.json +0 -9
- package/node_modules/call-bound/.eslintrc +0 -13
- package/node_modules/call-bound/.github/FUNDING.yml +0 -12
- package/node_modules/call-bound/.nycrc +0 -9
- package/node_modules/call-bound/CHANGELOG.md +0 -42
- package/node_modules/call-bound/LICENSE +0 -21
- package/node_modules/call-bound/README.md +0 -53
- package/node_modules/call-bound/index.d.ts +0 -94
- package/node_modules/call-bound/index.js +0 -19
- package/node_modules/call-bound/package.json +0 -99
- package/node_modules/call-bound/test/index.js +0 -61
- package/node_modules/call-bound/tsconfig.json +0 -10
- package/node_modules/define-data-property/.eslintrc +0 -24
- package/node_modules/define-data-property/.github/FUNDING.yml +0 -12
- package/node_modules/define-data-property/.nycrc +0 -13
- package/node_modules/define-data-property/CHANGELOG.md +0 -70
- package/node_modules/define-data-property/LICENSE +0 -21
- package/node_modules/define-data-property/README.md +0 -67
- package/node_modules/define-data-property/index.d.ts +0 -12
- package/node_modules/define-data-property/index.js +0 -56
- package/node_modules/define-data-property/package.json +0 -106
- package/node_modules/define-data-property/test/index.js +0 -392
- package/node_modules/define-data-property/tsconfig.json +0 -59
- package/node_modules/dunder-proto/.eslintrc +0 -5
- package/node_modules/dunder-proto/.github/FUNDING.yml +0 -12
- package/node_modules/dunder-proto/.nycrc +0 -13
- package/node_modules/dunder-proto/CHANGELOG.md +0 -24
- package/node_modules/dunder-proto/LICENSE +0 -21
- package/node_modules/dunder-proto/README.md +0 -54
- package/node_modules/dunder-proto/get.d.ts +0 -5
- package/node_modules/dunder-proto/get.js +0 -30
- package/node_modules/dunder-proto/package.json +0 -76
- package/node_modules/dunder-proto/set.d.ts +0 -5
- package/node_modules/dunder-proto/set.js +0 -35
- package/node_modules/dunder-proto/test/get.js +0 -34
- package/node_modules/dunder-proto/test/index.js +0 -4
- package/node_modules/dunder-proto/test/set.js +0 -50
- package/node_modules/dunder-proto/tsconfig.json +0 -9
- package/node_modules/es-define-property/.eslintrc +0 -13
- package/node_modules/es-define-property/.github/FUNDING.yml +0 -12
- package/node_modules/es-define-property/.nycrc +0 -9
- package/node_modules/es-define-property/CHANGELOG.md +0 -29
- package/node_modules/es-define-property/LICENSE +0 -21
- package/node_modules/es-define-property/README.md +0 -49
- package/node_modules/es-define-property/index.d.ts +0 -3
- package/node_modules/es-define-property/index.js +0 -14
- package/node_modules/es-define-property/package.json +0 -81
- package/node_modules/es-define-property/test/index.js +0 -56
- package/node_modules/es-define-property/tsconfig.json +0 -10
- package/node_modules/es-errors/.eslintrc +0 -5
- package/node_modules/es-errors/.github/FUNDING.yml +0 -12
- package/node_modules/es-errors/CHANGELOG.md +0 -40
- package/node_modules/es-errors/LICENSE +0 -21
- package/node_modules/es-errors/README.md +0 -55
- package/node_modules/es-errors/eval.d.ts +0 -3
- package/node_modules/es-errors/eval.js +0 -4
- package/node_modules/es-errors/index.d.ts +0 -3
- package/node_modules/es-errors/index.js +0 -4
- package/node_modules/es-errors/package.json +0 -80
- package/node_modules/es-errors/range.d.ts +0 -3
- package/node_modules/es-errors/range.js +0 -4
- package/node_modules/es-errors/ref.d.ts +0 -3
- package/node_modules/es-errors/ref.js +0 -4
- package/node_modules/es-errors/syntax.d.ts +0 -3
- package/node_modules/es-errors/syntax.js +0 -4
- package/node_modules/es-errors/test/index.js +0 -19
- package/node_modules/es-errors/tsconfig.json +0 -49
- package/node_modules/es-errors/type.d.ts +0 -3
- package/node_modules/es-errors/type.js +0 -4
- package/node_modules/es-errors/uri.d.ts +0 -3
- package/node_modules/es-errors/uri.js +0 -4
- package/node_modules/es-object-atoms/.eslintrc +0 -16
- package/node_modules/es-object-atoms/.github/FUNDING.yml +0 -12
- package/node_modules/es-object-atoms/CHANGELOG.md +0 -37
- package/node_modules/es-object-atoms/LICENSE +0 -21
- package/node_modules/es-object-atoms/README.md +0 -63
- package/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +0 -3
- package/node_modules/es-object-atoms/RequireObjectCoercible.js +0 -11
- package/node_modules/es-object-atoms/ToObject.d.ts +0 -7
- package/node_modules/es-object-atoms/ToObject.js +0 -10
- package/node_modules/es-object-atoms/index.d.ts +0 -3
- package/node_modules/es-object-atoms/index.js +0 -4
- package/node_modules/es-object-atoms/isObject.d.ts +0 -3
- package/node_modules/es-object-atoms/isObject.js +0 -6
- package/node_modules/es-object-atoms/package.json +0 -80
- package/node_modules/es-object-atoms/test/index.js +0 -38
- package/node_modules/es-object-atoms/tsconfig.json +0 -6
- package/node_modules/function-bind/.eslintrc +0 -21
- package/node_modules/function-bind/.github/FUNDING.yml +0 -12
- package/node_modules/function-bind/.github/SECURITY.md +0 -3
- package/node_modules/function-bind/.nycrc +0 -13
- package/node_modules/function-bind/CHANGELOG.md +0 -136
- package/node_modules/function-bind/LICENSE +0 -20
- package/node_modules/function-bind/README.md +0 -46
- package/node_modules/function-bind/implementation.js +0 -84
- package/node_modules/function-bind/index.js +0 -5
- package/node_modules/function-bind/package.json +0 -87
- package/node_modules/function-bind/test/.eslintrc +0 -9
- package/node_modules/function-bind/test/index.js +0 -252
- package/node_modules/get-intrinsic/.eslintrc +0 -42
- package/node_modules/get-intrinsic/.github/FUNDING.yml +0 -12
- package/node_modules/get-intrinsic/.nycrc +0 -9
- package/node_modules/get-intrinsic/CHANGELOG.md +0 -186
- package/node_modules/get-intrinsic/LICENSE +0 -21
- package/node_modules/get-intrinsic/README.md +0 -71
- package/node_modules/get-intrinsic/index.js +0 -378
- package/node_modules/get-intrinsic/package.json +0 -97
- package/node_modules/get-intrinsic/test/GetIntrinsic.js +0 -274
- package/node_modules/get-proto/.eslintrc +0 -10
- package/node_modules/get-proto/.github/FUNDING.yml +0 -12
- package/node_modules/get-proto/.nycrc +0 -9
- package/node_modules/get-proto/CHANGELOG.md +0 -21
- package/node_modules/get-proto/LICENSE +0 -21
- package/node_modules/get-proto/Object.getPrototypeOf.d.ts +0 -5
- package/node_modules/get-proto/Object.getPrototypeOf.js +0 -6
- package/node_modules/get-proto/README.md +0 -50
- package/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +0 -3
- package/node_modules/get-proto/Reflect.getPrototypeOf.js +0 -4
- package/node_modules/get-proto/index.d.ts +0 -5
- package/node_modules/get-proto/index.js +0 -27
- package/node_modules/get-proto/package.json +0 -81
- package/node_modules/get-proto/test/index.js +0 -68
- package/node_modules/get-proto/tsconfig.json +0 -9
- package/node_modules/gopd/.eslintrc +0 -16
- package/node_modules/gopd/.github/FUNDING.yml +0 -12
- package/node_modules/gopd/CHANGELOG.md +0 -45
- package/node_modules/gopd/LICENSE +0 -21
- package/node_modules/gopd/README.md +0 -40
- package/node_modules/gopd/gOPD.d.ts +0 -1
- package/node_modules/gopd/gOPD.js +0 -4
- package/node_modules/gopd/index.d.ts +0 -5
- package/node_modules/gopd/index.js +0 -15
- package/node_modules/gopd/package.json +0 -77
- package/node_modules/gopd/test/index.js +0 -36
- package/node_modules/gopd/tsconfig.json +0 -9
- package/node_modules/has-property-descriptors/.eslintrc +0 -13
- package/node_modules/has-property-descriptors/.github/FUNDING.yml +0 -12
- package/node_modules/has-property-descriptors/.nycrc +0 -9
- package/node_modules/has-property-descriptors/CHANGELOG.md +0 -35
- package/node_modules/has-property-descriptors/README.md +0 -43
- package/node_modules/has-property-descriptors/index.js +0 -22
- package/node_modules/has-property-descriptors/package.json +0 -77
- package/node_modules/has-property-descriptors/test/index.js +0 -57
- package/node_modules/has-symbols/.eslintrc +0 -11
- package/node_modules/has-symbols/.github/FUNDING.yml +0 -12
- package/node_modules/has-symbols/.nycrc +0 -9
- package/node_modules/has-symbols/CHANGELOG.md +0 -91
- package/node_modules/has-symbols/LICENSE +0 -21
- package/node_modules/has-symbols/README.md +0 -46
- package/node_modules/has-symbols/index.d.ts +0 -3
- package/node_modules/has-symbols/index.js +0 -14
- package/node_modules/has-symbols/package.json +0 -111
- package/node_modules/has-symbols/shams.d.ts +0 -3
- package/node_modules/has-symbols/shams.js +0 -45
- package/node_modules/has-symbols/test/index.js +0 -22
- package/node_modules/has-symbols/test/shams/core-js.js +0 -29
- package/node_modules/has-symbols/test/shams/get-own-property-symbols.js +0 -29
- package/node_modules/has-symbols/test/tests.js +0 -58
- package/node_modules/has-symbols/tsconfig.json +0 -10
- package/node_modules/hasown/.eslintrc +0 -5
- package/node_modules/hasown/.github/FUNDING.yml +0 -12
- package/node_modules/hasown/.nycrc +0 -13
- package/node_modules/hasown/CHANGELOG.md +0 -40
- package/node_modules/hasown/LICENSE +0 -21
- package/node_modules/hasown/README.md +0 -40
- package/node_modules/hasown/index.d.ts +0 -3
- package/node_modules/hasown/index.js +0 -8
- package/node_modules/hasown/package.json +0 -92
- package/node_modules/hasown/tsconfig.json +0 -6
- package/node_modules/isarray/LICENSE +0 -21
- package/node_modules/isarray/README.md +0 -38
- package/node_modules/isarray/index.js +0 -5
- package/node_modules/isarray/package.json +0 -48
- package/node_modules/json-stable-stringify/.eslintrc +0 -31
- package/node_modules/json-stable-stringify/.github/FUNDING.yml +0 -12
- package/node_modules/json-stable-stringify/CHANGELOG.md +0 -160
- package/node_modules/json-stable-stringify/LICENSE +0 -21
- package/node_modules/json-stable-stringify/README.md +0 -157
- package/node_modules/json-stable-stringify/example/key_cmp.js +0 -9
- package/node_modules/json-stable-stringify/example/nested.js +0 -7
- package/node_modules/json-stable-stringify/example/str.js +0 -7
- package/node_modules/json-stable-stringify/example/value_cmp.js +0 -12
- package/node_modules/json-stable-stringify/index.d.ts +0 -25
- package/node_modules/json-stable-stringify/index.js +0 -124
- package/node_modules/json-stable-stringify/package.json +0 -88
- package/node_modules/json-stable-stringify/test/cmp.js +0 -33
- package/node_modules/json-stable-stringify/test/nested.js +0 -48
- package/node_modules/json-stable-stringify/test/replacer.js +0 -81
- package/node_modules/json-stable-stringify/test/space.js +0 -127
- package/node_modules/json-stable-stringify/test/str.js +0 -46
- package/node_modules/json-stable-stringify/test/to-json.js +0 -22
- package/node_modules/json-stable-stringify/tsconfig.json +0 -10
- package/node_modules/jsonify/.eslintrc +0 -21
- package/node_modules/jsonify/.github/FUNDING.yml +0 -12
- package/node_modules/jsonify/CHANGELOG.md +0 -48
- package/node_modules/jsonify/README.md +0 -66
- package/node_modules/jsonify/index.js +0 -4
- package/node_modules/jsonify/lib/parse.js +0 -261
- package/node_modules/jsonify/lib/stringify.js +0 -151
- package/node_modules/jsonify/package.json +0 -62
- package/node_modules/jsonify/test/parse.js +0 -20
- package/node_modules/jsonify/test/stringify.js +0 -18
- package/node_modules/math-intrinsics/.eslintrc +0 -16
- package/node_modules/math-intrinsics/.github/FUNDING.yml +0 -12
- package/node_modules/math-intrinsics/CHANGELOG.md +0 -24
- package/node_modules/math-intrinsics/LICENSE +0 -21
- package/node_modules/math-intrinsics/README.md +0 -50
- package/node_modules/math-intrinsics/abs.d.ts +0 -1
- package/node_modules/math-intrinsics/abs.js +0 -4
- package/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +0 -3
- package/node_modules/math-intrinsics/constants/maxArrayLength.js +0 -4
- package/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +0 -3
- package/node_modules/math-intrinsics/constants/maxSafeInteger.js +0 -5
- package/node_modules/math-intrinsics/constants/maxValue.d.ts +0 -3
- package/node_modules/math-intrinsics/constants/maxValue.js +0 -5
- package/node_modules/math-intrinsics/floor.d.ts +0 -1
- package/node_modules/math-intrinsics/floor.js +0 -4
- package/node_modules/math-intrinsics/isFinite.d.ts +0 -3
- package/node_modules/math-intrinsics/isFinite.js +0 -12
- package/node_modules/math-intrinsics/isInteger.d.ts +0 -3
- package/node_modules/math-intrinsics/isInteger.js +0 -16
- package/node_modules/math-intrinsics/isNaN.d.ts +0 -1
- package/node_modules/math-intrinsics/isNaN.js +0 -6
- package/node_modules/math-intrinsics/isNegativeZero.d.ts +0 -3
- package/node_modules/math-intrinsics/isNegativeZero.js +0 -6
- package/node_modules/math-intrinsics/max.d.ts +0 -1
- package/node_modules/math-intrinsics/max.js +0 -4
- package/node_modules/math-intrinsics/min.d.ts +0 -1
- package/node_modules/math-intrinsics/min.js +0 -4
- package/node_modules/math-intrinsics/mod.d.ts +0 -3
- package/node_modules/math-intrinsics/mod.js +0 -9
- package/node_modules/math-intrinsics/package.json +0 -86
- package/node_modules/math-intrinsics/pow.d.ts +0 -1
- package/node_modules/math-intrinsics/pow.js +0 -4
- package/node_modules/math-intrinsics/round.d.ts +0 -1
- package/node_modules/math-intrinsics/round.js +0 -4
- package/node_modules/math-intrinsics/sign.d.ts +0 -3
- package/node_modules/math-intrinsics/sign.js +0 -11
- package/node_modules/math-intrinsics/test/index.js +0 -192
- package/node_modules/math-intrinsics/tsconfig.json +0 -3
- package/node_modules/object-keys/.editorconfig +0 -13
- package/node_modules/object-keys/.eslintrc +0 -17
- package/node_modules/object-keys/.travis.yml +0 -277
- package/node_modules/object-keys/CHANGELOG.md +0 -232
- package/node_modules/object-keys/LICENSE +0 -21
- package/node_modules/object-keys/README.md +0 -76
- package/node_modules/object-keys/implementation.js +0 -122
- package/node_modules/object-keys/index.js +0 -32
- package/node_modules/object-keys/isArguments.js +0 -17
- package/node_modules/object-keys/package.json +0 -88
- package/node_modules/object-keys/test/index.js +0 -5
- package/node_modules/set-function-length/.eslintrc +0 -27
- package/node_modules/set-function-length/.github/FUNDING.yml +0 -12
- package/node_modules/set-function-length/.nycrc +0 -13
- package/node_modules/set-function-length/CHANGELOG.md +0 -70
- package/node_modules/set-function-length/LICENSE +0 -21
- package/node_modules/set-function-length/README.md +0 -56
- package/node_modules/set-function-length/env.d.ts +0 -9
- package/node_modules/set-function-length/env.js +0 -25
- package/node_modules/set-function-length/index.d.ts +0 -7
- package/node_modules/set-function-length/index.js +0 -42
- package/node_modules/set-function-length/package.json +0 -102
- package/node_modules/set-function-length/tsconfig.json +0 -9
- package/node_modules/yazl/README.md +0 -457
- package/node_modules/yazl/index.js +0 -826
- package/node_modules/yazl/package.json +0 -34
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
|
|
5
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
|
6
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
-
|
|
8
|
-
## [v0.0.1](https://github.com/ljharb/jsonify/compare/v0.0.0...v0.0.1) - 2022-10-11
|
|
9
|
-
|
|
10
|
-
### Commits
|
|
11
|
-
|
|
12
|
-
- [eslint] fix indentation [`1c92797`](https://github.com/ljharb/jsonify/commit/1c92797745b21701242c14f53308d5edfef54025)
|
|
13
|
-
- [eslint] add eslint [`6a05332`](https://github.com/ljharb/jsonify/commit/6a05332907827cdf79a515911aec6e12625f8c5c)
|
|
14
|
-
- [readme] rename, add badges, soft-wrap [`cb1bd1a`](https://github.com/ljharb/jsonify/commit/cb1bd1a464733b27acd4e42062bb47f04e4e8064)
|
|
15
|
-
- [actions] add reusable workflows [`49710ae`](https://github.com/ljharb/jsonify/commit/49710aef8d4a92178cab79015c487e83e2211a37)
|
|
16
|
-
- [eslint] use function decls, but avoid relying on hoisting [`dcba2f4`](https://github.com/ljharb/jsonify/commit/dcba2f47667ca9c77fd3ce97f0c8cfa50d66a371)
|
|
17
|
-
- [Tests] switch to `tape` [`d31aaa0`](https://github.com/ljharb/jsonify/commit/d31aaa075e57b13587d81d5c08dede3ec3cd8438)
|
|
18
|
-
- [meta] add `auto-changelog` [`474188e`](https://github.com/ljharb/jsonify/commit/474188e42a5074cd43038e9f57c90e88708c3633)
|
|
19
|
-
- using travis [`7064ab5`](https://github.com/ljharb/jsonify/commit/7064ab53e5f73fa31e2ce7aa47d210c539662f16)
|
|
20
|
-
- [Refactor] `parse`: move fn comments outside of the fn body [`78f111a`](https://github.com/ljharb/jsonify/commit/78f111a8d8810d14a732a6395787b1ff5a2f899f)
|
|
21
|
-
- [meta] create FUNDING.yml; add `funding` in package.json [`98db8e1`](https://github.com/ljharb/jsonify/commit/98db8e1d0793f57308fcda823c568f47e90702a1)
|
|
22
|
-
- [meta] use `npmignore` to autogenerate an npmignore file [`1732b45`](https://github.com/ljharb/jsonify/commit/1732b4537dd952a04bee290310caed6b5fd3ade7)
|
|
23
|
-
- [meta] update URLs [`26ded36`](https://github.com/ljharb/jsonify/commit/26ded3613780aeb41f802f4cf98e3337ac3e783d)
|
|
24
|
-
- install notes [`57daaee`](https://github.com/ljharb/jsonify/commit/57daaeeb1c2d7a183cfc32727d5b447a3268c533)
|
|
25
|
-
- Only apps should have lockfiles [`1f25819`](https://github.com/ljharb/jsonify/commit/1f2581918edc11f55fac1be574a695444eff0d58)
|
|
26
|
-
- [meta] add `safe-publish-latest` [`8f3ef5e`](https://github.com/ljharb/jsonify/commit/8f3ef5e90262167420d71f08fe50a568499563d6)
|
|
27
|
-
- [Tests] add `aud` in `posttest` [`4c64711`](https://github.com/ljharb/jsonify/commit/4c64711da1a2c3c20c0c27e4f6d18f61c94df223)
|
|
28
|
-
- Update tap. [`8cf38a6`](https://github.com/ljharb/jsonify/commit/8cf38a62f34dd05c812829c6d0a9ee1a9486dc8a)
|
|
29
|
-
- fix broken browserify link [`9dc7744`](https://github.com/ljharb/jsonify/commit/9dc77442cc375823640f13086d5737fdd918bccf)
|
|
30
|
-
|
|
31
|
-
## v0.0.0 - 2011-08-21
|
|
32
|
-
|
|
33
|
-
### Commits
|
|
34
|
-
|
|
35
|
-
- first commit [`11c7bdf`](https://github.com/ljharb/jsonify/commit/11c7bdf47c3f21b014b1e984be52211142d8d8b7)
|
|
36
|
-
- the recursive descent parser is the fastest, going with it [`9210504`](https://github.com/ljharb/jsonify/commit/92105047b01811d216777d1b260373431b406f53)
|
|
37
|
-
- took out unnecessary functions from json.js, only stringify-related stuff remain [`99a8b65`](https://github.com/ljharb/jsonify/commit/99a8b6580af5dedebb39db18127c671b405c26d3)
|
|
38
|
-
- fix parse by removing another callback of indirection [`10e1b96`](https://github.com/ljharb/jsonify/commit/10e1b96b535cd66c0aee768aa6dbfc9778e87dbf)
|
|
39
|
-
- Hygiene [`633fe5a`](https://github.com/ljharb/jsonify/commit/633fe5ae4bd69985254a68ae111505ec3d3e74ab)
|
|
40
|
-
- a package.json [`5258ce2`](https://github.com/ljharb/jsonify/commit/5258ce240702c78f4affffdc3ea2e095ad04f49f)
|
|
41
|
-
- pared down parse.js [`40d8617`](https://github.com/ljharb/jsonify/commit/40d86179553cc972b465c2446f58a7ecda1f24ce)
|
|
42
|
-
- Style conformance. [`ad6079c`](https://github.com/ljharb/jsonify/commit/ad6079cbd8dc362a3cc42e1f97c01aa5ccd48bfe)
|
|
43
|
-
- forgot the readme and index.js [`69d3062`](https://github.com/ljharb/jsonify/commit/69d306269813548103c027df972d960d1b439eef)
|
|
44
|
-
- stringify test using garbage passes [`29db45f`](https://github.com/ljharb/jsonify/commit/29db45f4cd72dca91052baf744656d9561716f55)
|
|
45
|
-
- parse test passes too hooray [`d58c20e`](https://github.com/ljharb/jsonify/commit/d58c20ee3e2550490bfb5380ad1b0c085ee12e02)
|
|
46
|
-
- Create a JSON object only if one does not already exist. [`8d11dc6`](https://github.com/ljharb/jsonify/commit/8d11dc6950eafc7d01f141ce91d4f585caa29f3b)
|
|
47
|
-
- !isFinite [`8e0b15c`](https://github.com/ljharb/jsonify/commit/8e0b15cb492f63067a88ad786e4d5fc0fa89a241)
|
|
48
|
-
- move into lib [`006d2aa`](https://github.com/ljharb/jsonify/commit/006d2aaf373382b95801964d5b6505d9b79b3a16)
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
# jsonify <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
|
|
2
|
-
|
|
3
|
-
[![github actions][actions-image]][actions-url]
|
|
4
|
-
[![coverage][codecov-image]][codecov-url]
|
|
5
|
-
[![License][license-image]][license-url]
|
|
6
|
-
[![Downloads][downloads-image]][downloads-url]
|
|
7
|
-
|
|
8
|
-
[![npm badge][npm-badge-png]][package-url]
|
|
9
|
-
|
|
10
|
-
This module provides Douglas Crockford's JSON implementation without modifying any globals.
|
|
11
|
-
|
|
12
|
-
`stringify` and `parse` are merely exported without respect to whether or not a global `JSON` object exists.
|
|
13
|
-
|
|
14
|
-
[](https://travis-ci.org/ljharb/jsonify)
|
|
15
|
-
|
|
16
|
-
# methods
|
|
17
|
-
|
|
18
|
-
``` js
|
|
19
|
-
var json = require('jsonify');
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## json.parse(source, reviver)
|
|
23
|
-
|
|
24
|
-
Return a new javascript object from a parse of the `source` string.
|
|
25
|
-
|
|
26
|
-
If a `reviver` function is specified, walk the structure passing each name/value pair to `reviver.call(parent, key, value)` to transform the `value` before parsing it.
|
|
27
|
-
|
|
28
|
-
## json.stringify(value, replacer, space)
|
|
29
|
-
|
|
30
|
-
Return a string representation for `value`.
|
|
31
|
-
|
|
32
|
-
If `replacer` is specified, walk the structure passing each name/value pair to `replacer.call(parent, key, value)` to transform the `value` before stringifying it.
|
|
33
|
-
|
|
34
|
-
If `space` is a number, indent the result by that many spaces.
|
|
35
|
-
If `space` is a string, use `space` as the indentation.
|
|
36
|
-
|
|
37
|
-
# install
|
|
38
|
-
|
|
39
|
-
With [npm](https://npmjs.org) do:
|
|
40
|
-
|
|
41
|
-
```
|
|
42
|
-
npm install jsonify
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
To use this module in the browser, check out
|
|
46
|
-
[browserify](https://github.com/browserify/browserify).
|
|
47
|
-
|
|
48
|
-
# license
|
|
49
|
-
|
|
50
|
-
public domain
|
|
51
|
-
|
|
52
|
-
[package-url]: https://npmjs.org/package/jsonify
|
|
53
|
-
[npm-version-svg]: https://versionbadg.es/ljharb/jsonify.svg
|
|
54
|
-
[deps-svg]: https://david-dm.org/ljharb/jsonify.svg
|
|
55
|
-
[deps-url]: https://david-dm.org/ljharb/jsonify
|
|
56
|
-
[dev-deps-svg]: https://david-dm.org/ljharb/jsonify/dev-status.svg
|
|
57
|
-
[dev-deps-url]: https://david-dm.org/ljharb/jsonify#info=devDependencies
|
|
58
|
-
[npm-badge-png]: https://nodei.co/npm/jsonify.png?downloads=true&stars=true
|
|
59
|
-
[license-image]: https://img.shields.io/npm/l/jsonify.svg
|
|
60
|
-
[license-url]: LICENSE
|
|
61
|
-
[downloads-image]: https://img.shields.io/npm/dm/jsonify.svg
|
|
62
|
-
[downloads-url]: https://npm-stat.com/charts.html?package=jsonify
|
|
63
|
-
[codecov-image]: https://codecov.io/gh/ljharb/jsonify/branch/main/graphs/badge.svg
|
|
64
|
-
[codecov-url]: https://app.codecov.io/gh/ljharb/jsonify/
|
|
65
|
-
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/jsonify
|
|
66
|
-
[actions-url]: https://github.com/ljharb/jsonify/actions
|
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var at; // The index of the current character
|
|
4
|
-
var ch; // The current character
|
|
5
|
-
var escapee = {
|
|
6
|
-
'"': '"',
|
|
7
|
-
'\\': '\\',
|
|
8
|
-
'/': '/',
|
|
9
|
-
b: '\b',
|
|
10
|
-
f: '\f',
|
|
11
|
-
n: '\n',
|
|
12
|
-
r: '\r',
|
|
13
|
-
t: '\t'
|
|
14
|
-
};
|
|
15
|
-
var text;
|
|
16
|
-
|
|
17
|
-
// Call error when something is wrong.
|
|
18
|
-
function error(m) {
|
|
19
|
-
throw {
|
|
20
|
-
name: 'SyntaxError',
|
|
21
|
-
message: m,
|
|
22
|
-
at: at,
|
|
23
|
-
text: text
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function next(c) {
|
|
28
|
-
// If a c parameter is provided, verify that it matches the current character.
|
|
29
|
-
if (c && c !== ch) {
|
|
30
|
-
error("Expected '" + c + "' instead of '" + ch + "'");
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// Get the next character. When there are no more characters, return the empty string.
|
|
34
|
-
|
|
35
|
-
ch = text.charAt(at);
|
|
36
|
-
at += 1;
|
|
37
|
-
return ch;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function number() {
|
|
41
|
-
// Parse a number value.
|
|
42
|
-
var num;
|
|
43
|
-
var str = '';
|
|
44
|
-
|
|
45
|
-
if (ch === '-') {
|
|
46
|
-
str = '-';
|
|
47
|
-
next('-');
|
|
48
|
-
}
|
|
49
|
-
while (ch >= '0' && ch <= '9') {
|
|
50
|
-
str += ch;
|
|
51
|
-
next();
|
|
52
|
-
}
|
|
53
|
-
if (ch === '.') {
|
|
54
|
-
str += '.';
|
|
55
|
-
while (next() && ch >= '0' && ch <= '9') {
|
|
56
|
-
str += ch;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
if (ch === 'e' || ch === 'E') {
|
|
60
|
-
str += ch;
|
|
61
|
-
next();
|
|
62
|
-
if (ch === '-' || ch === '+') {
|
|
63
|
-
str += ch;
|
|
64
|
-
next();
|
|
65
|
-
}
|
|
66
|
-
while (ch >= '0' && ch <= '9') {
|
|
67
|
-
str += ch;
|
|
68
|
-
next();
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
num = Number(str);
|
|
72
|
-
if (!isFinite(num)) {
|
|
73
|
-
error('Bad number');
|
|
74
|
-
}
|
|
75
|
-
return num;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function string() {
|
|
79
|
-
// Parse a string value.
|
|
80
|
-
var hex;
|
|
81
|
-
var i;
|
|
82
|
-
var str = '';
|
|
83
|
-
var uffff;
|
|
84
|
-
|
|
85
|
-
// When parsing for string values, we must look for " and \ characters.
|
|
86
|
-
if (ch === '"') {
|
|
87
|
-
while (next()) {
|
|
88
|
-
if (ch === '"') {
|
|
89
|
-
next();
|
|
90
|
-
return str;
|
|
91
|
-
} else if (ch === '\\') {
|
|
92
|
-
next();
|
|
93
|
-
if (ch === 'u') {
|
|
94
|
-
uffff = 0;
|
|
95
|
-
for (i = 0; i < 4; i += 1) {
|
|
96
|
-
hex = parseInt(next(), 16);
|
|
97
|
-
if (!isFinite(hex)) {
|
|
98
|
-
break;
|
|
99
|
-
}
|
|
100
|
-
uffff = (uffff * 16) + hex;
|
|
101
|
-
}
|
|
102
|
-
str += String.fromCharCode(uffff);
|
|
103
|
-
} else if (typeof escapee[ch] === 'string') {
|
|
104
|
-
str += escapee[ch];
|
|
105
|
-
} else {
|
|
106
|
-
break;
|
|
107
|
-
}
|
|
108
|
-
} else {
|
|
109
|
-
str += ch;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
error('Bad string');
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// Skip whitespace.
|
|
117
|
-
function white() {
|
|
118
|
-
while (ch && ch <= ' ') {
|
|
119
|
-
next();
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// true, false, or null.
|
|
124
|
-
function word() {
|
|
125
|
-
switch (ch) {
|
|
126
|
-
case 't':
|
|
127
|
-
next('t');
|
|
128
|
-
next('r');
|
|
129
|
-
next('u');
|
|
130
|
-
next('e');
|
|
131
|
-
return true;
|
|
132
|
-
case 'f':
|
|
133
|
-
next('f');
|
|
134
|
-
next('a');
|
|
135
|
-
next('l');
|
|
136
|
-
next('s');
|
|
137
|
-
next('e');
|
|
138
|
-
return false;
|
|
139
|
-
case 'n':
|
|
140
|
-
next('n');
|
|
141
|
-
next('u');
|
|
142
|
-
next('l');
|
|
143
|
-
next('l');
|
|
144
|
-
return null;
|
|
145
|
-
default:
|
|
146
|
-
error("Unexpected '" + ch + "'");
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
// Parse an array value.
|
|
151
|
-
function array() {
|
|
152
|
-
var arr = [];
|
|
153
|
-
|
|
154
|
-
if (ch === '[') {
|
|
155
|
-
next('[');
|
|
156
|
-
white();
|
|
157
|
-
if (ch === ']') {
|
|
158
|
-
next(']');
|
|
159
|
-
return arr; // empty array
|
|
160
|
-
}
|
|
161
|
-
while (ch) {
|
|
162
|
-
arr.push(value()); // eslint-disable-line no-use-before-define
|
|
163
|
-
white();
|
|
164
|
-
if (ch === ']') {
|
|
165
|
-
next(']');
|
|
166
|
-
return arr;
|
|
167
|
-
}
|
|
168
|
-
next(',');
|
|
169
|
-
white();
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
error('Bad array');
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
// Parse an object value.
|
|
176
|
-
function object() {
|
|
177
|
-
var key;
|
|
178
|
-
var obj = {};
|
|
179
|
-
|
|
180
|
-
if (ch === '{') {
|
|
181
|
-
next('{');
|
|
182
|
-
white();
|
|
183
|
-
if (ch === '}') {
|
|
184
|
-
next('}');
|
|
185
|
-
return obj; // empty object
|
|
186
|
-
}
|
|
187
|
-
while (ch) {
|
|
188
|
-
key = string();
|
|
189
|
-
white();
|
|
190
|
-
next(':');
|
|
191
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
192
|
-
error('Duplicate key "' + key + '"');
|
|
193
|
-
}
|
|
194
|
-
obj[key] = value(); // eslint-disable-line no-use-before-define
|
|
195
|
-
white();
|
|
196
|
-
if (ch === '}') {
|
|
197
|
-
next('}');
|
|
198
|
-
return obj;
|
|
199
|
-
}
|
|
200
|
-
next(',');
|
|
201
|
-
white();
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
error('Bad object');
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
// Parse a JSON value. It could be an object, an array, a string, a number, or a word.
|
|
208
|
-
function value() {
|
|
209
|
-
white();
|
|
210
|
-
switch (ch) {
|
|
211
|
-
case '{':
|
|
212
|
-
return object();
|
|
213
|
-
case '[':
|
|
214
|
-
return array();
|
|
215
|
-
case '"':
|
|
216
|
-
return string();
|
|
217
|
-
case '-':
|
|
218
|
-
return number();
|
|
219
|
-
default:
|
|
220
|
-
return ch >= '0' && ch <= '9' ? number() : word();
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
// Return the json_parse function. It will have access to all of the above functions and variables.
|
|
225
|
-
module.exports = function (source, reviver) {
|
|
226
|
-
var result;
|
|
227
|
-
|
|
228
|
-
text = source;
|
|
229
|
-
at = 0;
|
|
230
|
-
ch = ' ';
|
|
231
|
-
result = value();
|
|
232
|
-
white();
|
|
233
|
-
if (ch) {
|
|
234
|
-
error('Syntax error');
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
// If there is a reviver function, we recursively walk the new structure,
|
|
238
|
-
// passing each name/value pair to the reviver function for possible
|
|
239
|
-
// transformation, starting with a temporary root object that holds the result
|
|
240
|
-
// in an empty key. If there is not a reviver function, we simply return the
|
|
241
|
-
// result.
|
|
242
|
-
|
|
243
|
-
return typeof reviver === 'function' ? (function walk(holder, key) {
|
|
244
|
-
var k;
|
|
245
|
-
var v;
|
|
246
|
-
var val = holder[key];
|
|
247
|
-
if (val && typeof val === 'object') {
|
|
248
|
-
for (k in value) {
|
|
249
|
-
if (Object.prototype.hasOwnProperty.call(val, k)) {
|
|
250
|
-
v = walk(val, k);
|
|
251
|
-
if (typeof v === 'undefined') {
|
|
252
|
-
delete val[k];
|
|
253
|
-
} else {
|
|
254
|
-
val[k] = v;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
return reviver.call(holder, key, val);
|
|
260
|
-
}({ '': result }, '')) : result;
|
|
261
|
-
};
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var escapable = /[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
|
|
4
|
-
var gap;
|
|
5
|
-
var indent;
|
|
6
|
-
var meta = { // table of character substitutions
|
|
7
|
-
'\b': '\\b',
|
|
8
|
-
'\t': '\\t',
|
|
9
|
-
'\n': '\\n',
|
|
10
|
-
'\f': '\\f',
|
|
11
|
-
'\r': '\\r',
|
|
12
|
-
'"': '\\"',
|
|
13
|
-
'\\': '\\\\'
|
|
14
|
-
};
|
|
15
|
-
var rep;
|
|
16
|
-
|
|
17
|
-
function quote(string) {
|
|
18
|
-
// If the string contains no control characters, no quote characters, and no
|
|
19
|
-
// backslash characters, then we can safely slap some quotes around it.
|
|
20
|
-
// Otherwise we must also replace the offending characters with safe escape sequences.
|
|
21
|
-
|
|
22
|
-
escapable.lastIndex = 0;
|
|
23
|
-
return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
|
|
24
|
-
var c = meta[a];
|
|
25
|
-
return typeof c === 'string' ? c
|
|
26
|
-
: '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
|
|
27
|
-
}) + '"' : '"' + string + '"';
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function str(key, holder) {
|
|
31
|
-
// Produce a string from holder[key].
|
|
32
|
-
var i; // The loop counter.
|
|
33
|
-
var k; // The member key.
|
|
34
|
-
var v; // The member value.
|
|
35
|
-
var length;
|
|
36
|
-
var mind = gap;
|
|
37
|
-
var partial;
|
|
38
|
-
var value = holder[key];
|
|
39
|
-
|
|
40
|
-
// If the value has a toJSON method, call it to obtain a replacement value.
|
|
41
|
-
if (value && typeof value === 'object' && typeof value.toJSON === 'function') {
|
|
42
|
-
value = value.toJSON(key);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// If we were called with a replacer function, then call the replacer to obtain a replacement value.
|
|
46
|
-
if (typeof rep === 'function') {
|
|
47
|
-
value = rep.call(holder, key, value);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// What happens next depends on the value's type.
|
|
51
|
-
switch (typeof value) {
|
|
52
|
-
case 'string':
|
|
53
|
-
return quote(value);
|
|
54
|
-
|
|
55
|
-
case 'number':
|
|
56
|
-
// JSON numbers must be finite. Encode non-finite numbers as null.
|
|
57
|
-
return isFinite(value) ? String(value) : 'null';
|
|
58
|
-
|
|
59
|
-
case 'boolean':
|
|
60
|
-
case 'null':
|
|
61
|
-
// If the value is a boolean or null, convert it to a string. Note:
|
|
62
|
-
// typeof null does not produce 'null'. The case is included here in
|
|
63
|
-
// the remote chance that this gets fixed someday.
|
|
64
|
-
return String(value);
|
|
65
|
-
|
|
66
|
-
case 'object':
|
|
67
|
-
if (!value) {
|
|
68
|
-
return 'null';
|
|
69
|
-
}
|
|
70
|
-
gap += indent;
|
|
71
|
-
partial = [];
|
|
72
|
-
|
|
73
|
-
// Array.isArray
|
|
74
|
-
if (Object.prototype.toString.apply(value) === '[object Array]') {
|
|
75
|
-
length = value.length;
|
|
76
|
-
for (i = 0; i < length; i += 1) {
|
|
77
|
-
partial[i] = str(i, value) || 'null';
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// Join all of the elements together, separated with commas, and wrap them in brackets.
|
|
81
|
-
v = partial.length === 0 ? '[]' : gap
|
|
82
|
-
? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']'
|
|
83
|
-
: '[' + partial.join(',') + ']';
|
|
84
|
-
gap = mind;
|
|
85
|
-
return v;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// If the replacer is an array, use it to select the members to be stringified.
|
|
89
|
-
if (rep && typeof rep === 'object') {
|
|
90
|
-
length = rep.length;
|
|
91
|
-
for (i = 0; i < length; i += 1) {
|
|
92
|
-
k = rep[i];
|
|
93
|
-
if (typeof k === 'string') {
|
|
94
|
-
v = str(k, value);
|
|
95
|
-
if (v) {
|
|
96
|
-
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
} else {
|
|
101
|
-
// Otherwise, iterate through all of the keys in the object.
|
|
102
|
-
for (k in value) {
|
|
103
|
-
if (Object.prototype.hasOwnProperty.call(value, k)) {
|
|
104
|
-
v = str(k, value);
|
|
105
|
-
if (v) {
|
|
106
|
-
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// Join all of the member texts together, separated with commas, and wrap them in braces.
|
|
113
|
-
|
|
114
|
-
v = partial.length === 0 ? '{}' : gap
|
|
115
|
-
? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}'
|
|
116
|
-
: '{' + partial.join(',') + '}';
|
|
117
|
-
gap = mind;
|
|
118
|
-
return v;
|
|
119
|
-
default:
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
module.exports = function (value, replacer, space) {
|
|
124
|
-
var i;
|
|
125
|
-
gap = '';
|
|
126
|
-
indent = '';
|
|
127
|
-
|
|
128
|
-
// If the space parameter is a number, make an indent string containing that many spaces.
|
|
129
|
-
if (typeof space === 'number') {
|
|
130
|
-
for (i = 0; i < space; i += 1) {
|
|
131
|
-
indent += ' ';
|
|
132
|
-
}
|
|
133
|
-
} else if (typeof space === 'string') {
|
|
134
|
-
// If the space parameter is a string, it will be used as the indent string.
|
|
135
|
-
indent = space;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// If there is a replacer, it must be a function or an array. Otherwise, throw an error.
|
|
139
|
-
rep = replacer;
|
|
140
|
-
if (
|
|
141
|
-
replacer
|
|
142
|
-
&& typeof replacer !== 'function'
|
|
143
|
-
&& (typeof replacer !== 'object' || typeof replacer.length !== 'number')
|
|
144
|
-
) {
|
|
145
|
-
throw new Error('JSON.stringify');
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
// Make a fake root object containing our value under the key of ''.
|
|
149
|
-
// Return the result of stringifying the value.
|
|
150
|
-
return str('', { '': value });
|
|
151
|
-
};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "jsonify",
|
|
3
|
-
"version": "0.0.1",
|
|
4
|
-
"description": "JSON without touching any globals",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"directories": {
|
|
7
|
-
"lib": ".",
|
|
8
|
-
"test": "test"
|
|
9
|
-
},
|
|
10
|
-
"devDependencies": {
|
|
11
|
-
"@ljharb/eslint-config": "^21.0.0",
|
|
12
|
-
"aud": "^2.0.1",
|
|
13
|
-
"auto-changelog": "^2.4.0",
|
|
14
|
-
"eslint": "=8.8.0",
|
|
15
|
-
"garbage": "0.0.x",
|
|
16
|
-
"in-publish": "^2.0.1",
|
|
17
|
-
"npmignore": "^0.3.0",
|
|
18
|
-
"safe-publish-latest": "^2.0.0",
|
|
19
|
-
"tape": "^5.6.1"
|
|
20
|
-
},
|
|
21
|
-
"scripts": {
|
|
22
|
-
"prepack": "npmignore --auto --commentLines=autogenerated",
|
|
23
|
-
"prepublishOnly": "safe-publish-latest",
|
|
24
|
-
"prepublish": "not-in-publish || npm run prepublishOnly",
|
|
25
|
-
"lint": "eslint --ext=js,mjs .",
|
|
26
|
-
"pretest": "npm run lint",
|
|
27
|
-
"tests-only": "tape 'test/**/*.js'",
|
|
28
|
-
"test": "npm run tests-only",
|
|
29
|
-
"posttest": "aud --production",
|
|
30
|
-
"version": "auto-changelog && git add CHANGELOG.md",
|
|
31
|
-
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
|
|
32
|
-
},
|
|
33
|
-
"repository": {
|
|
34
|
-
"type": "git",
|
|
35
|
-
"url": "https://github.com/ljharb/jsonify.git"
|
|
36
|
-
},
|
|
37
|
-
"keywords": [
|
|
38
|
-
"json",
|
|
39
|
-
"browser"
|
|
40
|
-
],
|
|
41
|
-
"author": {
|
|
42
|
-
"name": "Douglas Crockford",
|
|
43
|
-
"url": "https://crockford.com/"
|
|
44
|
-
},
|
|
45
|
-
"funding": {
|
|
46
|
-
"url": "https://github.com/sponsors/ljharb"
|
|
47
|
-
},
|
|
48
|
-
"license": "Public Domain",
|
|
49
|
-
"auto-changelog": {
|
|
50
|
-
"output": "CHANGELOG.md",
|
|
51
|
-
"template": "keepachangelog",
|
|
52
|
-
"unreleased": false,
|
|
53
|
-
"commitLimit": false,
|
|
54
|
-
"backfillLimit": false,
|
|
55
|
-
"hideCredit": true
|
|
56
|
-
},
|
|
57
|
-
"publishConfig": {
|
|
58
|
-
"ignore": [
|
|
59
|
-
".github/workflows"
|
|
60
|
-
]
|
|
61
|
-
}
|
|
62
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var test = require('tape');
|
|
4
|
-
|
|
5
|
-
var json = require('../');
|
|
6
|
-
var garbage = require('garbage');
|
|
7
|
-
|
|
8
|
-
test('parse', function (t) {
|
|
9
|
-
for (var i = 0; i < 50; i++) {
|
|
10
|
-
var s = JSON.stringify(garbage(50));
|
|
11
|
-
|
|
12
|
-
t.deepEqual(
|
|
13
|
-
json.parse(s),
|
|
14
|
-
JSON.parse(s),
|
|
15
|
-
'comparing JSON.parse to jsonify.parse: run ' + (i + 1)
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
t.end();
|
|
20
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var test = require('tape');
|
|
4
|
-
var json = require('../');
|
|
5
|
-
var garbage = require('garbage');
|
|
6
|
-
|
|
7
|
-
test('stringify', function (t) {
|
|
8
|
-
for (var i = 0; i < 50; i++) {
|
|
9
|
-
var obj = garbage(50);
|
|
10
|
-
t.equal(
|
|
11
|
-
json.stringify(obj),
|
|
12
|
-
JSON.stringify(obj),
|
|
13
|
-
'comparing JSON.stringify to jsonify.stringify: run ' + (i + 1)
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
t.end();
|
|
18
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# These are supported funding model platforms
|
|
2
|
-
|
|
3
|
-
github: [ljharb]
|
|
4
|
-
patreon: # Replace with a single Patreon username
|
|
5
|
-
open_collective: # Replace with a single Open Collective username
|
|
6
|
-
ko_fi: # Replace with a single Ko-fi username
|
|
7
|
-
tidelift: npm/math-intrinsics
|
|
8
|
-
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
|
9
|
-
liberapay: # Replace with a single Liberapay username
|
|
10
|
-
issuehunt: # Replace with a single IssueHunt username
|
|
11
|
-
otechie: # Replace with a single Otechie username
|
|
12
|
-
custom: # Replace with a single custom sponsorship URL
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
|
|
5
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
|
6
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
-
|
|
8
|
-
## [v1.1.0](https://github.com/es-shims/math-intrinsics/compare/v1.0.0...v1.1.0) - 2024-12-18
|
|
9
|
-
|
|
10
|
-
### Commits
|
|
11
|
-
|
|
12
|
-
- [New] add `round` [`7cfb044`](https://github.com/es-shims/math-intrinsics/commit/7cfb04460c0fbdf1ca101eecbac3f59d11994130)
|
|
13
|
-
- [Tests] add attw [`e96be8f`](https://github.com/es-shims/math-intrinsics/commit/e96be8fbf58449eafe976446a0470e6ea561ad8d)
|
|
14
|
-
- [Dev Deps] update `@types/tape` [`30d0023`](https://github.com/es-shims/math-intrinsics/commit/30d00234ce8a3fa0094a61cd55d6686eb91e36ec)
|
|
15
|
-
|
|
16
|
-
## v1.0.0 - 2024-12-11
|
|
17
|
-
|
|
18
|
-
### Commits
|
|
19
|
-
|
|
20
|
-
- Initial implementation, tests, readme, types [`b898caa`](https://github.com/es-shims/math-intrinsics/commit/b898caae94e9994a94a42b8740f7bbcfd0a868fe)
|
|
21
|
-
- Initial commit [`02745b0`](https://github.com/es-shims/math-intrinsics/commit/02745b03a62255af8a332771987b55d127538d9c)
|
|
22
|
-
- [New] add `constants/maxArrayLength`, `mod` [`b978178`](https://github.com/es-shims/math-intrinsics/commit/b978178a57685bd23ed1c7efe2137f3784f5fcc5)
|
|
23
|
-
- npm init [`a39fc57`](https://github.com/es-shims/math-intrinsics/commit/a39fc57e5639a645d0bd52a0dc56202480223be2)
|
|
24
|
-
- Only apps should have lockfiles [`9451580`](https://github.com/es-shims/math-intrinsics/commit/94515800fb34db4f3cc7e99290042d45609ac7bd)
|