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.
Files changed (363) hide show
  1. package/.jsii +34 -34
  2. package/README.md +1 -1
  3. package/lib/annotations.js +1 -1
  4. package/lib/app.js +1 -1
  5. package/lib/aspect.js +1 -1
  6. package/lib/backends/azurerm-backend.js +2 -2
  7. package/lib/backends/cloud-backend.js +4 -4
  8. package/lib/backends/consul-backend.js +2 -2
  9. package/lib/backends/cos-backend.js +2 -2
  10. package/lib/backends/gcs-backend.js +2 -2
  11. package/lib/backends/http-backend.js +2 -2
  12. package/lib/backends/local-backend.js +2 -2
  13. package/lib/backends/oss-backend.js +2 -2
  14. package/lib/backends/pg-backend.js +2 -2
  15. package/lib/backends/remote-backend.js +4 -4
  16. package/lib/backends/s3-backend.js +2 -2
  17. package/lib/backends/swift-backend.js +2 -2
  18. package/lib/complex-computed-list.js +25 -25
  19. package/lib/errors.d.ts +1 -2
  20. package/lib/errors.js +11 -8
  21. package/lib/functions/terraform-functions.generated.js +1 -1
  22. package/lib/importable-resource.js +1 -1
  23. package/lib/manifest.js +4 -5
  24. package/lib/resource.js +1 -1
  25. package/lib/synthesize/synthesizer.js +4 -5
  26. package/lib/terraform-asset.js +1 -1
  27. package/lib/terraform-backend.js +1 -1
  28. package/lib/terraform-count.js +1 -1
  29. package/lib/terraform-data-resource.js +1 -1
  30. package/lib/terraform-data-source.js +1 -1
  31. package/lib/terraform-dynamic-block.js +2 -2
  32. package/lib/terraform-dynamic-expression.js +2 -2
  33. package/lib/terraform-element.js +1 -1
  34. package/lib/terraform-functions.js +1 -1
  35. package/lib/terraform-hcl-module.js +1 -1
  36. package/lib/terraform-iterator.js +5 -5
  37. package/lib/terraform-local.js +1 -1
  38. package/lib/terraform-module.js +1 -1
  39. package/lib/terraform-operators.js +1 -1
  40. package/lib/terraform-output.js +1 -1
  41. package/lib/terraform-provider.js +1 -1
  42. package/lib/terraform-provisioner.js +1 -1
  43. package/lib/terraform-remote-state.js +1 -1
  44. package/lib/terraform-resource-targets.js +1 -1
  45. package/lib/terraform-resource.js +1 -1
  46. package/lib/terraform-stack.js +1 -1
  47. package/lib/terraform-variable.js +2 -2
  48. package/lib/testing/index.js +7 -8
  49. package/lib/testing/matchers.js +1 -1
  50. package/lib/tokens/lazy.js +4 -4
  51. package/lib/tokens/private/intrinsic.d.ts +0 -5
  52. package/lib/tokens/private/intrinsic.js +2 -9
  53. package/lib/tokens/private/stack-trace.d.ts +6 -0
  54. package/lib/tokens/private/stack-trace.js +14 -1
  55. package/lib/tokens/resolvable.js +4 -4
  56. package/lib/tokens/string-fragments.js +1 -1
  57. package/lib/tokens/token.js +2 -2
  58. package/lib/tsconfig.tsbuildinfo +1 -1
  59. package/lib/upgrade-id-aspect.js +1 -1
  60. package/node_modules/{call-bind-apply-helpers → safe-stable-stringify}/LICENSE +2 -2
  61. package/node_modules/safe-stable-stringify/esm/package.json +4 -0
  62. package/node_modules/safe-stable-stringify/esm/wrapper.d.ts +4 -0
  63. package/node_modules/safe-stable-stringify/esm/wrapper.js +6 -0
  64. package/node_modules/safe-stable-stringify/index.d.ts +22 -0
  65. package/node_modules/safe-stable-stringify/index.js +625 -0
  66. package/node_modules/safe-stable-stringify/package.json +65 -0
  67. package/node_modules/safe-stable-stringify/readme.md +179 -0
  68. package/package.json +5 -6
  69. package/node_modules/call-bind/.eslintignore +0 -1
  70. package/node_modules/call-bind/.eslintrc +0 -16
  71. package/node_modules/call-bind/.github/FUNDING.yml +0 -12
  72. package/node_modules/call-bind/.nycrc +0 -9
  73. package/node_modules/call-bind/CHANGELOG.md +0 -106
  74. package/node_modules/call-bind/LICENSE +0 -21
  75. package/node_modules/call-bind/README.md +0 -64
  76. package/node_modules/call-bind/callBound.js +0 -15
  77. package/node_modules/call-bind/index.js +0 -24
  78. package/node_modules/call-bind/package.json +0 -93
  79. package/node_modules/call-bind/test/callBound.js +0 -54
  80. package/node_modules/call-bind/test/index.js +0 -74
  81. package/node_modules/call-bind-apply-helpers/.eslintrc +0 -17
  82. package/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +0 -12
  83. package/node_modules/call-bind-apply-helpers/.nycrc +0 -9
  84. package/node_modules/call-bind-apply-helpers/CHANGELOG.md +0 -30
  85. package/node_modules/call-bind-apply-helpers/README.md +0 -62
  86. package/node_modules/call-bind-apply-helpers/actualApply.d.ts +0 -1
  87. package/node_modules/call-bind-apply-helpers/actualApply.js +0 -10
  88. package/node_modules/call-bind-apply-helpers/applyBind.d.ts +0 -19
  89. package/node_modules/call-bind-apply-helpers/applyBind.js +0 -10
  90. package/node_modules/call-bind-apply-helpers/functionApply.d.ts +0 -1
  91. package/node_modules/call-bind-apply-helpers/functionApply.js +0 -4
  92. package/node_modules/call-bind-apply-helpers/functionCall.d.ts +0 -1
  93. package/node_modules/call-bind-apply-helpers/functionCall.js +0 -4
  94. package/node_modules/call-bind-apply-helpers/index.d.ts +0 -64
  95. package/node_modules/call-bind-apply-helpers/index.js +0 -15
  96. package/node_modules/call-bind-apply-helpers/package.json +0 -85
  97. package/node_modules/call-bind-apply-helpers/reflectApply.d.ts +0 -3
  98. package/node_modules/call-bind-apply-helpers/reflectApply.js +0 -4
  99. package/node_modules/call-bind-apply-helpers/test/index.js +0 -63
  100. package/node_modules/call-bind-apply-helpers/tsconfig.json +0 -9
  101. package/node_modules/call-bound/.eslintrc +0 -13
  102. package/node_modules/call-bound/.github/FUNDING.yml +0 -12
  103. package/node_modules/call-bound/.nycrc +0 -9
  104. package/node_modules/call-bound/CHANGELOG.md +0 -42
  105. package/node_modules/call-bound/LICENSE +0 -21
  106. package/node_modules/call-bound/README.md +0 -53
  107. package/node_modules/call-bound/index.d.ts +0 -94
  108. package/node_modules/call-bound/index.js +0 -19
  109. package/node_modules/call-bound/package.json +0 -99
  110. package/node_modules/call-bound/test/index.js +0 -61
  111. package/node_modules/call-bound/tsconfig.json +0 -10
  112. package/node_modules/define-data-property/.eslintrc +0 -24
  113. package/node_modules/define-data-property/.github/FUNDING.yml +0 -12
  114. package/node_modules/define-data-property/.nycrc +0 -13
  115. package/node_modules/define-data-property/CHANGELOG.md +0 -70
  116. package/node_modules/define-data-property/LICENSE +0 -21
  117. package/node_modules/define-data-property/README.md +0 -67
  118. package/node_modules/define-data-property/index.d.ts +0 -12
  119. package/node_modules/define-data-property/index.js +0 -56
  120. package/node_modules/define-data-property/package.json +0 -106
  121. package/node_modules/define-data-property/test/index.js +0 -392
  122. package/node_modules/define-data-property/tsconfig.json +0 -59
  123. package/node_modules/dunder-proto/.eslintrc +0 -5
  124. package/node_modules/dunder-proto/.github/FUNDING.yml +0 -12
  125. package/node_modules/dunder-proto/.nycrc +0 -13
  126. package/node_modules/dunder-proto/CHANGELOG.md +0 -24
  127. package/node_modules/dunder-proto/LICENSE +0 -21
  128. package/node_modules/dunder-proto/README.md +0 -54
  129. package/node_modules/dunder-proto/get.d.ts +0 -5
  130. package/node_modules/dunder-proto/get.js +0 -30
  131. package/node_modules/dunder-proto/package.json +0 -76
  132. package/node_modules/dunder-proto/set.d.ts +0 -5
  133. package/node_modules/dunder-proto/set.js +0 -35
  134. package/node_modules/dunder-proto/test/get.js +0 -34
  135. package/node_modules/dunder-proto/test/index.js +0 -4
  136. package/node_modules/dunder-proto/test/set.js +0 -50
  137. package/node_modules/dunder-proto/tsconfig.json +0 -9
  138. package/node_modules/es-define-property/.eslintrc +0 -13
  139. package/node_modules/es-define-property/.github/FUNDING.yml +0 -12
  140. package/node_modules/es-define-property/.nycrc +0 -9
  141. package/node_modules/es-define-property/CHANGELOG.md +0 -29
  142. package/node_modules/es-define-property/LICENSE +0 -21
  143. package/node_modules/es-define-property/README.md +0 -49
  144. package/node_modules/es-define-property/index.d.ts +0 -3
  145. package/node_modules/es-define-property/index.js +0 -14
  146. package/node_modules/es-define-property/package.json +0 -81
  147. package/node_modules/es-define-property/test/index.js +0 -56
  148. package/node_modules/es-define-property/tsconfig.json +0 -10
  149. package/node_modules/es-errors/.eslintrc +0 -5
  150. package/node_modules/es-errors/.github/FUNDING.yml +0 -12
  151. package/node_modules/es-errors/CHANGELOG.md +0 -40
  152. package/node_modules/es-errors/LICENSE +0 -21
  153. package/node_modules/es-errors/README.md +0 -55
  154. package/node_modules/es-errors/eval.d.ts +0 -3
  155. package/node_modules/es-errors/eval.js +0 -4
  156. package/node_modules/es-errors/index.d.ts +0 -3
  157. package/node_modules/es-errors/index.js +0 -4
  158. package/node_modules/es-errors/package.json +0 -80
  159. package/node_modules/es-errors/range.d.ts +0 -3
  160. package/node_modules/es-errors/range.js +0 -4
  161. package/node_modules/es-errors/ref.d.ts +0 -3
  162. package/node_modules/es-errors/ref.js +0 -4
  163. package/node_modules/es-errors/syntax.d.ts +0 -3
  164. package/node_modules/es-errors/syntax.js +0 -4
  165. package/node_modules/es-errors/test/index.js +0 -19
  166. package/node_modules/es-errors/tsconfig.json +0 -49
  167. package/node_modules/es-errors/type.d.ts +0 -3
  168. package/node_modules/es-errors/type.js +0 -4
  169. package/node_modules/es-errors/uri.d.ts +0 -3
  170. package/node_modules/es-errors/uri.js +0 -4
  171. package/node_modules/es-object-atoms/.eslintrc +0 -16
  172. package/node_modules/es-object-atoms/.github/FUNDING.yml +0 -12
  173. package/node_modules/es-object-atoms/CHANGELOG.md +0 -37
  174. package/node_modules/es-object-atoms/LICENSE +0 -21
  175. package/node_modules/es-object-atoms/README.md +0 -63
  176. package/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +0 -3
  177. package/node_modules/es-object-atoms/RequireObjectCoercible.js +0 -11
  178. package/node_modules/es-object-atoms/ToObject.d.ts +0 -7
  179. package/node_modules/es-object-atoms/ToObject.js +0 -10
  180. package/node_modules/es-object-atoms/index.d.ts +0 -3
  181. package/node_modules/es-object-atoms/index.js +0 -4
  182. package/node_modules/es-object-atoms/isObject.d.ts +0 -3
  183. package/node_modules/es-object-atoms/isObject.js +0 -6
  184. package/node_modules/es-object-atoms/package.json +0 -80
  185. package/node_modules/es-object-atoms/test/index.js +0 -38
  186. package/node_modules/es-object-atoms/tsconfig.json +0 -6
  187. package/node_modules/function-bind/.eslintrc +0 -21
  188. package/node_modules/function-bind/.github/FUNDING.yml +0 -12
  189. package/node_modules/function-bind/.github/SECURITY.md +0 -3
  190. package/node_modules/function-bind/.nycrc +0 -13
  191. package/node_modules/function-bind/CHANGELOG.md +0 -136
  192. package/node_modules/function-bind/LICENSE +0 -20
  193. package/node_modules/function-bind/README.md +0 -46
  194. package/node_modules/function-bind/implementation.js +0 -84
  195. package/node_modules/function-bind/index.js +0 -5
  196. package/node_modules/function-bind/package.json +0 -87
  197. package/node_modules/function-bind/test/.eslintrc +0 -9
  198. package/node_modules/function-bind/test/index.js +0 -252
  199. package/node_modules/get-intrinsic/.eslintrc +0 -42
  200. package/node_modules/get-intrinsic/.github/FUNDING.yml +0 -12
  201. package/node_modules/get-intrinsic/.nycrc +0 -9
  202. package/node_modules/get-intrinsic/CHANGELOG.md +0 -186
  203. package/node_modules/get-intrinsic/LICENSE +0 -21
  204. package/node_modules/get-intrinsic/README.md +0 -71
  205. package/node_modules/get-intrinsic/index.js +0 -378
  206. package/node_modules/get-intrinsic/package.json +0 -97
  207. package/node_modules/get-intrinsic/test/GetIntrinsic.js +0 -274
  208. package/node_modules/get-proto/.eslintrc +0 -10
  209. package/node_modules/get-proto/.github/FUNDING.yml +0 -12
  210. package/node_modules/get-proto/.nycrc +0 -9
  211. package/node_modules/get-proto/CHANGELOG.md +0 -21
  212. package/node_modules/get-proto/LICENSE +0 -21
  213. package/node_modules/get-proto/Object.getPrototypeOf.d.ts +0 -5
  214. package/node_modules/get-proto/Object.getPrototypeOf.js +0 -6
  215. package/node_modules/get-proto/README.md +0 -50
  216. package/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +0 -3
  217. package/node_modules/get-proto/Reflect.getPrototypeOf.js +0 -4
  218. package/node_modules/get-proto/index.d.ts +0 -5
  219. package/node_modules/get-proto/index.js +0 -27
  220. package/node_modules/get-proto/package.json +0 -81
  221. package/node_modules/get-proto/test/index.js +0 -68
  222. package/node_modules/get-proto/tsconfig.json +0 -9
  223. package/node_modules/gopd/.eslintrc +0 -16
  224. package/node_modules/gopd/.github/FUNDING.yml +0 -12
  225. package/node_modules/gopd/CHANGELOG.md +0 -45
  226. package/node_modules/gopd/LICENSE +0 -21
  227. package/node_modules/gopd/README.md +0 -40
  228. package/node_modules/gopd/gOPD.d.ts +0 -1
  229. package/node_modules/gopd/gOPD.js +0 -4
  230. package/node_modules/gopd/index.d.ts +0 -5
  231. package/node_modules/gopd/index.js +0 -15
  232. package/node_modules/gopd/package.json +0 -77
  233. package/node_modules/gopd/test/index.js +0 -36
  234. package/node_modules/gopd/tsconfig.json +0 -9
  235. package/node_modules/has-property-descriptors/.eslintrc +0 -13
  236. package/node_modules/has-property-descriptors/.github/FUNDING.yml +0 -12
  237. package/node_modules/has-property-descriptors/.nycrc +0 -9
  238. package/node_modules/has-property-descriptors/CHANGELOG.md +0 -35
  239. package/node_modules/has-property-descriptors/LICENSE +0 -21
  240. package/node_modules/has-property-descriptors/README.md +0 -43
  241. package/node_modules/has-property-descriptors/index.js +0 -22
  242. package/node_modules/has-property-descriptors/package.json +0 -77
  243. package/node_modules/has-property-descriptors/test/index.js +0 -57
  244. package/node_modules/has-symbols/.eslintrc +0 -11
  245. package/node_modules/has-symbols/.github/FUNDING.yml +0 -12
  246. package/node_modules/has-symbols/.nycrc +0 -9
  247. package/node_modules/has-symbols/CHANGELOG.md +0 -91
  248. package/node_modules/has-symbols/LICENSE +0 -21
  249. package/node_modules/has-symbols/README.md +0 -46
  250. package/node_modules/has-symbols/index.d.ts +0 -3
  251. package/node_modules/has-symbols/index.js +0 -14
  252. package/node_modules/has-symbols/package.json +0 -111
  253. package/node_modules/has-symbols/shams.d.ts +0 -3
  254. package/node_modules/has-symbols/shams.js +0 -45
  255. package/node_modules/has-symbols/test/index.js +0 -22
  256. package/node_modules/has-symbols/test/shams/core-js.js +0 -29
  257. package/node_modules/has-symbols/test/shams/get-own-property-symbols.js +0 -29
  258. package/node_modules/has-symbols/test/tests.js +0 -58
  259. package/node_modules/has-symbols/tsconfig.json +0 -10
  260. package/node_modules/hasown/.eslintrc +0 -5
  261. package/node_modules/hasown/.github/FUNDING.yml +0 -12
  262. package/node_modules/hasown/.nycrc +0 -13
  263. package/node_modules/hasown/CHANGELOG.md +0 -40
  264. package/node_modules/hasown/LICENSE +0 -21
  265. package/node_modules/hasown/README.md +0 -40
  266. package/node_modules/hasown/index.d.ts +0 -3
  267. package/node_modules/hasown/index.js +0 -8
  268. package/node_modules/hasown/package.json +0 -92
  269. package/node_modules/hasown/tsconfig.json +0 -6
  270. package/node_modules/isarray/LICENSE +0 -21
  271. package/node_modules/isarray/README.md +0 -38
  272. package/node_modules/isarray/index.js +0 -5
  273. package/node_modules/isarray/package.json +0 -48
  274. package/node_modules/json-stable-stringify/.eslintrc +0 -31
  275. package/node_modules/json-stable-stringify/.github/FUNDING.yml +0 -12
  276. package/node_modules/json-stable-stringify/CHANGELOG.md +0 -160
  277. package/node_modules/json-stable-stringify/LICENSE +0 -21
  278. package/node_modules/json-stable-stringify/README.md +0 -157
  279. package/node_modules/json-stable-stringify/example/key_cmp.js +0 -9
  280. package/node_modules/json-stable-stringify/example/nested.js +0 -7
  281. package/node_modules/json-stable-stringify/example/str.js +0 -7
  282. package/node_modules/json-stable-stringify/example/value_cmp.js +0 -12
  283. package/node_modules/json-stable-stringify/index.d.ts +0 -25
  284. package/node_modules/json-stable-stringify/index.js +0 -124
  285. package/node_modules/json-stable-stringify/package.json +0 -88
  286. package/node_modules/json-stable-stringify/test/cmp.js +0 -33
  287. package/node_modules/json-stable-stringify/test/nested.js +0 -48
  288. package/node_modules/json-stable-stringify/test/replacer.js +0 -81
  289. package/node_modules/json-stable-stringify/test/space.js +0 -127
  290. package/node_modules/json-stable-stringify/test/str.js +0 -46
  291. package/node_modules/json-stable-stringify/test/to-json.js +0 -22
  292. package/node_modules/json-stable-stringify/tsconfig.json +0 -10
  293. package/node_modules/jsonify/.eslintrc +0 -21
  294. package/node_modules/jsonify/.github/FUNDING.yml +0 -12
  295. package/node_modules/jsonify/CHANGELOG.md +0 -48
  296. package/node_modules/jsonify/README.md +0 -66
  297. package/node_modules/jsonify/index.js +0 -4
  298. package/node_modules/jsonify/lib/parse.js +0 -261
  299. package/node_modules/jsonify/lib/stringify.js +0 -151
  300. package/node_modules/jsonify/package.json +0 -62
  301. package/node_modules/jsonify/test/parse.js +0 -20
  302. package/node_modules/jsonify/test/stringify.js +0 -18
  303. package/node_modules/math-intrinsics/.eslintrc +0 -16
  304. package/node_modules/math-intrinsics/.github/FUNDING.yml +0 -12
  305. package/node_modules/math-intrinsics/CHANGELOG.md +0 -24
  306. package/node_modules/math-intrinsics/LICENSE +0 -21
  307. package/node_modules/math-intrinsics/README.md +0 -50
  308. package/node_modules/math-intrinsics/abs.d.ts +0 -1
  309. package/node_modules/math-intrinsics/abs.js +0 -4
  310. package/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +0 -3
  311. package/node_modules/math-intrinsics/constants/maxArrayLength.js +0 -4
  312. package/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +0 -3
  313. package/node_modules/math-intrinsics/constants/maxSafeInteger.js +0 -5
  314. package/node_modules/math-intrinsics/constants/maxValue.d.ts +0 -3
  315. package/node_modules/math-intrinsics/constants/maxValue.js +0 -5
  316. package/node_modules/math-intrinsics/floor.d.ts +0 -1
  317. package/node_modules/math-intrinsics/floor.js +0 -4
  318. package/node_modules/math-intrinsics/isFinite.d.ts +0 -3
  319. package/node_modules/math-intrinsics/isFinite.js +0 -12
  320. package/node_modules/math-intrinsics/isInteger.d.ts +0 -3
  321. package/node_modules/math-intrinsics/isInteger.js +0 -16
  322. package/node_modules/math-intrinsics/isNaN.d.ts +0 -1
  323. package/node_modules/math-intrinsics/isNaN.js +0 -6
  324. package/node_modules/math-intrinsics/isNegativeZero.d.ts +0 -3
  325. package/node_modules/math-intrinsics/isNegativeZero.js +0 -6
  326. package/node_modules/math-intrinsics/max.d.ts +0 -1
  327. package/node_modules/math-intrinsics/max.js +0 -4
  328. package/node_modules/math-intrinsics/min.d.ts +0 -1
  329. package/node_modules/math-intrinsics/min.js +0 -4
  330. package/node_modules/math-intrinsics/mod.d.ts +0 -3
  331. package/node_modules/math-intrinsics/mod.js +0 -9
  332. package/node_modules/math-intrinsics/package.json +0 -86
  333. package/node_modules/math-intrinsics/pow.d.ts +0 -1
  334. package/node_modules/math-intrinsics/pow.js +0 -4
  335. package/node_modules/math-intrinsics/round.d.ts +0 -1
  336. package/node_modules/math-intrinsics/round.js +0 -4
  337. package/node_modules/math-intrinsics/sign.d.ts +0 -3
  338. package/node_modules/math-intrinsics/sign.js +0 -11
  339. package/node_modules/math-intrinsics/test/index.js +0 -192
  340. package/node_modules/math-intrinsics/tsconfig.json +0 -3
  341. package/node_modules/object-keys/.editorconfig +0 -13
  342. package/node_modules/object-keys/.eslintrc +0 -17
  343. package/node_modules/object-keys/.travis.yml +0 -277
  344. package/node_modules/object-keys/CHANGELOG.md +0 -232
  345. package/node_modules/object-keys/LICENSE +0 -21
  346. package/node_modules/object-keys/README.md +0 -76
  347. package/node_modules/object-keys/implementation.js +0 -122
  348. package/node_modules/object-keys/index.js +0 -32
  349. package/node_modules/object-keys/isArguments.js +0 -17
  350. package/node_modules/object-keys/package.json +0 -88
  351. package/node_modules/object-keys/test/index.js +0 -5
  352. package/node_modules/set-function-length/.eslintrc +0 -27
  353. package/node_modules/set-function-length/.github/FUNDING.yml +0 -12
  354. package/node_modules/set-function-length/.nycrc +0 -13
  355. package/node_modules/set-function-length/CHANGELOG.md +0 -70
  356. package/node_modules/set-function-length/LICENSE +0 -21
  357. package/node_modules/set-function-length/README.md +0 -56
  358. package/node_modules/set-function-length/env.d.ts +0 -9
  359. package/node_modules/set-function-length/env.js +0 -25
  360. package/node_modules/set-function-length/index.d.ts +0 -7
  361. package/node_modules/set-function-length/index.js +0 -42
  362. package/node_modules/set-function-length/package.json +0 -102
  363. package/node_modules/set-function-length/tsconfig.json +0 -9
