cdktn 0.23.2 → 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 +34 -34
- package/README.md +1 -1
- package/lib/annotations.js +1 -1
- package/lib/app.js +1 -1
- package/lib/aspect.js +1 -1
- package/lib/backends/azurerm-backend.js +2 -2
- package/lib/backends/cloud-backend.js +4 -4
- package/lib/backends/consul-backend.js +2 -2
- package/lib/backends/cos-backend.js +2 -2
- package/lib/backends/gcs-backend.js +2 -2
- package/lib/backends/http-backend.js +2 -2
- package/lib/backends/local-backend.js +2 -2
- package/lib/backends/oss-backend.js +2 -2
- package/lib/backends/pg-backend.js +2 -2
- package/lib/backends/remote-backend.js +4 -4
- package/lib/backends/s3-backend.js +2 -2
- package/lib/backends/swift-backend.js +2 -2
- package/lib/complex-computed-list.js +25 -25
- package/lib/errors.d.ts +1 -2
- package/lib/errors.js +11 -8
- package/lib/functions/terraform-functions.generated.js +1 -1
- package/lib/importable-resource.js +1 -1
- package/lib/manifest.js +4 -5
- package/lib/resource.js +1 -1
- package/lib/synthesize/synthesizer.js +4 -5
- package/lib/terraform-asset.js +1 -1
- package/lib/terraform-backend.js +1 -1
- package/lib/terraform-count.js +1 -1
- package/lib/terraform-data-resource.js +1 -1
- package/lib/terraform-data-source.js +1 -1
- package/lib/terraform-dynamic-block.js +2 -2
- package/lib/terraform-dynamic-expression.js +2 -2
- package/lib/terraform-element.js +1 -1
- package/lib/terraform-functions.js +1 -1
- package/lib/terraform-hcl-module.js +1 -1
- package/lib/terraform-iterator.js +5 -5
- package/lib/terraform-local.js +1 -1
- package/lib/terraform-module.js +1 -1
- package/lib/terraform-operators.js +1 -1
- package/lib/terraform-output.js +1 -1
- package/lib/terraform-provider.js +1 -1
- package/lib/terraform-provisioner.js +1 -1
- package/lib/terraform-remote-state.js +1 -1
- package/lib/terraform-resource-targets.js +1 -1
- package/lib/terraform-resource.js +1 -1
- package/lib/terraform-stack.js +1 -1
- package/lib/terraform-variable.js +2 -2
- package/lib/testing/index.js +7 -8
- package/lib/testing/matchers.js +1 -1
- package/lib/tokens/lazy.js +4 -4
- package/lib/tokens/private/intrinsic.d.ts +0 -5
- package/lib/tokens/private/intrinsic.js +2 -9
- package/lib/tokens/private/stack-trace.d.ts +6 -0
- package/lib/tokens/private/stack-trace.js +14 -1
- package/lib/tokens/resolvable.js +4 -4
- package/lib/tokens/string-fragments.js +1 -1
- package/lib/tokens/token.js +2 -2
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/upgrade-id-aspect.js +1 -1
- package/node_modules/{call-bind-apply-helpers → safe-stable-stringify}/LICENSE +2 -2
- 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 +5 -6
- 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/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/LICENSE +0 -21
- 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
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var keysShim;
|
|
4
|
-
if (!Object.keys) {
|
|
5
|
-
// modified from https://github.com/es-shims/es5-shim
|
|
6
|
-
var has = Object.prototype.hasOwnProperty;
|
|
7
|
-
var toStr = Object.prototype.toString;
|
|
8
|
-
var isArgs = require('./isArguments'); // eslint-disable-line global-require
|
|
9
|
-
var isEnumerable = Object.prototype.propertyIsEnumerable;
|
|
10
|
-
var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
|
|
11
|
-
var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');
|
|
12
|
-
var dontEnums = [
|
|
13
|
-
'toString',
|
|
14
|
-
'toLocaleString',
|
|
15
|
-
'valueOf',
|
|
16
|
-
'hasOwnProperty',
|
|
17
|
-
'isPrototypeOf',
|
|
18
|
-
'propertyIsEnumerable',
|
|
19
|
-
'constructor'
|
|
20
|
-
];
|
|
21
|
-
var equalsConstructorPrototype = function (o) {
|
|
22
|
-
var ctor = o.constructor;
|
|
23
|
-
return ctor && ctor.prototype === o;
|
|
24
|
-
};
|
|
25
|
-
var excludedKeys = {
|
|
26
|
-
$applicationCache: true,
|
|
27
|
-
$console: true,
|
|
28
|
-
$external: true,
|
|
29
|
-
$frame: true,
|
|
30
|
-
$frameElement: true,
|
|
31
|
-
$frames: true,
|
|
32
|
-
$innerHeight: true,
|
|
33
|
-
$innerWidth: true,
|
|
34
|
-
$onmozfullscreenchange: true,
|
|
35
|
-
$onmozfullscreenerror: true,
|
|
36
|
-
$outerHeight: true,
|
|
37
|
-
$outerWidth: true,
|
|
38
|
-
$pageXOffset: true,
|
|
39
|
-
$pageYOffset: true,
|
|
40
|
-
$parent: true,
|
|
41
|
-
$scrollLeft: true,
|
|
42
|
-
$scrollTop: true,
|
|
43
|
-
$scrollX: true,
|
|
44
|
-
$scrollY: true,
|
|
45
|
-
$self: true,
|
|
46
|
-
$webkitIndexedDB: true,
|
|
47
|
-
$webkitStorageInfo: true,
|
|
48
|
-
$window: true
|
|
49
|
-
};
|
|
50
|
-
var hasAutomationEqualityBug = (function () {
|
|
51
|
-
/* global window */
|
|
52
|
-
if (typeof window === 'undefined') { return false; }
|
|
53
|
-
for (var k in window) {
|
|
54
|
-
try {
|
|
55
|
-
if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
|
|
56
|
-
try {
|
|
57
|
-
equalsConstructorPrototype(window[k]);
|
|
58
|
-
} catch (e) {
|
|
59
|
-
return true;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
} catch (e) {
|
|
63
|
-
return true;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return false;
|
|
67
|
-
}());
|
|
68
|
-
var equalsConstructorPrototypeIfNotBuggy = function (o) {
|
|
69
|
-
/* global window */
|
|
70
|
-
if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
|
|
71
|
-
return equalsConstructorPrototype(o);
|
|
72
|
-
}
|
|
73
|
-
try {
|
|
74
|
-
return equalsConstructorPrototype(o);
|
|
75
|
-
} catch (e) {
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
keysShim = function keys(object) {
|
|
81
|
-
var isObject = object !== null && typeof object === 'object';
|
|
82
|
-
var isFunction = toStr.call(object) === '[object Function]';
|
|
83
|
-
var isArguments = isArgs(object);
|
|
84
|
-
var isString = isObject && toStr.call(object) === '[object String]';
|
|
85
|
-
var theKeys = [];
|
|
86
|
-
|
|
87
|
-
if (!isObject && !isFunction && !isArguments) {
|
|
88
|
-
throw new TypeError('Object.keys called on a non-object');
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
var skipProto = hasProtoEnumBug && isFunction;
|
|
92
|
-
if (isString && object.length > 0 && !has.call(object, 0)) {
|
|
93
|
-
for (var i = 0; i < object.length; ++i) {
|
|
94
|
-
theKeys.push(String(i));
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if (isArguments && object.length > 0) {
|
|
99
|
-
for (var j = 0; j < object.length; ++j) {
|
|
100
|
-
theKeys.push(String(j));
|
|
101
|
-
}
|
|
102
|
-
} else {
|
|
103
|
-
for (var name in object) {
|
|
104
|
-
if (!(skipProto && name === 'prototype') && has.call(object, name)) {
|
|
105
|
-
theKeys.push(String(name));
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
if (hasDontEnumBug) {
|
|
111
|
-
var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
|
|
112
|
-
|
|
113
|
-
for (var k = 0; k < dontEnums.length; ++k) {
|
|
114
|
-
if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
|
|
115
|
-
theKeys.push(dontEnums[k]);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
return theKeys;
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
module.exports = keysShim;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var slice = Array.prototype.slice;
|
|
4
|
-
var isArgs = require('./isArguments');
|
|
5
|
-
|
|
6
|
-
var origKeys = Object.keys;
|
|
7
|
-
var keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation');
|
|
8
|
-
|
|
9
|
-
var originalKeys = Object.keys;
|
|
10
|
-
|
|
11
|
-
keysShim.shim = function shimObjectKeys() {
|
|
12
|
-
if (Object.keys) {
|
|
13
|
-
var keysWorksWithArguments = (function () {
|
|
14
|
-
// Safari 5.0 bug
|
|
15
|
-
var args = Object.keys(arguments);
|
|
16
|
-
return args && args.length === arguments.length;
|
|
17
|
-
}(1, 2));
|
|
18
|
-
if (!keysWorksWithArguments) {
|
|
19
|
-
Object.keys = function keys(object) { // eslint-disable-line func-name-matching
|
|
20
|
-
if (isArgs(object)) {
|
|
21
|
-
return originalKeys(slice.call(object));
|
|
22
|
-
}
|
|
23
|
-
return originalKeys(object);
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
} else {
|
|
27
|
-
Object.keys = keysShim;
|
|
28
|
-
}
|
|
29
|
-
return Object.keys || keysShim;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
module.exports = keysShim;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var toStr = Object.prototype.toString;
|
|
4
|
-
|
|
5
|
-
module.exports = function isArguments(value) {
|
|
6
|
-
var str = toStr.call(value);
|
|
7
|
-
var isArgs = str === '[object Arguments]';
|
|
8
|
-
if (!isArgs) {
|
|
9
|
-
isArgs = str !== '[object Array]' &&
|
|
10
|
-
value !== null &&
|
|
11
|
-
typeof value === 'object' &&
|
|
12
|
-
typeof value.length === 'number' &&
|
|
13
|
-
value.length >= 0 &&
|
|
14
|
-
toStr.call(value.callee) === '[object Function]';
|
|
15
|
-
}
|
|
16
|
-
return isArgs;
|
|
17
|
-
};
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "object-keys",
|
|
3
|
-
"version": "1.1.1",
|
|
4
|
-
"author": {
|
|
5
|
-
"name": "Jordan Harband",
|
|
6
|
-
"email": "ljharb@gmail.com",
|
|
7
|
-
"url": "http://ljharb.codes"
|
|
8
|
-
},
|
|
9
|
-
"contributors": [
|
|
10
|
-
{
|
|
11
|
-
"name": "Jordan Harband",
|
|
12
|
-
"email": "ljharb@gmail.com",
|
|
13
|
-
"url": "http://ljharb.codes"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"name": "Raynos",
|
|
17
|
-
"email": "raynos2@gmail.com"
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"name": "Nathan Rajlich",
|
|
21
|
-
"email": "nathan@tootallnate.net"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"name": "Ivan Starkov",
|
|
25
|
-
"email": "istarkov@gmail.com"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"name": "Gary Katsevman",
|
|
29
|
-
"email": "git@gkatsev.com"
|
|
30
|
-
}
|
|
31
|
-
],
|
|
32
|
-
"description": "An Object.keys replacement, in case Object.keys is not available. From https://github.com/es-shims/es5-shim",
|
|
33
|
-
"license": "MIT",
|
|
34
|
-
"main": "index.js",
|
|
35
|
-
"scripts": {
|
|
36
|
-
"pretest": "npm run --silent lint",
|
|
37
|
-
"test": "npm run --silent tests-only",
|
|
38
|
-
"posttest": "npm run --silent audit",
|
|
39
|
-
"tests-only": "node test/index.js",
|
|
40
|
-
"coverage": "covert test/*.js",
|
|
41
|
-
"coverage-quiet": "covert test/*.js --quiet",
|
|
42
|
-
"lint": "eslint .",
|
|
43
|
-
"preaudit": "npm install --package-lock --package-lock-only",
|
|
44
|
-
"audit": "npm audit",
|
|
45
|
-
"postaudit": "rm package-lock.json"
|
|
46
|
-
},
|
|
47
|
-
"repository": {
|
|
48
|
-
"type": "git",
|
|
49
|
-
"url": "git://github.com/ljharb/object-keys.git"
|
|
50
|
-
},
|
|
51
|
-
"keywords": [
|
|
52
|
-
"Object.keys",
|
|
53
|
-
"keys",
|
|
54
|
-
"ES5",
|
|
55
|
-
"shim"
|
|
56
|
-
],
|
|
57
|
-
"dependencies": {},
|
|
58
|
-
"devDependencies": {
|
|
59
|
-
"@ljharb/eslint-config": "^13.1.1",
|
|
60
|
-
"covert": "^1.1.1",
|
|
61
|
-
"eslint": "^5.13.0",
|
|
62
|
-
"foreach": "^2.0.5",
|
|
63
|
-
"indexof": "^0.0.1",
|
|
64
|
-
"is": "^3.3.0",
|
|
65
|
-
"tape": "^4.9.2"
|
|
66
|
-
},
|
|
67
|
-
"testling": {
|
|
68
|
-
"files": "test/index.js",
|
|
69
|
-
"browsers": [
|
|
70
|
-
"iexplore/6.0..latest",
|
|
71
|
-
"firefox/3.0..6.0",
|
|
72
|
-
"firefox/15.0..latest",
|
|
73
|
-
"firefox/nightly",
|
|
74
|
-
"chrome/4.0..10.0",
|
|
75
|
-
"chrome/20.0..latest",
|
|
76
|
-
"chrome/canary",
|
|
77
|
-
"opera/10.0..latest",
|
|
78
|
-
"opera/next",
|
|
79
|
-
"safari/4.0..latest",
|
|
80
|
-
"ipad/6.0..latest",
|
|
81
|
-
"iphone/6.0..latest",
|
|
82
|
-
"android-browser/4.2"
|
|
83
|
-
]
|
|
84
|
-
},
|
|
85
|
-
"engines": {
|
|
86
|
-
"node": ">= 0.4"
|
|
87
|
-
}
|
|
88
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"root": true,
|
|
3
|
-
|
|
4
|
-
"extends": "@ljharb",
|
|
5
|
-
|
|
6
|
-
"rules": {
|
|
7
|
-
"id-length": "off",
|
|
8
|
-
"new-cap": ["error", {
|
|
9
|
-
"capIsNewExceptions": [
|
|
10
|
-
"GetIntrinsic"
|
|
11
|
-
],
|
|
12
|
-
}],
|
|
13
|
-
"no-extra-parens": "off",
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
"overrides": [
|
|
17
|
-
{
|
|
18
|
-
"files": ["test/**/*.js"],
|
|
19
|
-
"rules": {
|
|
20
|
-
"id-length": "off",
|
|
21
|
-
"max-lines-per-function": "off",
|
|
22
|
-
"multiline-comment-style": "off",
|
|
23
|
-
"no-empty-function": "off",
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
}
|
|
@@ -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/set-function-name
|
|
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,70 +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.2.2](https://github.com/ljharb/set-function-length/compare/v1.2.1...v1.2.2) - 2024-03-09
|
|
9
|
-
|
|
10
|
-
### Commits
|
|
11
|
-
|
|
12
|
-
- [types] use shared config [`027032f`](https://github.com/ljharb/set-function-length/commit/027032fe9cc439644a07248ea6a8d813fcc767cb)
|
|
13
|
-
- [actions] remove redundant finisher; use reusable workflow [`1fd4fb1`](https://github.com/ljharb/set-function-length/commit/1fd4fb1c58bd5170f0dcff7e320077c0aa2ffdeb)
|
|
14
|
-
- [types] use a handwritten d.ts file instead of emit [`01b9761`](https://github.com/ljharb/set-function-length/commit/01b9761742c95e1118e8c2d153ce2ae43d9731aa)
|
|
15
|
-
- [Deps] update `define-data-property`, `get-intrinsic`, `has-property-descriptors` [`bee8eaf`](https://github.com/ljharb/set-function-length/commit/bee8eaf7749f325357ade85cffeaeef679e513d4)
|
|
16
|
-
- [Dev Deps] update `call-bind`, `tape` [`5dae579`](https://github.com/ljharb/set-function-length/commit/5dae579fdc3aab91b14ebb58f9c19ee3f509d434)
|
|
17
|
-
- [Tests] use `@arethetypeswrong/cli` [`7e22425`](https://github.com/ljharb/set-function-length/commit/7e22425d15957fd3d6da0b6bca4afc0c8d255d2d)
|
|
18
|
-
|
|
19
|
-
## [v1.2.1](https://github.com/ljharb/set-function-length/compare/v1.2.0...v1.2.1) - 2024-02-06
|
|
20
|
-
|
|
21
|
-
### Commits
|
|
22
|
-
|
|
23
|
-
- [Dev Deps] update `call-bind`, `tape`, `typescript` [`d9a4601`](https://github.com/ljharb/set-function-length/commit/d9a460199c4c1fa37da9ebe055e2c884128f0738)
|
|
24
|
-
- [Deps] update `define-data-property`, `get-intrinsic` [`38d39ae`](https://github.com/ljharb/set-function-length/commit/38d39aed13a757ed36211d5b0437b88485090c6b)
|
|
25
|
-
- [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`b4bfe5a`](https://github.com/ljharb/set-function-length/commit/b4bfe5ae0953b906d55b85f867eca5e7f673ebf4)
|
|
26
|
-
|
|
27
|
-
## [v1.2.0](https://github.com/ljharb/set-function-length/compare/v1.1.1...v1.2.0) - 2024-01-14
|
|
28
|
-
|
|
29
|
-
### Commits
|
|
30
|
-
|
|
31
|
-
- [New] add types [`f6d9088`](https://github.com/ljharb/set-function-length/commit/f6d9088b9283a3112b21c6776e8bef6d1f30558a)
|
|
32
|
-
- [Fix] ensure `env` properties are always booleans [`0c42f84`](https://github.com/ljharb/set-function-length/commit/0c42f84979086389b3229e1b4272697fd352275a)
|
|
33
|
-
- [Dev Deps] update `aud`, `call-bind`, `npmignore`, `tape` [`2b75f75`](https://github.com/ljharb/set-function-length/commit/2b75f75468093a4bb8ce8ca989b2edd2e80d95d1)
|
|
34
|
-
- [Deps] update `get-intrinsic`, `has-property-descriptors` [`19bf0fc`](https://github.com/ljharb/set-function-length/commit/19bf0fc4ffaa5ad425acbfa150516be9f3b6263a)
|
|
35
|
-
- [meta] add `sideEffects` flag [`8bb9b78`](https://github.com/ljharb/set-function-length/commit/8bb9b78c11c621123f725c9470222f43466c01d0)
|
|
36
|
-
|
|
37
|
-
## [v1.1.1](https://github.com/ljharb/set-function-length/compare/v1.1.0...v1.1.1) - 2023-10-19
|
|
38
|
-
|
|
39
|
-
### Fixed
|
|
40
|
-
|
|
41
|
-
- [Fix] move `define-data-property` to runtime deps [`#2`](https://github.com/ljharb/set-function-length/issues/2)
|
|
42
|
-
|
|
43
|
-
### Commits
|
|
44
|
-
|
|
45
|
-
- [Dev Deps] update `object-inspect`; add missing `call-bind` [`5aecf79`](https://github.com/ljharb/set-function-length/commit/5aecf79e7d6400957a5d9bd9ac20d4528908ca18)
|
|
46
|
-
|
|
47
|
-
## [v1.1.0](https://github.com/ljharb/set-function-length/compare/v1.0.1...v1.1.0) - 2023-10-13
|
|
48
|
-
|
|
49
|
-
### Commits
|
|
50
|
-
|
|
51
|
-
- [New] add `env` entry point [`475c87a`](https://github.com/ljharb/set-function-length/commit/475c87aa2f59b700aaed589d980624ec596acdcb)
|
|
52
|
-
- [Tests] add coverage with `nyc` [`14f0bf8`](https://github.com/ljharb/set-function-length/commit/14f0bf8c145ae60bf14a026420a06bb7be132c36)
|
|
53
|
-
- [eslint] fix linting failure [`fb516f9`](https://github.com/ljharb/set-function-length/commit/fb516f93c664057138c53559ef63c8622a093335)
|
|
54
|
-
- [Deps] update `define-data-property` [`d727e7c`](https://github.com/ljharb/set-function-length/commit/d727e7c6c9a40d7bf26797694e500ea68741feea)
|
|
55
|
-
|
|
56
|
-
## [v1.0.1](https://github.com/ljharb/set-function-length/compare/v1.0.0...v1.0.1) - 2023-10-12
|
|
57
|
-
|
|
58
|
-
### Commits
|
|
59
|
-
|
|
60
|
-
- [Refactor] use `get-intrinsic`, since it‘s in the dep graph anyways [`278a954`](https://github.com/ljharb/set-function-length/commit/278a954a06cd849051c569ff7aee56df6798933e)
|
|
61
|
-
- [meta] add `exports` [`72acfe5`](https://github.com/ljharb/set-function-length/commit/72acfe5a0310071fb205a72caba5ecbab24336a0)
|
|
62
|
-
|
|
63
|
-
## v1.0.0 - 2023-10-12
|
|
64
|
-
|
|
65
|
-
### Commits
|
|
66
|
-
|
|
67
|
-
- Initial implementation, tests, readme [`fce14e1`](https://github.com/ljharb/set-function-length/commit/fce14e17586460e4f294405173be72b6ffdf7e5f)
|
|
68
|
-
- Initial commit [`ca7ba85`](https://github.com/ljharb/set-function-length/commit/ca7ba857c7c283f9d26e21f14e71cd388f2cb722)
|
|
69
|
-
- npm init [`6a7e493`](https://github.com/ljharb/set-function-length/commit/6a7e493927736cebcaf5c1a84e69b8e6b7b744d8)
|
|
70
|
-
- Only apps should have lockfiles [`d2bf6c4`](https://github.com/ljharb/set-function-length/commit/d2bf6c43de8a51b02a0aa53e8d62cb50c4a2b0da)
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Jordan Harband and contributors
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# set-function-length <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
|
-
Set a function’s length.
|
|
11
|
-
|
|
12
|
-
Arguments:
|
|
13
|
-
- `fn`: the function
|
|
14
|
-
- `length`: the new length. Must be an integer between 0 and 2**32.
|
|
15
|
-
- `loose`: Optional. If true, and the length fails to be set, do not throw. Default false.
|
|
16
|
-
|
|
17
|
-
Returns `fn`.
|
|
18
|
-
|
|
19
|
-
## Usage
|
|
20
|
-
|
|
21
|
-
```javascript
|
|
22
|
-
var setFunctionLength = require('set-function-length');
|
|
23
|
-
var assert = require('assert');
|
|
24
|
-
|
|
25
|
-
function zero() {}
|
|
26
|
-
function one(_) {}
|
|
27
|
-
function two(_, __) {}
|
|
28
|
-
|
|
29
|
-
assert.equal(zero.length, 0);
|
|
30
|
-
assert.equal(one.length, 1);
|
|
31
|
-
assert.equal(two.length, 2);
|
|
32
|
-
|
|
33
|
-
assert.equal(setFunctionLength(zero, 10), zero);
|
|
34
|
-
assert.equal(setFunctionLength(one, 11), one);
|
|
35
|
-
assert.equal(setFunctionLength(two, 12), two);
|
|
36
|
-
|
|
37
|
-
assert.equal(zero.length, 10);
|
|
38
|
-
assert.equal(one.length, 11);
|
|
39
|
-
assert.equal(two.length, 12);
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
[package-url]: https://npmjs.org/package/set-function-length
|
|
43
|
-
[npm-version-svg]: https://versionbadg.es/ljharb/set-function-length.svg
|
|
44
|
-
[deps-svg]: https://david-dm.org/ljharb/set-function-length.svg
|
|
45
|
-
[deps-url]: https://david-dm.org/ljharb/set-function-length
|
|
46
|
-
[dev-deps-svg]: https://david-dm.org/ljharb/set-function-length/dev-status.svg
|
|
47
|
-
[dev-deps-url]: https://david-dm.org/ljharb/set-function-length#info=devDependencies
|
|
48
|
-
[npm-badge-png]: https://nodei.co/npm/set-function-length.png?downloads=true&stars=true
|
|
49
|
-
[license-image]: https://img.shields.io/npm/l/set-function-length.svg
|
|
50
|
-
[license-url]: LICENSE
|
|
51
|
-
[downloads-image]: https://img.shields.io/npm/dm/set-function-length.svg
|
|
52
|
-
[downloads-url]: https://npm-stat.com/charts.html?package=set-function-length
|
|
53
|
-
[codecov-image]: https://codecov.io/gh/ljharb/set-function-length/branch/main/graphs/badge.svg
|
|
54
|
-
[codecov-url]: https://app.codecov.io/gh/ljharb/set-function-length/
|
|
55
|
-
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/set-function-length
|
|
56
|
-
[actions-url]: https://github.com/ljharb/set-function-length/actions
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var gOPD = require('gopd');
|
|
4
|
-
var bind = require('function-bind');
|
|
5
|
-
|
|
6
|
-
var unbound = gOPD && gOPD(function () {}, 'length');
|
|
7
|
-
// @ts-expect-error ts(2555) TS is overly strict with .call
|
|
8
|
-
var bound = gOPD && gOPD(bind.call(function () {}), 'length');
|
|
9
|
-
|
|
10
|
-
var functionsHaveConfigurableLengths = !!(unbound && unbound.configurable);
|
|
11
|
-
|
|
12
|
-
var functionsHaveWritableLengths = !!(unbound && unbound.writable);
|
|
13
|
-
|
|
14
|
-
var boundFnsHaveConfigurableLengths = !!(bound && bound.configurable);
|
|
15
|
-
|
|
16
|
-
var boundFnsHaveWritableLengths = !!(bound && bound.writable);
|
|
17
|
-
|
|
18
|
-
/** @type {import('./env')} */
|
|
19
|
-
module.exports = {
|
|
20
|
-
__proto__: null,
|
|
21
|
-
boundFnsHaveConfigurableLengths: boundFnsHaveConfigurableLengths,
|
|
22
|
-
boundFnsHaveWritableLengths: boundFnsHaveWritableLengths,
|
|
23
|
-
functionsHaveConfigurableLengths: functionsHaveConfigurableLengths,
|
|
24
|
-
functionsHaveWritableLengths: functionsHaveWritableLengths
|
|
25
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var GetIntrinsic = require('get-intrinsic');
|
|
4
|
-
var define = require('define-data-property');
|
|
5
|
-
var hasDescriptors = require('has-property-descriptors')();
|
|
6
|
-
var gOPD = require('gopd');
|
|
7
|
-
|
|
8
|
-
var $TypeError = require('es-errors/type');
|
|
9
|
-
var $floor = GetIntrinsic('%Math.floor%');
|
|
10
|
-
|
|
11
|
-
/** @type {import('.')} */
|
|
12
|
-
module.exports = function setFunctionLength(fn, length) {
|
|
13
|
-
if (typeof fn !== 'function') {
|
|
14
|
-
throw new $TypeError('`fn` is not a function');
|
|
15
|
-
}
|
|
16
|
-
if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) {
|
|
17
|
-
throw new $TypeError('`length` must be a positive 32-bit integer');
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
var loose = arguments.length > 2 && !!arguments[2];
|
|
21
|
-
|
|
22
|
-
var functionLengthIsConfigurable = true;
|
|
23
|
-
var functionLengthIsWritable = true;
|
|
24
|
-
if ('length' in fn && gOPD) {
|
|
25
|
-
var desc = gOPD(fn, 'length');
|
|
26
|
-
if (desc && !desc.configurable) {
|
|
27
|
-
functionLengthIsConfigurable = false;
|
|
28
|
-
}
|
|
29
|
-
if (desc && !desc.writable) {
|
|
30
|
-
functionLengthIsWritable = false;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {
|
|
35
|
-
if (hasDescriptors) {
|
|
36
|
-
define(/** @type {Parameters<define>[0]} */ (fn), 'length', length, true, true);
|
|
37
|
-
} else {
|
|
38
|
-
define(/** @type {Parameters<define>[0]} */ (fn), 'length', length);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return fn;
|
|
42
|
-
};
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "set-function-length",
|
|
3
|
-
"version": "1.2.2",
|
|
4
|
-
"description": "Set a function's length property",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"exports": {
|
|
7
|
-
".": "./index.js",
|
|
8
|
-
"./env": "./env.js",
|
|
9
|
-
"./package.json": "./package.json"
|
|
10
|
-
},
|
|
11
|
-
"sideEffects": false,
|
|
12
|
-
"directories": {
|
|
13
|
-
"test": "test"
|
|
14
|
-
},
|
|
15
|
-
"scripts": {
|
|
16
|
-
"prepack": "npmignore --auto --commentLines=autogenerated",
|
|
17
|
-
"prepublish": "not-in-publish || npm run prepublishOnly",
|
|
18
|
-
"prepublishOnly": "safe-publish-latest",
|
|
19
|
-
"tsc": "tsc -p .",
|
|
20
|
-
"posttsc": "attw -P",
|
|
21
|
-
"prelint": "evalmd README.md",
|
|
22
|
-
"lint": "eslint --ext=js,mjs .",
|
|
23
|
-
"postlint": "npm run tsc",
|
|
24
|
-
"pretest": "npm run lint",
|
|
25
|
-
"tests-only": "nyc tape 'test/**/*.js'",
|
|
26
|
-
"test": "npm run tests-only",
|
|
27
|
-
"posttest": "aud --production",
|
|
28
|
-
"version": "auto-changelog && git add CHANGELOG.md",
|
|
29
|
-
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
|
|
30
|
-
},
|
|
31
|
-
"repository": {
|
|
32
|
-
"type": "git",
|
|
33
|
-
"url": "git+https://github.com/ljharb/set-function-length.git"
|
|
34
|
-
},
|
|
35
|
-
"keywords": [
|
|
36
|
-
"javascript",
|
|
37
|
-
"ecmascript",
|
|
38
|
-
"set",
|
|
39
|
-
"function",
|
|
40
|
-
"length",
|
|
41
|
-
"function.length"
|
|
42
|
-
],
|
|
43
|
-
"author": "Jordan Harband <ljharb@gmail.com>",
|
|
44
|
-
"license": "MIT",
|
|
45
|
-
"bugs": {
|
|
46
|
-
"url": "https://github.com/ljharb/set-function-length/issues"
|
|
47
|
-
},
|
|
48
|
-
"homepage": "https://github.com/ljharb/set-function-length#readme",
|
|
49
|
-
"dependencies": {
|
|
50
|
-
"define-data-property": "^1.1.4",
|
|
51
|
-
"es-errors": "^1.3.0",
|
|
52
|
-
"function-bind": "^1.1.2",
|
|
53
|
-
"get-intrinsic": "^1.2.4",
|
|
54
|
-
"gopd": "^1.0.1",
|
|
55
|
-
"has-property-descriptors": "^1.0.2"
|
|
56
|
-
},
|
|
57
|
-
"devDependencies": {
|
|
58
|
-
"@arethetypeswrong/cli": "^0.15.1",
|
|
59
|
-
"@ljharb/eslint-config": "^21.1.0",
|
|
60
|
-
"@ljharb/tsconfig": "^0.1.1",
|
|
61
|
-
"@types/call-bind": "^1.0.5",
|
|
62
|
-
"@types/define-properties": "^1.1.5",
|
|
63
|
-
"@types/es-value-fixtures": "^1.4.4",
|
|
64
|
-
"@types/for-each": "^0.3.3",
|
|
65
|
-
"@types/function-bind": "^1.1.10",
|
|
66
|
-
"@types/gopd": "^1.0.3",
|
|
67
|
-
"@types/has-property-descriptors": "^1.0.3",
|
|
68
|
-
"@types/object-inspect": "^1.8.4",
|
|
69
|
-
"@types/tape": "^5.6.4",
|
|
70
|
-
"aud": "^2.0.4",
|
|
71
|
-
"auto-changelog": "^2.4.0",
|
|
72
|
-
"call-bind": "^1.0.7",
|
|
73
|
-
"es-value-fixtures": "^1.4.2",
|
|
74
|
-
"eslint": "=8.8.0",
|
|
75
|
-
"evalmd": "^0.0.19",
|
|
76
|
-
"for-each": "^0.3.3",
|
|
77
|
-
"in-publish": "^2.0.1",
|
|
78
|
-
"npmignore": "^0.3.1",
|
|
79
|
-
"nyc": "^10.3.2",
|
|
80
|
-
"object-inspect": "^1.13.1",
|
|
81
|
-
"safe-publish-latest": "^2.0.0",
|
|
82
|
-
"tape": "^5.7.5",
|
|
83
|
-
"typescript": "next"
|
|
84
|
-
},
|
|
85
|
-
"engines": {
|
|
86
|
-
"node": ">= 0.4"
|
|
87
|
-
},
|
|
88
|
-
"auto-changelog": {
|
|
89
|
-
"output": "CHANGELOG.md",
|
|
90
|
-
"template": "keepachangelog",
|
|
91
|
-
"unreleased": false,
|
|
92
|
-
"commitLimit": false,
|
|
93
|
-
"backfillLimit": false,
|
|
94
|
-
"hideCredit": true
|
|
95
|
-
},
|
|
96
|
-
"publishConfig": {
|
|
97
|
-
"ignore": [
|
|
98
|
-
".github/workflows",
|
|
99
|
-
"test"
|
|
100
|
-
]
|
|
101
|
-
}
|
|
102
|
-
}
|