step-node-agent 3.24.1 → 3.24.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.
Files changed (94) hide show
  1. package/node_modules/call-bind/CHANGELOG.md +16 -0
  2. package/node_modules/call-bind/index.js +2 -11
  3. package/node_modules/call-bind/package.json +11 -6
  4. package/node_modules/define-data-property/CHANGELOG.md +29 -0
  5. package/node_modules/define-data-property/index.d.ts +12 -3
  6. package/node_modules/define-data-property/index.js +4 -16
  7. package/node_modules/define-data-property/package.json +26 -33
  8. package/node_modules/define-data-property/test/index.js +10 -10
  9. package/node_modules/es-define-property/.eslintrc +13 -0
  10. package/node_modules/es-define-property/.github/FUNDING.yml +12 -0
  11. package/node_modules/es-define-property/.nycrc +9 -0
  12. package/node_modules/es-define-property/CHANGELOG.md +15 -0
  13. package/node_modules/{express/node_modules/raw-body → es-define-property}/LICENSE +6 -7
  14. package/node_modules/es-define-property/README.md +49 -0
  15. package/node_modules/es-define-property/index.d.ts +3 -0
  16. package/node_modules/es-define-property/index.js +16 -0
  17. package/node_modules/es-define-property/package.json +81 -0
  18. package/node_modules/es-define-property/test/index.js +55 -0
  19. package/node_modules/es-define-property/tsconfig.json +50 -0
  20. package/node_modules/es-errors/.eslintrc +5 -0
  21. package/node_modules/es-errors/.github/FUNDING.yml +12 -0
  22. package/node_modules/es-errors/CHANGELOG.md +40 -0
  23. package/node_modules/es-errors/LICENSE +21 -0
  24. package/node_modules/es-errors/README.md +55 -0
  25. package/node_modules/es-errors/eval.d.ts +3 -0
  26. package/node_modules/es-errors/eval.js +4 -0
  27. package/node_modules/es-errors/index.d.ts +3 -0
  28. package/node_modules/es-errors/index.js +4 -0
  29. package/node_modules/es-errors/package.json +80 -0
  30. package/node_modules/es-errors/range.d.ts +3 -0
  31. package/node_modules/es-errors/range.js +4 -0
  32. package/node_modules/es-errors/ref.d.ts +3 -0
  33. package/node_modules/es-errors/ref.js +4 -0
  34. package/node_modules/es-errors/syntax.d.ts +3 -0
  35. package/node_modules/es-errors/syntax.js +4 -0
  36. package/node_modules/es-errors/test/index.js +19 -0
  37. package/node_modules/es-errors/tsconfig.json +49 -0
  38. package/node_modules/es-errors/type.d.ts +3 -0
  39. package/node_modules/es-errors/type.js +4 -0
  40. package/node_modules/es-errors/uri.d.ts +3 -0
  41. package/node_modules/es-errors/uri.js +4 -0
  42. package/node_modules/express/History.md +14 -5
  43. package/node_modules/express/Readme.md +1 -1
  44. package/node_modules/express/lib/router/index.js +1 -1
  45. package/node_modules/express/lib/router/route.js +7 -2
  46. package/node_modules/express/lib/utils.js +3 -4
  47. package/node_modules/express/package.json +5 -6
  48. package/node_modules/get-intrinsic/CHANGELOG.md +18 -0
  49. package/node_modules/get-intrinsic/index.js +15 -7
  50. package/node_modules/get-intrinsic/package.json +12 -12
  51. package/node_modules/has-property-descriptors/CHANGELOG.md +8 -0
  52. package/node_modules/has-property-descriptors/index.js +3 -14
  53. package/node_modules/has-property-descriptors/package.json +5 -5
  54. package/node_modules/has-proto/CHANGELOG.md +15 -0
  55. package/node_modules/has-proto/index.d.ts +3 -0
  56. package/node_modules/has-proto/index.js +5 -1
  57. package/node_modules/has-proto/package.json +9 -5
  58. package/node_modules/has-proto/tsconfig.json +49 -0
  59. package/node_modules/hasown/CHANGELOG.md +8 -0
  60. package/node_modules/hasown/index.d.ts +3 -3
  61. package/node_modules/hasown/index.js +1 -1
  62. package/node_modules/hasown/package.json +13 -15
  63. package/node_modules/set-function-length/CHANGELOG.md +8 -0
  64. package/node_modules/set-function-length/index.js +1 -1
  65. package/node_modules/set-function-length/package.json +7 -6
  66. package/node_modules/side-channel/.editorconfig +9 -0
  67. package/node_modules/side-channel/.eslintrc +1 -1
  68. package/node_modules/side-channel/CHANGELOG.md +30 -0
  69. package/node_modules/side-channel/index.d.ts +27 -0
  70. package/node_modules/side-channel/index.js +25 -20
  71. package/node_modules/side-channel/package.json +36 -19
  72. package/node_modules/side-channel/test/index.js +6 -1
  73. package/node_modules/side-channel/tsconfig.json +50 -0
  74. package/package.json +1 -1
  75. package/node_modules/define-data-property/index.d.ts.map +0 -1
  76. package/node_modules/express/node_modules/body-parser/HISTORY.md +0 -657
  77. package/node_modules/express/node_modules/body-parser/LICENSE +0 -23
  78. package/node_modules/express/node_modules/body-parser/README.md +0 -464
  79. package/node_modules/express/node_modules/body-parser/SECURITY.md +0 -25
  80. package/node_modules/express/node_modules/body-parser/index.js +0 -156
  81. package/node_modules/express/node_modules/body-parser/lib/read.js +0 -205
  82. package/node_modules/express/node_modules/body-parser/lib/types/json.js +0 -236
  83. package/node_modules/express/node_modules/body-parser/lib/types/raw.js +0 -101
  84. package/node_modules/express/node_modules/body-parser/lib/types/text.js +0 -121
  85. package/node_modules/express/node_modules/body-parser/lib/types/urlencoded.js +0 -284
  86. package/node_modules/express/node_modules/body-parser/package.json +0 -56
  87. package/node_modules/express/node_modules/raw-body/HISTORY.md +0 -303
  88. package/node_modules/express/node_modules/raw-body/README.md +0 -223
  89. package/node_modules/express/node_modules/raw-body/SECURITY.md +0 -24
  90. package/node_modules/express/node_modules/raw-body/index.d.ts +0 -87
  91. package/node_modules/express/node_modules/raw-body/index.js +0 -329
  92. package/node_modules/express/node_modules/raw-body/package.json +0 -49
  93. package/node_modules/hasown/index.d.ts.map +0 -1
  94. package/node_modules/side-channel/.eslintignore +0 -1
