aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/gopd
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/gopd')
-rw-r--r--node_modules/gopd/.eslintrc16
-rw-r--r--node_modules/gopd/.github/FUNDING.yml12
-rw-r--r--node_modules/gopd/CHANGELOG.md45
-rw-r--r--node_modules/gopd/LICENSE21
-rw-r--r--node_modules/gopd/README.md40
-rw-r--r--node_modules/gopd/gOPD.d.ts1
-rw-r--r--node_modules/gopd/gOPD.js4
-rw-r--r--node_modules/gopd/index.d.ts5
-rw-r--r--node_modules/gopd/index.js15
-rw-r--r--node_modules/gopd/package.json77
-rw-r--r--node_modules/gopd/test/index.js36
-rw-r--r--node_modules/gopd/tsconfig.json9
12 files changed, 281 insertions, 0 deletions
diff --git a/node_modules/gopd/.eslintrc b/node_modules/gopd/.eslintrc
new file mode 100644
index 0000000..e2550c0
--- /dev/null
+++ b/node_modules/gopd/.eslintrc
@@ -0,0 +1,16 @@
+{
+ "root": true,
+
+ "extends": "@ljharb",
+
+ "rules": {
+ "func-style": [2, "declaration"],
+ "id-length": 0,
+ "multiline-comment-style": 0,
+ "new-cap": [2, {
+ "capIsNewExceptions": [
+ "GetIntrinsic",
+ ],
+ }],
+ },
+}
diff --git a/node_modules/gopd/.github/FUNDING.yml b/node_modules/gopd/.github/FUNDING.yml
new file mode 100644
index 0000000..94a44a8
--- /dev/null
+++ b/node_modules/gopd/.github/FUNDING.yml
@@ -0,0 +1,12 @@
+# These are supported funding model platforms
+
+github: [ljharb]
+patreon: # Replace with a single Patreon username
+open_collective: # Replace with a single Open Collective username
+ko_fi: # Replace with a single Ko-fi username
+tidelift: npm/gopd
+community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
+liberapay: # Replace with a single Liberapay username
+issuehunt: # Replace with a single IssueHunt username
+otechie: # Replace with a single Otechie username
+custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
diff --git a/node_modules/gopd/CHANGELOG.md b/node_modules/gopd/CHANGELOG.md
new file mode 100644
index 0000000..87f5727
--- /dev/null
+++ b/node_modules/gopd/CHANGELOG.md
@@ -0,0 +1,45 @@
+# Changelog
+
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [v1.2.0](https://github.com/ljharb/gopd/compare/v1.1.0...v1.2.0) - 2024-12-03
+
+### Commits
+
+- [New] add `gOPD` entry point; remove `get-intrinsic` [`5b61232`](https://github.com/ljharb/gopd/commit/5b61232dedea4591a314bcf16101b1961cee024e)
+
+## [v1.1.0](https://github.com/ljharb/gopd/compare/v1.0.1...v1.1.0) - 2024-11-29
+
+### Commits
+
+- [New] add types [`f585e39`](https://github.com/ljharb/gopd/commit/f585e397886d270e4ba84e53d226e4f9ca2eb0e6)
+- [Dev Deps] update `@ljharb/eslint-config`, `auto-changelog`, `tape` [`0b8e4fd`](https://github.com/ljharb/gopd/commit/0b8e4fded64397a7726a9daa144a6cc9a5e2edfa)
+- [Dev Deps] update `aud`, `npmignore`, `tape` [`48378b2`](https://github.com/ljharb/gopd/commit/48378b2443f09a4f7efbd0fb6c3ee845a6cabcf3)
+- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`78099ee`](https://github.com/ljharb/gopd/commit/78099eeed41bfdc134c912280483689cc8861c31)
+- [Tests] replace `aud` with `npm audit` [`4e0d0ac`](https://github.com/ljharb/gopd/commit/4e0d0ac47619d24a75318a8e1f543ee04b2a2632)
+- [meta] add missing `engines.node` [`1443316`](https://github.com/ljharb/gopd/commit/14433165d07835c680155b3dfd62d9217d735eca)
+- [Deps] update `get-intrinsic` [`eee5f51`](https://github.com/ljharb/gopd/commit/eee5f51769f3dbaf578b70e2a3199116b01aa670)
+- [Deps] update `get-intrinsic` [`550c378`](https://github.com/ljharb/gopd/commit/550c3780e3a9c77b62565712a001b4ed64ea61f5)
+- [Dev Deps] add missing peer dep [`8c2ecf8`](https://github.com/ljharb/gopd/commit/8c2ecf848122e4e30abfc5b5086fb48b390dce75)
+
+## [v1.0.1](https://github.com/ljharb/gopd/compare/v1.0.0...v1.0.1) - 2022-11-01
+
+### Commits
+
+- [Fix] actually export gOPD instead of dP [`4b624bf`](https://github.com/ljharb/gopd/commit/4b624bfbeff788c5e3ff16d9443a83627847234f)
+
+## v1.0.0 - 2022-11-01
+
+### Commits
+
+- Initial implementation, tests, readme [`0911e01`](https://github.com/ljharb/gopd/commit/0911e012cd642092bd88b732c161c58bf4f20bea)
+- Initial commit [`b84e33f`](https://github.com/ljharb/gopd/commit/b84e33f5808a805ac57ff88d4247ad935569acbe)
+- [actions] add reusable workflows [`12ae28a`](https://github.com/ljharb/gopd/commit/12ae28ae5f50f86e750215b6e2188901646d0119)
+- npm init [`280118b`](https://github.com/ljharb/gopd/commit/280118badb45c80b4483836b5cb5315bddf6e582)
+- [meta] add `auto-changelog` [`bb78de5`](https://github.com/ljharb/gopd/commit/bb78de5639a180747fb290c28912beaaf1615709)
+- [meta] create FUNDING.yml; add `funding` in package.json [`11c22e6`](https://github.com/ljharb/gopd/commit/11c22e6355bb01f24e7fac4c9bb3055eb5b25002)
+- [meta] use `npmignore` to autogenerate an npmignore file [`4f4537a`](https://github.com/ljharb/gopd/commit/4f4537a843b39f698c52f072845092e6fca345bb)
+- Only apps should have lockfiles [`c567022`](https://github.com/ljharb/gopd/commit/c567022a18573aa7951cf5399445d9840e23e98b)
diff --git a/node_modules/gopd/LICENSE b/node_modules/gopd/LICENSE
new file mode 100644
index 0000000..6abfe14
--- /dev/null
+++ b/node_modules/gopd/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2022 Jordan Harband
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/gopd/README.md b/node_modules/gopd/README.md
new file mode 100644
index 0000000..784e56a
--- /dev/null
+++ b/node_modules/gopd/README.md
@@ -0,0 +1,40 @@
+# gopd <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
+
+[![github actions][actions-image]][actions-url]
+[![coverage][codecov-image]][codecov-url]
+[![License][license-image]][license-url]
+[![Downloads][downloads-image]][downloads-url]
+
+[![npm badge][npm-badge-png]][package-url]
+
+`Object.getOwnPropertyDescriptor`, but accounts for IE's broken implementation.
+
+## Usage
+
+```javascript
+var gOPD = require('gopd');
+var assert = require('assert');
+
+if (gOPD) {
+ assert.equal(typeof gOPD, 'function', 'descriptors supported');
+ // use gOPD like Object.getOwnPropertyDescriptor here
+} else {
+ assert.ok(!gOPD, 'descriptors not supported');
+}
+```
+
+[package-url]: https://npmjs.org/package/gopd
+[npm-version-svg]: https://versionbadg.es/ljharb/gopd.svg
+[deps-svg]: https://david-dm.org/ljharb/gopd.svg
+[deps-url]: https://david-dm.org/ljharb/gopd
+[dev-deps-svg]: https://david-dm.org/ljharb/gopd/dev-status.svg
+[dev-deps-url]: https://david-dm.org/ljharb/gopd#info=devDependencies
+[npm-badge-png]: https://nodei.co/npm/gopd.png?downloads=true&stars=true
+[license-image]: https://img.shields.io/npm/l/gopd.svg
+[license-url]: LICENSE
+[downloads-image]: https://img.shields.io/npm/dm/gopd.svg
+[downloads-url]: https://npm-stat.com/charts.html?package=gopd
+[codecov-image]: https://codecov.io/gh/ljharb/gopd/branch/main/graphs/badge.svg
+[codecov-url]: https://app.codecov.io/gh/ljharb/gopd/
+[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/gopd
+[actions-url]: https://github.com/ljharb/gopd/actions
diff --git a/node_modules/gopd/gOPD.d.ts b/node_modules/gopd/gOPD.d.ts
new file mode 100644
index 0000000..def48a3
--- /dev/null
+++ b/node_modules/gopd/gOPD.d.ts
@@ -0,0 +1 @@
+export = Object.getOwnPropertyDescriptor;
diff --git a/node_modules/gopd/gOPD.js b/node_modules/gopd/gOPD.js
new file mode 100644
index 0000000..cf9616c
--- /dev/null
+++ b/node_modules/gopd/gOPD.js
@@ -0,0 +1,4 @@
+'use strict';
+
+/** @type {import('./gOPD')} */
+module.exports = Object.getOwnPropertyDescriptor;
diff --git a/node_modules/gopd/index.d.ts b/node_modules/gopd/index.d.ts
new file mode 100644
index 0000000..e228065
--- /dev/null
+++ b/node_modules/gopd/index.d.ts
@@ -0,0 +1,5 @@
+declare function gOPD<O extends object, K extends keyof O>(obj: O, prop: K): PropertyDescriptor | undefined;
+
+declare const fn: typeof gOPD | undefined | null;
+
+export = fn; \ No newline at end of file
diff --git a/node_modules/gopd/index.js b/node_modules/gopd/index.js
new file mode 100644
index 0000000..a4081b0
--- /dev/null
+++ b/node_modules/gopd/index.js
@@ -0,0 +1,15 @@
+'use strict';
+
+/** @type {import('.')} */
+var $gOPD = require('./gOPD');
+
+if ($gOPD) {
+ try {
+ $gOPD([], 'length');
+ } catch (e) {
+ // IE 8 has a broken gOPD
+ $gOPD = null;
+ }
+}
+
+module.exports = $gOPD;
diff --git a/node_modules/gopd/package.json b/node_modules/gopd/package.json
new file mode 100644
index 0000000..01c5ffa
--- /dev/null
+++ b/node_modules/gopd/package.json
@@ -0,0 +1,77 @@
+{
+ "name": "gopd",
+ "version": "1.2.0",
+ "description": "`Object.getOwnPropertyDescriptor`, but accounts for IE's broken implementation.",
+ "main": "index.js",
+ "exports": {
+ ".": "./index.js",
+ "./gOPD": "./gOPD.js",
+ "./package.json": "./package.json"
+ },
+ "sideEffects": false,
+ "scripts": {
+ "prepack": "npmignore --auto --commentLines=autogenerated",
+ "prepublishOnly": "safe-publish-latest",
+ "prepublish": "not-in-publish || npm run prepublishOnly",
+ "prelint": "tsc -p . && attw -P",
+ "lint": "eslint --ext=js,mjs .",
+ "postlint": "evalmd README.md",
+ "pretest": "npm run lint",
+ "tests-only": "tape 'test/**/*.js'",
+ "test": "npm run tests-only",
+ "posttest": "npx npm@'>=10.2' audit --production",
+ "version": "auto-changelog && git add CHANGELOG.md",
+ "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/ljharb/gopd.git"
+ },
+ "keywords": [
+ "ecmascript",
+ "javascript",
+ "getownpropertydescriptor",
+ "property",
+ "descriptor"
+ ],
+ "author": "Jordan Harband <ljharb@gmail.com>",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ },
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/ljharb/gopd/issues"
+ },
+ "homepage": "https://github.com/ljharb/gopd#readme",
+ "devDependencies": {
+ "@arethetypeswrong/cli": "^0.17.0",
+ "@ljharb/eslint-config": "^21.1.1",
+ "@ljharb/tsconfig": "^0.2.0",
+ "@types/tape": "^5.6.5",
+ "auto-changelog": "^2.5.0",
+ "encoding": "^0.1.13",
+ "eslint": "=8.8.0",
+ "evalmd": "^0.0.19",
+ "in-publish": "^2.0.1",
+ "npmignore": "^0.3.1",
+ "safe-publish-latest": "^2.0.0",
+ "tape": "^5.9.0",
+ "typescript": "next"
+ },
+ "auto-changelog": {
+ "output": "CHANGELOG.md",
+ "template": "keepachangelog",
+ "unreleased": false,
+ "commitLimit": false,
+ "backfillLimit": false,
+ "hideCredit": true
+ },
+ "publishConfig": {
+ "ignore": [
+ ".github/workflows"
+ ]
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+}
diff --git a/node_modules/gopd/test/index.js b/node_modules/gopd/test/index.js
new file mode 100644
index 0000000..6f43453
--- /dev/null
+++ b/node_modules/gopd/test/index.js
@@ -0,0 +1,36 @@
+'use strict';
+
+var test = require('tape');
+var gOPD = require('../');
+
+test('gOPD', function (t) {
+ t.test('supported', { skip: !gOPD }, function (st) {
+ st.equal(typeof gOPD, 'function', 'is a function');
+
+ var obj = { x: 1 };
+ st.ok('x' in obj, 'property exists');
+
+ // @ts-expect-error TS can't figure out narrowing from `skip`
+ var desc = gOPD(obj, 'x');
+ st.deepEqual(
+ desc,
+ {
+ configurable: true,
+ enumerable: true,
+ value: 1,
+ writable: true
+ },
+ 'descriptor is as expected'
+ );
+
+ st.end();
+ });
+
+ t.test('not supported', { skip: !!gOPD }, function (st) {
+ st.notOk(gOPD, 'is falsy');
+
+ st.end();
+ });
+
+ t.end();
+});
diff --git a/node_modules/gopd/tsconfig.json b/node_modules/gopd/tsconfig.json
new file mode 100644
index 0000000..d9a6668
--- /dev/null
+++ b/node_modules/gopd/tsconfig.json
@@ -0,0 +1,9 @@
+{
+ "extends": "@ljharb/tsconfig",
+ "compilerOptions": {
+ "target": "es2021",
+ },
+ "exclude": [
+ "coverage",
+ ],
+}