@@ -1,53 +0,0 @@
1
- # call-bound <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
2
-
3
- [![github actions][actions-image]][actions-url]
4
- [![coverage][codecov-image]][codecov-url]
5
- [![dependency status][deps-svg]][deps-url]
6
- [![dev dependency status][dev-deps-svg]][dev-deps-url]
7
- [![License][license-image]][license-url]
8
- [![Downloads][downloads-image]][downloads-url]
9
-
10
- [![npm badge][npm-badge-png]][package-url]
11
-
12
- Robust call-bound JavaScript intrinsics, using `call-bind` and `get-intrinsic`.
13
-
14
- ## Getting started
15
-
16
- ```sh
17
- npm install --save call-bound
18
- ```
19
-
20
- ## Usage/Examples
21
-
22
- ```js
23
- const assert = require('assert');
24
- const callBound = require('call-bound');
25
-
26
- const slice = callBound('Array.prototype.slice');
27
-
28
- delete Function.prototype.call;
29
- delete Function.prototype.bind;
30
- delete Array.prototype.slice;
31
-
32
- assert.deepEqual(slice([1, 2, 3, 4], 1, -1), [2, 3]);
33
- ```
34
-
35
- ## Tests
36
-
37
- Clone the repo, `npm install`, and run `npm test`
38
-
39
- [package-url]: https://npmjs.org/package/call-bound
40
- [npm-version-svg]: https://versionbadg.es/ljharb/call-bound.svg
41
- [deps-svg]: https://david-dm.org/ljharb/call-bound.svg
42
- [deps-url]: https://david-dm.org/ljharb/call-bound
43
- [dev-deps-svg]: https://david-dm.org/ljharb/call-bound/dev-status.svg
44
- [dev-deps-url]: https://david-dm.org/ljharb/call-bound#info=devDependencies
45
- [npm-badge-png]: https://nodei.co/npm/call-bound.png?downloads=true&stars=true
46
- [license-image]: https://img.shields.io/npm/l/call-bound.svg
47
- [license-url]: LICENSE
48
- [downloads-image]: https://img.shields.io/npm/dm/call-bound.svg
49
- [downloads-url]: https://npm-stat.com/charts.html?package=call-bound
50
- [codecov-image]: https://codecov.io/gh/ljharb/call-bound/branch/main/graphs/badge.svg
51
- [codecov-url]: https://app.codecov.io/gh/ljharb/call-bound/
52
- [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/call-bound
53
- [actions-url]: https://github.com/ljharb/call-bound/actions
@@ -1,94 +0,0 @@
1
- type Intrinsic = typeof globalThis;
2
-
3
- type IntrinsicName = keyof Intrinsic | `%${keyof Intrinsic}%`;
4
-
5
- type IntrinsicPath = IntrinsicName | `${StripPercents<IntrinsicName>}.${string}` | `%${StripPercents<IntrinsicName>}.${string}%`;
6
-
7
- type AllowMissing = boolean;
8
-
9
- type StripPercents<T extends string> = T extends `%${infer U}%` ? U : T;
10
-
11
- type BindMethodPrecise<F> =
12
- F extends (this: infer This, ...args: infer Args) => infer R
13
- ? (obj: This, ...args: Args) => R
14
- : F extends {
15
- (this: infer This1, ...args: infer Args1): infer R1;
16
- (this: infer This2, ...args: infer Args2): infer R2
17
- }
18
- ? {
19
- (obj: This1, ...args: Args1): R1;
20
- (obj: This2, ...args: Args2): R2
21
- }
22
- : never
23
-
24
- // Extract method type from a prototype
25
- type GetPrototypeMethod<T extends keyof typeof globalThis, M extends string> =
26
- (typeof globalThis)[T] extends { prototype: any }
27
- ? M extends keyof (typeof globalThis)[T]['prototype']
28
- ? (typeof globalThis)[T]['prototype'][M]
29
- : never
30
- : never
31
-
32
- // Get static property/method
33
- type GetStaticMember<T extends keyof typeof globalThis, P extends string> =
34
- P extends keyof (typeof globalThis)[T] ? (typeof globalThis)[T][P] : never
35
-
36
- // Type that maps string path to actual bound function or value with better precision
37
- type BoundIntrinsic<S extends string> =
38
- S extends `${infer Obj}.prototype.${infer Method}`
39
- ? Obj extends keyof typeof globalThis
40
- ? BindMethodPrecise<GetPrototypeMethod<Obj, Method & string>>
41
- : unknown
42
- : S extends `${infer Obj}.${infer Prop}`
43
- ? Obj extends keyof typeof globalThis
44
- ? GetStaticMember<Obj, Prop & string>
45
- : unknown
46
- : unknown
47
-
48
- declare function arraySlice<T>(array: readonly T[], start?: number, end?: number): T[];
49
- declare function arraySlice<T>(array: ArrayLike<T>, start?: number, end?: number): T[];
50
- declare function arraySlice<T>(array: IArguments, start?: number, end?: number): T[];
51
-
52
- // Special cases for methods that need explicit typing
53
- interface SpecialCases {
54
- '%Object.prototype.isPrototypeOf%': (thisArg: {}, obj: unknown) => boolean;
55
- '%String.prototype.replace%': {
56
- (str: string, searchValue: string | RegExp, replaceValue: string): string;
57
- (str: string, searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string
58
- };
59
- '%Object.prototype.toString%': (obj: {}) => string;
60
- '%Object.prototype.hasOwnProperty%': (obj: {}, v: PropertyKey) => boolean;
61
- '%Array.prototype.slice%': typeof arraySlice;
62
- '%Array.prototype.map%': <T, U>(array: readonly T[], callbackfn: (value: T, index: number, array: readonly T[]) => U, thisArg?: any) => U[];
63
- '%Array.prototype.filter%': <T>(array: readonly T[], predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any) => T[];
64
- '%Array.prototype.indexOf%': <T>(array: readonly T[], searchElement: T, fromIndex?: number) => number;
65
- '%Function.prototype.apply%': <T, A extends any[], R>(fn: (...args: A) => R, thisArg: any, args: A) => R;
66
- '%Function.prototype.call%': <T, A extends any[], R>(fn: (...args: A) => R, thisArg: any, ...args: A) => R;
67
- '%Function.prototype.bind%': <T, A extends any[], R>(fn: (...args: A) => R, thisArg: any, ...args: A) => (...remainingArgs: A) => R;
68
- '%Promise.prototype.then%': {
69
- <T, R>(promise: Promise<T>, onfulfilled: (value: T) => R | PromiseLike<R>): Promise<R>;
70
- <T, R>(promise: Promise<T>, onfulfilled: ((value: T) => R | PromiseLike<R>) | undefined | null, onrejected: (reason: any) => R | PromiseLike<R>): Promise<R>;
71
- };
72
- '%RegExp.prototype.test%': (regexp: RegExp, str: string) => boolean;
73
- '%RegExp.prototype.exec%': (regexp: RegExp, str: string) => RegExpExecArray | null;
74
- '%Error.prototype.toString%': (error: Error) => string;
75
- '%TypeError.prototype.toString%': (error: TypeError) => string;
76
- '%String.prototype.split%': (
77
- obj: unknown,
78
- splitter: string | RegExp | {
79
- [Symbol.split](string: string, limit?: number): string[];
80
- },
81
- limit?: number | undefined
82
- ) => string[];
83
- }
84
-
85
- /**
86
- * Returns a bound function for a prototype method, or a value for a static property.
87
- *
88
- * @param name - The name of the intrinsic (e.g. 'Array.prototype.slice')
89
- * @param {AllowMissing} [allowMissing] - Whether to allow missing intrinsics (default: false)
90
- */
91
- declare function callBound<K extends keyof SpecialCases | StripPercents<keyof SpecialCases>, S extends IntrinsicPath>(name: K, allowMissing?: AllowMissing): SpecialCases[`%${StripPercents<K>}%`];
92
- declare function callBound<K extends keyof SpecialCases | StripPercents<keyof SpecialCases>, S extends IntrinsicPath>(name: S, allowMissing?: AllowMissing): BoundIntrinsic<S>;
93
-
94
- export = callBound;
@@ -1,19 +0,0 @@
1
- 'use strict';
2
-
3
- var GetIntrinsic = require('get-intrinsic');
4
-
5
- var callBindBasic = require('call-bind-apply-helpers');
6
-
7
- /** @type {(thisArg: string, searchString: string, position?: number) => number} */
8
- var $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]);
9
-
10
- /** @type {import('.')} */
11
- module.exports = function callBoundIntrinsic(name, allowMissing) {
12
- /* eslint no-extra-parens: 0 */
13
-
14
- var intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic(name, !!allowMissing));
15
- if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
16
- return callBindBasic(/** @type {const} */ ([intrinsic]));
17
- }
18
- return intrinsic;
19
- };
@@ -1,99 +0,0 @@
1
- {
2
- "name": "call-bound",
3
- "version": "1.0.4",
4
- "description": "Robust call-bound JavaScript intrinsics, using `call-bind` and `get-intrinsic`.",
5
- "main": "index.js",
6
- "exports": {
7
- ".": "./index.js",
8
- "./package.json": "./package.json"
9
- },
10
- "sideEffects": false,
11
- "scripts": {
12
- "prepack": "npmignore --auto --commentLines=auto",
13
- "prepublish": "not-in-publish || npm run prepublishOnly",
14
- "prepublishOnly": "safe-publish-latest",
15
- "prelint": "evalmd README.md",
16
- "lint": "eslint --ext=.js,.mjs .",
17
- "postlint": "tsc -p . && attw -P",
18
- "pretest": "npm run lint",
19
- "tests-only": "nyc tape 'test/**/*.js'",
20
- "test": "npm run tests-only",
21
- "posttest": "npx npm@'>=10.2' audit --production",
22
- "version": "auto-changelog && git add CHANGELOG.md",
23
- "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
24
- },
25
- "repository": {
26
- "type": "git",
27
- "url": "git+https://github.com/ljharb/call-bound.git"
28
- },
29
- "keywords": [
30
- "javascript",
31
- "ecmascript",
32
- "es",
33
- "js",
34
- "callbind",
35
- "callbound",
36
- "call",
37
- "bind",
38
- "bound",
39
- "call-bind",
40
- "call-bound",
41
- "function",
42
- "es-abstract"
43
- ],
44
- "author": "Jordan Harband <ljharb@gmail.com>",
45
- "funding": {
46
- "url": "https://github.com/sponsors/ljharb"
47
- },
48
- "license": "MIT",
49
- "bugs": {
50
- "url": "https://github.com/ljharb/call-bound/issues"
51
- },
52
- "homepage": "https://github.com/ljharb/call-bound#readme",
53
- "dependencies": {
54
- "call-bind-apply-helpers": "^1.0.2",
55
- "get-intrinsic": "^1.3.0"
56
- },
57
- "devDependencies": {
58
- "@arethetypeswrong/cli": "^0.17.4",
59
- "@ljharb/eslint-config": "^21.1.1",
60
- "@ljharb/tsconfig": "^0.3.0",
61
- "@types/call-bind": "^1.0.5",
62
- "@types/get-intrinsic": "^1.2.3",
63
- "@types/tape": "^5.8.1",
64
- "auto-changelog": "^2.5.0",
65
- "encoding": "^0.1.13",
66
- "es-value-fixtures": "^1.7.1",
67
- "eslint": "=8.8.0",
68
- "evalmd": "^0.0.19",
69
- "for-each": "^0.3.5",
70
- "gopd": "^1.2.0",
71
- "has-strict-mode": "^1.1.0",
72
- "in-publish": "^2.0.1",
73
- "npmignore": "^0.3.1",
74
- "nyc": "^10.3.2",
75
- "object-inspect": "^1.13.4",
76
- "safe-publish-latest": "^2.0.0",
77
- "tape": "^5.9.0",
78
- "typescript": "next"
79
- },
80
- "testling": {
81
- "files": "test/index.js"
82
- },
83
- "auto-changelog": {
84
- "output": "CHANGELOG.md",
85
- "template": "keepachangelog",
86
- "unreleased": false,
87
- "commitLimit": false,
88
- "backfillLimit": false,
89
- "hideCredit": true
90
- },
91
- "publishConfig": {
92
- "ignore": [
93
- ".github/workflows"
94
- ]
95
- },
96
- "engines": {
97
- "node": ">= 0.4"
98
- }
99
- }
@@ -1,61 +0,0 @@
1
- 'use strict';
2
-
3
- var test = require('tape');
4
-
5
- var callBound = require('../');
6
-
7
- /** @template {true} T @template U @typedef {T extends U ? T : never} AssertType */
8
-
9
- test('callBound', function (t) {
10
- // static primitive
11
- t.equal(callBound('Array.length'), Array.length, 'Array.length yields itself');
12
- t.equal(callBound('%Array.length%'), Array.length, '%Array.length% yields itself');
13
-
14
- // static non-function object
15
- t.equal(callBound('Array.prototype'), Array.prototype, 'Array.prototype yields itself');
16
- t.equal(callBound('%Array.prototype%'), Array.prototype, '%Array.prototype% yields itself');
17
- t.equal(callBound('Array.constructor'), Array.constructor, 'Array.constructor yields itself');
18
- t.equal(callBound('%Array.constructor%'), Array.constructor, '%Array.constructor% yields itself');
19
-
20
- // static function
21
- t.equal(callBound('Date.parse'), Date.parse, 'Date.parse yields itself');
22
- t.equal(callBound('%Date.parse%'), Date.parse, '%Date.parse% yields itself');
23
-
24
- // prototype primitive
25
- t.equal(callBound('Error.prototype.message'), Error.prototype.message, 'Error.prototype.message yields itself');
26
- t.equal(callBound('%Error.prototype.message%'), Error.prototype.message, '%Error.prototype.message% yields itself');
27
-
28
- var x = callBound('Object.prototype.toString');
29
- var y = callBound('%Object.prototype.toString%');
30
-
31
- // prototype function
32
- t.notEqual(x, Object.prototype.toString, 'Object.prototype.toString does not yield itself');
33
- t.notEqual(y, Object.prototype.toString, '%Object.prototype.toString% does not yield itself');
34
- t.equal(x(true), Object.prototype.toString.call(true), 'call-bound Object.prototype.toString calls into the original');
35
- t.equal(y(true), Object.prototype.toString.call(true), 'call-bound %Object.prototype.toString% calls into the original');
36
-
37
- t['throws'](
38
- // @ts-expect-error
39
- function () { callBound('does not exist'); },
40
- SyntaxError,
41
- 'nonexistent intrinsic throws'
42
- );
43
- t['throws'](
44
- // @ts-expect-error
45
- function () { callBound('does not exist', true); },
46
- SyntaxError,
47
- 'allowMissing arg still throws for unknown intrinsic'
48
- );
49
-
50
- t.test('real but absent intrinsic', { skip: typeof WeakRef !== 'undefined' }, function (st) {
51
- st['throws'](
52
- function () { callBound('WeakRef'); },
53
- TypeError,
54
- 'real but absent intrinsic throws'
55
- );
56
- st.equal(callBound('WeakRef', true), undefined, 'allowMissing arg avoids exception');
57
- st.end();
58
- });
59
-
60
- t.end();
61
- });
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "@ljharb/tsconfig",
3
- "compilerOptions": {
4
- "target": "ESNext",
5
- "lib": ["es2024"],
6
- },
7
- "exclude": [
8
- "coverage",
9
- ],
10
- }
@@ -1,24 +0,0 @@
1
- {
2
- "root": true,
3
-
4
- "extends": "@ljharb",
5
-
6
- "rules": {
7
- "complexity": 0,
8
- "id-length": 0,
9
- "new-cap": ["error", {
10
- "capIsNewExceptions": [
11
- "GetIntrinsic",
12
- ],
13
- }],
14
- },
15
-
16
- "overrides": [
17
- {
18
- "files": "test/**",
19
- "rules": {
20
- "max-lines-per-function": "off",
21
- },
22
- },
23
- ],
24
- }
@@ -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/define-data-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 up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -1,13 +0,0 @@
1
- {
2
- "all": true,
3
- "check-coverage": false,
4
- "reporter": ["text-summary", "text", "html", "json"],
5
- "lines": 86,
6
- "statements": 85.93,
7
- "functions": 82.43,
8
- "branches": 76.06,
9
- "exclude": [
10
- "coverage",
11
- "test"
12
- ]
13
- }
@@ -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.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
-
37
- ## [v1.1.1](https://github.com/ljharb/define-data-property/compare/v1.1.0...v1.1.1) - 2023-10-12
38
-
39
- ### Commits
40
-
41
- - [Tests] fix tests in ES3 engines [`5c6920e`](https://github.com/ljharb/define-data-property/commit/5c6920edd1f52f675b02f417e539c28135b43f94)
42
- - [Dev Deps] update `@types/es-value-fixtures`, `@types/for-each`, `@types/gopd`, `@types/has-property-descriptors`, `tape`, `typescript` [`7d82dfc`](https://github.com/ljharb/define-data-property/commit/7d82dfc20f778b4465bba06335dd53f6f431aea3)
43
- - [Fix] IE 8 has a broken `Object.defineProperty` [`0672e1a`](https://github.com/ljharb/define-data-property/commit/0672e1af2a9fcc787e7c23b96dea60d290df5548)
44
- - [meta] emit types on prepack [`73acb1f`](https://github.com/ljharb/define-data-property/commit/73acb1f903c21b314ec7156bf10f73c7910530c0)
45
- - [Dev Deps] update `tape`, `typescript` [`9489a77`](https://github.com/ljharb/define-data-property/commit/9489a7738bf2ecf0ac71d5b78ec4ca6ad7ba0142)
46
-
47
- ## [v1.1.0](https://github.com/ljharb/define-data-property/compare/v1.0.1...v1.1.0) - 2023-09-13
48
-
49
- ### Commits
50
-
51
- - [New] add `loose` arg [`155235a`](https://github.com/ljharb/define-data-property/commit/155235a4c4d7741f6de01cd87c99599a56654b72)
52
- - [New] allow `null` to be passed for the non* args [`7d2fa5f`](https://github.com/ljharb/define-data-property/commit/7d2fa5f06be0392736c13b126f7cd38979f34792)
53
-
54
- ## [v1.0.1](https://github.com/ljharb/define-data-property/compare/v1.0.0...v1.0.1) - 2023-09-12
55
-
56
- ### Commits
57
-
58
- - [meta] add TS types [`43d763c`](https://github.com/ljharb/define-data-property/commit/43d763c6c883f652de1c9c02ef6216ee507ffa69)
59
- - [Dev Deps] update `@types/tape`, `typescript` [`f444985`](https://github.com/ljharb/define-data-property/commit/f444985811c36f3e6448a03ad2f9b7898917f4c7)
60
- - [meta] add `safe-publish-latest`, [`172bb10`](https://github.com/ljharb/define-data-property/commit/172bb10890896ebb160e64398f6ee55760107bee)
61
-
62
- ## v1.0.0 - 2023-09-12
63
-
64
- ### Commits
65
-
66
- - Initial implementation, tests, readme [`5b43d6b`](https://github.com/ljharb/define-data-property/commit/5b43d6b44e675a904810467a7d4e0adb7efc3196)
67
- - Initial commit [`35e577a`](https://github.com/ljharb/define-data-property/commit/35e577a6ba59a98befa97776d70d90f3bea9009d)
68
- - npm init [`82a0a04`](https://github.com/ljharb/define-data-property/commit/82a0a04a321ca7de220af02d41e2745e8a9962ed)
69
- - Only apps should have lockfiles [`96df244`](https://github.com/ljharb/define-data-property/commit/96df244a3c6f426f9a2437be825d1c6f5dd7158e)
70
- - [meta] use `npmignore` to autogenerate an npmignore file [`a87ff18`](https://github.com/ljharb/define-data-property/commit/a87ff18cb79e14c2eb5720486c4759fd9a189375)
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2023 Jordan Harband
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,67 +0,0 @@
1
- # define-data-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
- Define a data property on an object. Will fall back to assignment in an engine without descriptors.
11
-
12
- The three `non*` argument can also be passed `null`, which will use the existing state if available.
13
-
14
- The `loose` argument will mean that if you attempt to set a non-normal data property, in an environment without descriptor support, it will fall back to normal assignment.
15
-
16
- ## Usage
17
-
18
- ```javascript
19
- var defineDataProperty = require('define-data-property');
20
- var assert = require('assert');
21
-
22
- var obj = {};
23
- defineDataProperty(obj, 'key', 'value');
24
- defineDataProperty(
25
- obj,
26
- 'key2',
27
- 'value',
28
- true, // nonEnumerable, optional
29
- false, // nonWritable, optional
30
- true, // nonConfigurable, optional
31
- false // loose, optional
32
- );
33
-
34
- assert.deepEqual(
35
- Object.getOwnPropertyDescriptors(obj),
36
- {
37
- key: {
38
- configurable: true,
39
- enumerable: true,
40
- value: 'value',
41
- writable: true,
42
- },
43
- key2: {
44
- configurable: false,
45
- enumerable: false,
46
- value: 'value',
47
- writable: true,
48
- },
49
- }
50
- );
51
- ```
52
-
53
- [package-url]: https://npmjs.org/package/define-data-property
54
- [npm-version-svg]: https://versionbadg.es/ljharb/define-data-property.svg
55
- [deps-svg]: https://david-dm.org/ljharb/define-data-property.svg
56
- [deps-url]: https://david-dm.org/ljharb/define-data-property
57
- [dev-deps-svg]: https://david-dm.org/ljharb/define-data-property/dev-status.svg
58
- [dev-deps-url]: https://david-dm.org/ljharb/define-data-property#info=devDependencies
59
- [npm-badge-png]: https://nodei.co/npm/define-data-property.png?downloads=true&stars=true
60
- [license-image]: https://img.shields.io/npm/l/define-data-property.svg
61
- [license-url]: LICENSE
62
- [downloads-image]: https://img.shields.io/npm/dm/define-data-property.svg
63
- [downloads-url]: https://npm-stat.com/charts.html?package=define-data-property
64
- [codecov-image]: https://codecov.io/gh/ljharb/define-data-property/branch/main/graphs/badge.svg
65
- [codecov-url]: https://app.codecov.io/gh/ljharb/define-data-property/
66
- [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/define-data-property
67
- [actions-url]: https://github.com/ljharb/define-data-property/actions
@@ -1,12 +0,0 @@
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,56 +0,0 @@
1
- 'use strict';
2
-
3
- var $defineProperty = require('es-define-property');
4
-
5
- var $SyntaxError = require('es-errors/syntax');
6
- var $TypeError = require('es-errors/type');
7
-
8
- var gopd = require('gopd');
9
-
10
- /** @type {import('.')} */
11
- module.exports = function defineDataProperty(
12
- obj,
13
- property,
14
- value
15
- ) {
16
- if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
17
- throw new $TypeError('`obj` must be an object or a function`');
18
- }
19
- if (typeof property !== 'string' && typeof property !== 'symbol') {
20
- throw new $TypeError('`property` must be a string or a symbol`');
21
- }
22
- if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {
23
- throw new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');
24
- }
25
- if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {
26
- throw new $TypeError('`nonWritable`, if provided, must be a boolean or null');
27
- }
28
- if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {
29
- throw new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');
30
- }
31
- if (arguments.length > 6 && typeof arguments[6] !== 'boolean') {
32
- throw new $TypeError('`loose`, if provided, must be a boolean');
33
- }
34
-
35
- var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
36
- var nonWritable = arguments.length > 4 ? arguments[4] : null;
37
- var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
38
- var loose = arguments.length > 6 ? arguments[6] : false;
39
-
40
- /* @type {false | TypedPropertyDescriptor<unknown>} */
41
- var desc = !!gopd && gopd(obj, property);
42
-
43
- if ($defineProperty) {
44
- $defineProperty(obj, property, {
45
- configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
46
- enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
47
- value: value,
48
- writable: nonWritable === null && desc ? desc.writable : !nonWritable
49
- });
50
- } else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {
51
- // must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable
52
- obj[property] = value; // eslint-disable-line no-param-reassign
53
- } else {
54
- throw new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');
55
- }
56
- };