@@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [v1.0.7](https://github.com/ljharb/call-bind/compare/v1.0.6...v1.0.7) - 2024-02-12
9
+
10
+ ### Commits
11
+
12
+ - [Refactor] use `es-define-property` [`09b76a0`](https://github.com/ljharb/call-bind/commit/09b76a01634440461d44a80c9924ec4b500f3b03)
13
+ - [Deps] update `get-intrinsic`, `set-function-length` [`ad5136d`](https://github.com/ljharb/call-bind/commit/ad5136ddda2a45c590959829ad3dce0c9f4e3590)
14
+
15
+ ## [v1.0.6](https://github.com/ljharb/call-bind/compare/v1.0.5...v1.0.6) - 2024-02-05
16
+
17
+ ### Commits
18
+
19
+ - [Dev Deps] update `aud`, `npmignore`, `tape` [`d564d5c`](https://github.com/ljharb/call-bind/commit/d564d5ce3e06a19df4d499c77f8d1a9da44e77aa)
20
+ - [Deps] update `get-intrinsic`, `set-function-length` [`cfc2bdc`](https://github.com/ljharb/call-bind/commit/cfc2bdca7b633df0e0e689e6b637f668f1c6792e)
21
+ - [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`64cd289`](https://github.com/ljharb/call-bind/commit/64cd289ae5862c250a4ca80aa8d461047c166af5)
22
+ - [meta] add missing `engines.node` [`32a4038`](https://github.com/ljharb/call-bind/commit/32a4038857b62179f7f9b7b3df2c5260036be582)
23
+
8
24
  ## [v1.0.5](https://github.com/ljharb/call-bind/compare/v1.0.4...v1.0.5) - 2023-10-19
9
25
 
10
26
  ### Commits
@@ -4,23 +4,14 @@ var bind = require('function-bind');
4
4
  var GetIntrinsic = require('get-intrinsic');
5
5
  var setFunctionLength = require('set-function-length');
6
6
 
7
- var $TypeError = GetIntrinsic('%TypeError%');
7
+ var $TypeError = require('es-errors/type');
8
8
  var $apply = GetIntrinsic('%Function.prototype.apply%');
9
9
  var $call = GetIntrinsic('%Function.prototype.call%');
10
10
  var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
11
11
 
12
- var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
12
+ var $defineProperty = require('es-define-property');
13
13
  var $max = GetIntrinsic('%Math.max%');
14
14
 
15
- if ($defineProperty) {
16
- try {
17
- $defineProperty({}, 'a', { value: 1 });
18
- } catch (e) {
19
- // IE 8 has a broken defineProperty
20
- $defineProperty = null;
21
- }
22
- }
23
-
24
15
  module.exports = function callBind(originalFunction) {
25
16
  if (typeof originalFunction !== 'function') {
26
17
  throw new $TypeError('a function is required');
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "call-bind",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "Robustly `.call.bind()` a function",
5
5
  "main": "index.js",
6
6
  "exports": {
@@ -51,7 +51,7 @@
51
51
  "homepage": "https://github.com/ljharb/call-bind#readme",
52
52
  "devDependencies": {
53
53
  "@ljharb/eslint-config": "^21.1.0",
54
- "aud": "^2.0.3",
54
+ "aud": "^2.0.4",
55
55
  "auto-changelog": "^2.4.0",
56
56
  "es-value-fixtures": "^1.4.2",
57
57
  "eslint": "=8.8.0",
@@ -60,16 +60,18 @@
60
60
  "gopd": "^1.0.1",
61
61
  "has-strict-mode": "^1.0.1",
62
62
  "in-publish": "^2.0.1",
63
- "npmignore": "^0.3.0",
63
+ "npmignore": "^0.3.1",
64
64
  "nyc": "^10.3.2",
65
65
  "object-inspect": "^1.13.1",
66
66
  "safe-publish-latest": "^2.0.0",
67
- "tape": "^5.7.1"
67
+ "tape": "^5.7.4"
68
68
  },
69
69
  "dependencies": {
70
+ "es-define-property": "^1.0.0",
71
+ "es-errors": "^1.3.0",
70
72
  "function-bind": "^1.1.2",
71
- "get-intrinsic": "^1.2.1",
72
- "set-function-length": "^1.1.1"
73
+ "get-intrinsic": "^1.2.4",
74
+ "set-function-length": "^1.2.1"
73
75
  },
74
76
  "testling": {
75
77
  "files": "test/index.js"
@@ -86,5 +88,8 @@
86
88
  "ignore": [
87
89
  ".github/workflows"
88
90
  ]
91
+ },
92
+ "engines": {
93
+ "node": ">= 0.4"
89
94
  }
90
95
  }
@@ -5,6 +5,35 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [v1.1.4](https://github.com/ljharb/define-data-property/compare/v1.1.3...v1.1.4) - 2024-02-13
9
+
10
+ ### Commits
11
+
12
+ - [Refactor] use `es-define-property` [`90f2f4c`](https://github.com/ljharb/define-data-property/commit/90f2f4cc20298401e71c28e1e08888db12021453)
13
+ - [Dev Deps] update `@types/object.getownpropertydescriptors` [`cd929d9`](https://github.com/ljharb/define-data-property/commit/cd929d9a04f5f2fdcfa9d5be140940b91a083153)
14
+
15
+ ## [v1.1.3](https://github.com/ljharb/define-data-property/compare/v1.1.2...v1.1.3) - 2024-02-12
16
+
17
+ ### Commits
18
+
19
+ - [types] hand-write d.ts instead of emitting it [`0cbc988`](https://github.com/ljharb/define-data-property/commit/0cbc988203c105f2d97948327c7167ebd33bd318)
20
+ - [meta] simplify `exports` [`690781e`](https://github.com/ljharb/define-data-property/commit/690781eed28bbf2d6766237efda0ba6dd591609e)
21
+ - [Dev Deps] update `hasown`; clean up DT packages [`6cdfd1c`](https://github.com/ljharb/define-data-property/commit/6cdfd1cb2d91d791bfd18cda5d5cab232fd5d8fc)
22
+ - [actions] cleanup [`3142bc6`](https://github.com/ljharb/define-data-property/commit/3142bc6a4bc406a51f5b04f31e98562a27f35ffd)
23
+ - [meta] add `funding` [`8474423`](https://github.com/ljharb/define-data-property/commit/847442391a79779af3e0f1bf0b5bb923552b7804)
24
+ - [Deps] update `get-intrinsic` [`3e9be00`](https://github.com/ljharb/define-data-property/commit/3e9be00e07784ba34e7c77d8bc0fdbc832ad61de)
25
+
26
+ ## [v1.1.2](https://github.com/ljharb/define-data-property/compare/v1.1.1...v1.1.2) - 2024-02-05
27
+
28
+ ### Commits
29
+
30
+ - [Dev Deps] update @types packages, `object-inspect`, `tape`, `typescript` [`df41bf8`](https://github.com/ljharb/define-data-property/commit/df41bf84ca3456be6226055caab44e38e3a7fd2f)
31
+ - [Dev Deps] update DT packages, `aud`, `npmignore`, `tape`, typescript` [`fab0e4e`](https://github.com/ljharb/define-data-property/commit/fab0e4ec709ee02b79f42d6db3ee5f26e0a34b8a)
32
+ - [Dev Deps] use `hasown` instead of `has` [`aa51ef9`](https://github.com/ljharb/define-data-property/commit/aa51ef93f6403d49d9bb72a807bcdb6e418978c0)
33
+ - [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`d89be50`](https://github.com/ljharb/define-data-property/commit/d89be50571175888d391238605122679f7e65ffc)
34
+ - [Deps] update `has-property-descriptors` [`7af887c`](https://github.com/ljharb/define-data-property/commit/7af887c9083b59b195b0079e04815cfed9fcee2b)
35
+ - [Deps] update `get-intrinsic` [`bb8728e`](https://github.com/ljharb/define-data-property/commit/bb8728ec42cd998505a7157ae24853a560c20646)
36
+
8
37
  ## [v1.1.1](https://github.com/ljharb/define-data-property/compare/v1.1.0...v1.1.1) - 2023-10-12
9
38
 
10
39
  ### Commits
@@ -1,3 +1,12 @@
1
- declare const _exports: (obj: Record<PropertyKey, unknown>, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void;
2
- export = _exports;
3
- //# sourceMappingURL=index.d.ts.map
1
+
2
+ declare function defineDataProperty(
3
+ obj: Record<PropertyKey, unknown>,
4
+ property: keyof typeof obj,
5
+ value: typeof obj[typeof property],
6
+ nonEnumerable?: boolean | null,
7
+ nonWritable?: boolean | null,
8
+ nonConfigurable?: boolean | null,
9
+ loose?: boolean
10
+ ): void;
11
+
12
+ export = defineDataProperty;
@@ -1,25 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var hasPropertyDescriptors = require('has-property-descriptors')();
3
+ var $defineProperty = require('es-define-property');
4
4
 
5
- var GetIntrinsic = require('get-intrinsic');
6
-
7
- var $defineProperty = hasPropertyDescriptors && GetIntrinsic('%Object.defineProperty%', true);
8
- if ($defineProperty) {
9
- try {
10
- $defineProperty({}, 'a', { value: 1 });
11
- } catch (e) {
12
- // IE 8 has a broken defineProperty
13
- $defineProperty = false;
14
- }
15
- }
16
-
17
- var $SyntaxError = GetIntrinsic('%SyntaxError%');
18
- var $TypeError = GetIntrinsic('%TypeError%');
5
+ var $SyntaxError = require('es-errors/syntax');
6
+ var $TypeError = require('es-errors/type');
19
7
 
20
8
  var gopd = require('gopd');
21
9
 
22
- /** @type {(obj: Record<PropertyKey, unknown>, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void} */
10
+ /** @type {import('.')} */
23
11
  module.exports = function defineDataProperty(
24
12
  obj,
25
13
  property,
@@ -1,28 +1,19 @@
1
1
  {
2
2
  "name": "define-data-property",
3
- "version": "1.1.1",
3
+ "version": "1.1.4",
4
4
  "description": "Define a data property on an object. Will fall back to assignment in an engine without descriptors.",
5
5
  "main": "index.js",
6
+ "types": "./index.d.ts",
6
7
  "exports": {
7
- ".": [
8
- {
9
- "types": "./index.d.ts",
10
- "default": "./index.js"
11
- },
12
- "./index.js"
13
- ],
8
+ ".": "./index.js",
14
9
  "./package.json": "./package.json"
15
10
  },
16
11
  "sideEffects": false,
17
- "types": "./index.d.ts",
18
12
  "scripts": {
19
- "prepack": "npmignore --auto --commentLines=autogenerated && npm run emit-types",
13
+ "prepack": "npmignore --auto --commentLines=autogenerated",
20
14
  "prepublish": "not-in-publish || npm run prepublishOnly",
21
15
  "prepublishOnly": "safe-publish-latest",
22
16
  "tsc": "tsc -p .",
23
- "preemit-types": "rm -f *.ts *.ts.map test/*.ts test/*.ts.map",
24
- "emit-types": "npm run tsc -- --noEmit false --emitDeclarationOnly",
25
- "postemit-types": "rm test/*.ts test/*.ts.map",
26
17
  "prelint": "evalmd README.md",
27
18
  "lint": "eslint --ext=js,mjs .",
28
19
  "postlint": "npm run tsc",
@@ -50,43 +41,47 @@
50
41
  "writable"
51
42
  ],
52
43
  "author": "Jordan Harband <ljharb@gmail.com>",
44
+ "funding": {
45
+ "url": "https://github.com/sponsors/ljharb"
46
+ },
53
47
  "license": "MIT",
54
48
  "bugs": {
55
49
  "url": "https://github.com/ljharb/define-data-property/issues"
56
50
  },
57
51
  "homepage": "https://github.com/ljharb/define-data-property#readme",
58
52
  "dependencies": {
59
- "get-intrinsic": "^1.2.1",
60
- "gopd": "^1.0.1",
61
- "has-property-descriptors": "^1.0.0"
53
+ "es-define-property": "^1.0.0",
54
+ "es-errors": "^1.3.0",
55
+ "gopd": "^1.0.1"
62
56
  },
63
57
  "devDependencies": {
64
58
  "@ljharb/eslint-config": "^21.1.0",
65
- "@types/es-value-fixtures": "^1.4.1",
66
- "@types/for-each": "^0.3.1",
67
- "@types/get-intrinsic": "^1.2.0",
68
- "@types/gopd": "^1.0.1",
69
- "@types/has": "^1.0.0",
70
- "@types/has-property-descriptors": "^1.0.1",
71
- "@types/object-inspect": "^1.8.2",
72
- "@types/object.getownpropertydescriptors": "^2.1.2",
73
- "@types/tape": "^5.6.1",
74
- "aud": "^2.0.3",
59
+ "@types/call-bind": "^1.0.5",
60
+ "@types/define-properties": "^1.1.5",
61
+ "@types/es-value-fixtures": "^1.4.4",
62
+ "@types/for-each": "^0.3.3",
63
+ "@types/get-intrinsic": "^1.2.2",
64
+ "@types/gopd": "^1.0.3",
65
+ "@types/has-property-descriptors": "^1.0.3",
66
+ "@types/object-inspect": "^1.8.4",
67
+ "@types/object.getownpropertydescriptors": "^2.1.4",
68
+ "@types/tape": "^5.6.4",
69
+ "aud": "^2.0.4",
75
70
  "auto-changelog": "^2.4.0",
76
71
  "es-value-fixtures": "^1.4.2",
77
72
  "eslint": "=8.8.0",
78
73
  "evalmd": "^0.0.19",
79
74
  "for-each": "^0.3.3",
80
- "has": "^1.0.3",
75
+ "hasown": "^2.0.1",
81
76
  "in-publish": "^2.0.1",
82
- "npmignore": "^0.3.0",
77
+ "npmignore": "^0.3.1",
83
78
  "nyc": "^10.3.2",
84
- "object-inspect": "^1.12.3",
79
+ "object-inspect": "^1.13.1",
85
80
  "object.getownpropertydescriptors": "^2.1.7",
86
81
  "reflect.ownkeys": "^1.1.4",
87
82
  "safe-publish-latest": "^2.0.0",
88
- "tape": "^5.7.1",
89
- "typescript": "^5.3.0-dev.20231012"
83
+ "tape": "^5.7.4",
84
+ "typescript": "next"
90
85
  },
91
86
  "engines": {
92
87
  "node": ">= 0.4"
@@ -105,8 +100,6 @@
105
100
  "publishConfig": {
106
101
  "ignore": [
107
102
  ".github/workflows",
108
- "!*.ts",
109
- "!*.ts.map",
110
103
  "types/reflect.ownkeys"
111
104
  ]
112
105
  }
@@ -4,7 +4,7 @@ var test = require('tape');
4
4
  var v = require('es-value-fixtures');
5
5
  var forEach = require('for-each');
6
6
  var inspect = require('object-inspect');
7
- var has = require('has');
7
+ var hasOwn = require('hasown');
8
8
  var hasPropertyDescriptors = require('has-property-descriptors')();
9
9
  var getOwnPropertyDescriptors = require('object.getownpropertydescriptors');
10
10
  var ownKeys = require('reflect.ownkeys');
@@ -34,21 +34,21 @@ test('defineDataProperty', function (t) {
34
34
  forEach(v.nonBooleans, function (nonBoolean) {
35
35
  if (nonBoolean !== null) {
36
36
  st['throws'](
37
- // @ts-expect-error
37
+ // @ts-expect-error
38
38
  function () { defineDataProperty({}, 'key', 'value', nonBoolean); },
39
39
  TypeError,
40
40
  'throws on non-boolean nonEnumerable: ' + inspect(nonBoolean)
41
41
  );
42
42
 
43
43
  st['throws'](
44
- // @ts-expect-error
44
+ // @ts-expect-error
45
45
  function () { defineDataProperty({}, 'key', 'value', false, nonBoolean); },
46
46
  TypeError,
47
47
  'throws on non-boolean nonWritable: ' + inspect(nonBoolean)
48
48
  );
49
49
 
50
50
  st['throws'](
51
- // @ts-expect-error
51
+ // @ts-expect-error
52
52
  function () { defineDataProperty({}, 'key', 'value', false, false, nonBoolean); },
53
53
  TypeError,
54
54
  'throws on non-boolean nonConfigurable: ' + inspect(nonBoolean)
@@ -62,28 +62,28 @@ test('defineDataProperty', function (t) {
62
62
  t.test('normal data property', function (st) {
63
63
  /** @type {Record<PropertyKey, string>} */
64
64
  var obj = { existing: 'existing property' };
65
- st.ok(has(obj, 'existing'), 'has initial own property');
65
+ st.ok(hasOwn(obj, 'existing'), 'has initial own property');
66
66
  st.equal(obj.existing, 'existing property', 'has expected initial value');
67
67
 
68
68
  var res = defineDataProperty(obj, 'added', 'added property');
69
69
  st.equal(res, void undefined, 'returns `undefined`');
70
- st.ok(has(obj, 'added'), 'has expected own property');
70
+ st.ok(hasOwn(obj, 'added'), 'has expected own property');
71
71
  st.equal(obj.added, 'added property', 'has expected value');
72
72
 
73
73
  defineDataProperty(obj, 'existing', 'new value');
74
- st.ok(has(obj, 'existing'), 'still has expected own property');
74
+ st.ok(hasOwn(obj, 'existing'), 'still has expected own property');
75
75
  st.equal(obj.existing, 'new value', 'has new expected value');
76
76
 
77
77
  defineDataProperty(obj, 'explicit1', 'new value', false);
78
- st.ok(has(obj, 'explicit1'), 'has expected own property (explicit enumerable)');
78
+ st.ok(hasOwn(obj, 'explicit1'), 'has expected own property (explicit enumerable)');
79
79
  st.equal(obj.explicit1, 'new value', 'has new expected value (explicit enumerable)');
80
80
 
81
81
  defineDataProperty(obj, 'explicit2', 'new value', false, false);
82
- st.ok(has(obj, 'explicit2'), 'has expected own property (explicit writable)');
82
+ st.ok(hasOwn(obj, 'explicit2'), 'has expected own property (explicit writable)');
83
83
  st.equal(obj.explicit2, 'new value', 'has new expected value (explicit writable)');
84
84
 
85
85
  defineDataProperty(obj, 'explicit3', 'new value', false, false, false);
86
- st.ok(has(obj, 'explicit3'), 'has expected own property (explicit configurable)');
86
+ st.ok(hasOwn(obj, 'explicit3'), 'has expected own property (explicit configurable)');
87
87
  st.equal(obj.explicit3, 'new value', 'has new expected value (explicit configurable)');
88
88
 
89
89
  st.end();
@@ -0,0 +1,13 @@
1
+ {
2
+ "root": true,
3
+
4
+ "extends": "@ljharb",
5
+
6
+ "rules": {
7
+ "new-cap": ["error", {
8
+ "capIsNewExceptions": [
9
+ "GetIntrinsic",
10
+ ],
11
+ }],
12
+ },
13
+ }
@@ -0,0 +1,12 @@
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/es-define-property
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
@@ -0,0 +1,9 @@
1
+ {
2
+ "all": true,
3
+ "check-coverage": false,
4
+ "reporter": ["text-summary", "text", "html", "json"],
5
+ "exclude": [
6
+ "coverage",
7
+ "test"
8
+ ]
9
+ }
@@ -0,0 +1,15 @@
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.0.0 - 2024-02-12
9
+
10
+ ### Commits
11
+
12
+ - Initial implementation, tests, readme, types [`3e154e1`](https://github.com/ljharb/es-define-property/commit/3e154e11a2fee09127220f5e503bf2c0a31dd480)
13
+ - Initial commit [`07d98de`](https://github.com/ljharb/es-define-property/commit/07d98de34a4dc31ff5e83a37c0c3f49e0d85cd50)
14
+ - npm init [`c4eb634`](https://github.com/ljharb/es-define-property/commit/c4eb6348b0d3886aac36cef34ad2ee0665ea6f3e)
15
+ - Only apps should have lockfiles [`7af86ec`](https://github.com/ljharb/es-define-property/commit/7af86ec1d311ec0b17fdfe616a25f64276903856)
@@ -1,7 +1,6 @@
1
- The MIT License (MIT)
1
+ MIT License
2
2
 
3
- Copyright (c) 2013-2014 Jonathan Ong <me@jongleberry.com>
4
- Copyright (c) 2014-2022 Douglas Christopher Wilson <doug@somethingdoug.com>
3
+ Copyright (c) 2024 Jordan Harband
5
4
 
6
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
7
6
  of this software and associated documentation files (the "Software"), to deal
@@ -10,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
9
  copies of the Software, and to permit persons to whom the Software is
11
10
  furnished to do so, subject to the following conditions:
12
11
 
13
- The above copyright notice and this permission notice shall be included in
14
- all copies or substantial portions of the Software.
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
15
14
 
16
15
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
16
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
17
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- THE SOFTWARE.
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,49 @@
1
+ # es-define-property <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
+ `Object.defineProperty`, but not IE 8's broken one.
11
+
12
+ ## Example
13
+
14
+ ```js
15
+ const assert = require('assert');
16
+
17
+ const $defineProperty = require('es-define-property');
18
+
19
+ if ($defineProperty) {
20
+ assert.equal($defineProperty, Object.defineProperty);
21
+ } else if (Object.defineProperty) {
22
+ assert.equal($defineProperty, false, 'this is IE 8');
23
+ } else {
24
+ assert.equal($defineProperty, false, 'this is an ES3 engine');
25
+ }
26
+ ```
27
+
28
+ ## Tests
29
+ Simply clone the repo, `npm install`, and run `npm test`
30
+
31
+ ## Security
32
+
33
+ Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report.
34
+
35
+ [package-url]: https://npmjs.org/package/es-define-property
36
+ [npm-version-svg]: https://versionbadg.es/ljharb/es-define-property.svg
37
+ [deps-svg]: https://david-dm.org/ljharb/es-define-property.svg
38
+ [deps-url]: https://david-dm.org/ljharb/es-define-property
39
+ [dev-deps-svg]: https://david-dm.org/ljharb/es-define-property/dev-status.svg
40
+ [dev-deps-url]: https://david-dm.org/ljharb/es-define-property#info=devDependencies
41
+ [npm-badge-png]: https://nodei.co/npm/es-define-property.png?downloads=true&stars=true
42
+ [license-image]: https://img.shields.io/npm/l/es-define-property.svg
43
+ [license-url]: LICENSE
44
+ [downloads-image]: https://img.shields.io/npm/dm/es-define-property.svg
45
+ [downloads-url]: https://npm-stat.com/charts.html?package=es-define-property
46
+ [codecov-image]: https://codecov.io/gh/ljharb/es-define-property/branch/main/graphs/badge.svg
47
+ [codecov-url]: https://app.codecov.io/gh/ljharb/es-define-property/
48
+ [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/es-define-property
49
+ [actions-url]: https://github.com/ljharb/es-define-property/actions
@@ -0,0 +1,3 @@
1
+ declare const defineProperty: false | typeof Object.defineProperty;
2
+
3
+ export = defineProperty;
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ var GetIntrinsic = require('get-intrinsic');
4
+
5
+ /** @type {import('.')} */
6
+ var $defineProperty = GetIntrinsic('%Object.defineProperty%', true) || false;
7
+ if ($defineProperty) {
8
+ try {
9
+ $defineProperty({}, 'a', { value: 1 });
10
+ } catch (e) {
11
+ // IE 8 has a broken defineProperty
12
+ $defineProperty = false;
13
+ }
14
+ }
15
+
16
+ module.exports = $defineProperty;
@@ -0,0 +1,81 @@
1
+ {
2
+ "name": "es-define-property",
3
+ "version": "1.0.0",
4
+ "description": "`Object.defineProperty`, but not IE 8's broken one.",
5
+ "main": "index.js",
6
+ "types": "./index.d.ts",
7
+ "exports": {
8
+ ".": "./index.js",
9
+ "./package.json": "./package.json"
10
+ },
11
+ "sideEffects": false,
12
+ "scripts": {
13
+ "prepack": "npmignore --auto --commentLines=autogenerated",
14
+ "prepublish": "not-in-publish || npm run prepublishOnly",
15
+ "prepublishOnly": "safe-publish-latest",
16
+ "prelint": "evalmd README.md",
17
+ "lint": "eslint --ext=js,mjs .",
18
+ "postlint": "tsc -p .",
19
+ "pretest": "npm run lint",
20
+ "tests-only": "nyc tape 'test/**/*.js'",
21
+ "test": "npm run tests-only",
22
+ "posttest": "aud --production",
23
+ "version": "auto-changelog && git add CHANGELOG.md",
24
+ "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
25
+ },
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "git+https://github.com/ljharb/es-define-property.git"
29
+ },
30
+ "keywords": [
31
+ "javascript",
32
+ "ecmascript",
33
+ "object",
34
+ "define",
35
+ "property",
36
+ "defineProperty",
37
+ "Object.defineProperty"
38
+ ],
39
+ "author": "Jordan Harband <ljharb@gmail.com>",
40
+ "license": "MIT",
41
+ "bugs": {
42
+ "url": "https://github.com/ljharb/es-define-property/issues"
43
+ },
44
+ "homepage": "https://github.com/ljharb/es-define-property#readme",
45
+ "dependencies": {
46
+ "get-intrinsic": "^1.2.4"
47
+ },
48
+ "devDependencies": {
49
+ "@ljharb/eslint-config": "^21.1.0",
50
+ "@types/get-intrinsic": "^1.2.2",
51
+ "@types/gopd": "^1.0.3",
52
+ "@types/tape": "^5.6.4",
53
+ "aud": "^2.0.4",
54
+ "auto-changelog": "^2.4.0",
55
+ "eslint": "^8.8.0",
56
+ "evalmd": "^0.0.19",
57
+ "gopd": "^1.0.1",
58
+ "in-publish": "^2.0.1",
59
+ "npmignore": "^0.3.1",
60
+ "nyc": "^10.3.2",
61
+ "safe-publish-latest": "^2.0.0",
62
+ "tape": "^5.7.4",
63
+ "typescript": "next"
64
+ },
65
+ "engines": {
66
+ "node": ">= 0.4"
67
+ },
68
+ "auto-changelog": {
69
+ "output": "CHANGELOG.md",
70
+ "template": "keepachangelog",
71
+ "unreleased": false,
72
+ "commitLimit": false,
73
+ "backfillLimit": false,
74
+ "hideCredit": true
75
+ },
76
+ "publishConfig": {
77
+ "ignore": [
78
+ ".github/workflows"
79
+ ]
80
+ }
81
+ }
@@ -0,0 +1,55 @@
1
+ 'use strict';
2
+
3
+ var $defineProperty = require('../');
4
+
5
+ var test = require('tape');
6
+ var gOPD = require('gopd');
7
+
8
+ test('defineProperty: supported', { skip: !$defineProperty }, function (t) {
9
+ t.plan(4);
10
+
11
+ t.equal(typeof $defineProperty, 'function', 'defineProperty is supported');
12
+ if ($defineProperty && gOPD) { // this `if` check is just to shut TS up
13
+ var o = { a: 1 };
14
+
15
+ $defineProperty(o, 'b', { enumerable: true, value: 2 });
16
+ t.deepEqual(
17
+ gOPD(o, 'b'),
18
+ {
19
+ configurable: false,
20
+ enumerable: true,
21
+ value: 2,
22
+ writable: false
23
+ },
24
+ 'property descriptor is as expected'
25
+ );
26
+
27
+ $defineProperty(o, 'c', { enumerable: false, value: 3, writable: true });
28
+ t.deepEqual(
29
+ gOPD(o, 'c'),
30
+ {
31
+ configurable: false,
32
+ enumerable: false,
33
+ value: 3,
34
+ writable: true
35
+ },
36
+ 'property descriptor is as expected'
37
+ );
38
+ }
39
+
40
+ t.equal($defineProperty, Object.defineProperty, 'defineProperty is Object.defineProperty');
41
+
42
+ t.end();
43
+ });
44
+
45
+ test('defineProperty: not supported', { skip: !!$defineProperty }, function (t) {
46
+ t.notOk($defineProperty, 'defineProperty is not supported');
47
+
48
+ t.match(
49
+ typeof $defineProperty,
50
+ /^(?:undefined|boolean)$/,
51
+ '`typeof defineProperty` is `undefined` or `boolean`'
52
+ );
53
+
54
+ t.end();
55
+ });