plugin-document-understanding 1.1.13 → 1.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -29
- package/client-v2.d.ts +2 -2
- package/client-v2.js +1 -1
- package/dist/client-v2/index.js +1 -1
- package/dist/externalVersion.js +8 -7
- package/dist/locale/en-US.json +3 -1
- package/dist/locale/zh-CN.json +3 -1
- package/dist/node_modules/form-data/lib/form_data.js +2 -2
- package/dist/node_modules/form-data/node_modules/es-define-property/.eslintrc +13 -0
- package/dist/node_modules/form-data/node_modules/es-define-property/.github/FUNDING.yml +12 -0
- package/dist/node_modules/form-data/node_modules/es-define-property/.nycrc +9 -0
- package/dist/node_modules/form-data/node_modules/es-define-property/index.d.ts +3 -0
- package/dist/node_modules/form-data/node_modules/es-define-property/index.js +14 -0
- package/dist/node_modules/form-data/node_modules/es-define-property/package.json +81 -0
- package/dist/node_modules/form-data/node_modules/es-define-property/test/index.js +56 -0
- package/dist/node_modules/form-data/node_modules/es-object-atoms/.eslintrc +16 -0
- package/dist/node_modules/form-data/node_modules/es-object-atoms/.github/FUNDING.yml +12 -0
- package/dist/node_modules/form-data/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +3 -0
- package/dist/node_modules/form-data/node_modules/es-object-atoms/RequireObjectCoercible.js +11 -0
- package/dist/node_modules/form-data/node_modules/es-object-atoms/ToObject.d.ts +7 -0
- package/dist/node_modules/form-data/node_modules/es-object-atoms/ToObject.js +10 -0
- package/dist/node_modules/form-data/node_modules/es-object-atoms/index.d.ts +3 -0
- package/dist/node_modules/form-data/node_modules/es-object-atoms/index.js +4 -0
- package/dist/node_modules/form-data/node_modules/es-object-atoms/isObject.d.ts +3 -0
- package/dist/node_modules/form-data/node_modules/es-object-atoms/isObject.js +6 -0
- package/dist/node_modules/form-data/node_modules/es-object-atoms/package.json +80 -0
- package/dist/node_modules/form-data/node_modules/es-object-atoms/test/index.js +38 -0
- package/dist/node_modules/form-data/node_modules/es-set-tostringtag/.eslintrc +13 -0
- package/dist/node_modules/form-data/node_modules/es-set-tostringtag/.nycrc +9 -0
- package/dist/node_modules/form-data/node_modules/es-set-tostringtag/index.d.ts +10 -0
- package/dist/node_modules/form-data/node_modules/es-set-tostringtag/index.js +35 -0
- package/dist/node_modules/form-data/node_modules/es-set-tostringtag/node_modules/hasown/.eslintrc +5 -0
- package/dist/node_modules/form-data/node_modules/es-set-tostringtag/node_modules/hasown/.github/FUNDING.yml +12 -0
- package/dist/node_modules/form-data/node_modules/es-set-tostringtag/node_modules/hasown/.nycrc +13 -0
- package/dist/node_modules/form-data/node_modules/es-set-tostringtag/node_modules/hasown/index.d.ts +3 -0
- package/dist/node_modules/form-data/node_modules/es-set-tostringtag/node_modules/hasown/index.js +8 -0
- package/dist/node_modules/form-data/node_modules/es-set-tostringtag/node_modules/hasown/package.json +92 -0
- package/dist/node_modules/form-data/node_modules/es-set-tostringtag/package.json +78 -0
- package/dist/node_modules/form-data/node_modules/es-set-tostringtag/test/index.js +85 -0
- package/dist/node_modules/form-data/node_modules/get-intrinsic/.eslintrc +42 -0
- package/dist/node_modules/form-data/node_modules/get-intrinsic/.github/FUNDING.yml +12 -0
- package/dist/node_modules/form-data/node_modules/get-intrinsic/.nycrc +9 -0
- package/dist/node_modules/form-data/node_modules/get-intrinsic/index.js +378 -0
- package/dist/node_modules/form-data/node_modules/get-intrinsic/node_modules/has-symbols/.eslintrc +11 -0
- package/dist/node_modules/form-data/node_modules/get-intrinsic/node_modules/has-symbols/.github/FUNDING.yml +12 -0
- package/dist/node_modules/form-data/node_modules/get-intrinsic/node_modules/has-symbols/.nycrc +9 -0
- package/dist/node_modules/form-data/node_modules/get-intrinsic/node_modules/has-symbols/index.d.ts +3 -0
- package/dist/node_modules/form-data/node_modules/get-intrinsic/node_modules/has-symbols/index.js +14 -0
- package/dist/node_modules/form-data/node_modules/get-intrinsic/node_modules/has-symbols/package.json +111 -0
- package/dist/node_modules/form-data/node_modules/get-intrinsic/node_modules/has-symbols/shams.d.ts +3 -0
- package/dist/node_modules/form-data/node_modules/get-intrinsic/node_modules/has-symbols/shams.js +45 -0
- package/dist/node_modules/form-data/node_modules/get-intrinsic/node_modules/has-symbols/test/index.js +22 -0
- package/dist/node_modules/form-data/node_modules/get-intrinsic/node_modules/has-symbols/test/shams/core-js.js +29 -0
- package/dist/node_modules/form-data/node_modules/get-intrinsic/node_modules/has-symbols/test/shams/get-own-property-symbols.js +29 -0
- package/dist/node_modules/form-data/node_modules/get-intrinsic/node_modules/has-symbols/test/tests.js +58 -0
- package/dist/node_modules/form-data/node_modules/get-intrinsic/node_modules/hasown/.eslintrc +5 -0
- package/dist/node_modules/form-data/node_modules/get-intrinsic/node_modules/hasown/.github/FUNDING.yml +12 -0
- package/dist/node_modules/form-data/node_modules/get-intrinsic/node_modules/hasown/.nycrc +13 -0
- package/dist/node_modules/form-data/node_modules/get-intrinsic/node_modules/hasown/index.d.ts +3 -0
- package/dist/node_modules/form-data/node_modules/get-intrinsic/node_modules/hasown/index.js +8 -0
- package/dist/node_modules/form-data/node_modules/get-intrinsic/node_modules/hasown/package.json +92 -0
- package/dist/node_modules/form-data/node_modules/get-intrinsic/package.json +97 -0
- package/dist/node_modules/form-data/node_modules/get-intrinsic/test/GetIntrinsic.js +274 -0
- package/dist/node_modules/form-data/node_modules/gopd/.eslintrc +16 -0
- package/dist/node_modules/form-data/node_modules/gopd/.github/FUNDING.yml +12 -0
- package/dist/node_modules/form-data/node_modules/gopd/gOPD.d.ts +1 -0
- package/dist/node_modules/form-data/node_modules/gopd/gOPD.js +4 -0
- package/dist/node_modules/form-data/node_modules/gopd/index.d.ts +5 -0
- package/dist/node_modules/form-data/node_modules/gopd/index.js +15 -0
- package/dist/node_modules/form-data/node_modules/gopd/package.json +77 -0
- package/dist/node_modules/form-data/node_modules/gopd/test/index.js +36 -0
- package/dist/node_modules/form-data/node_modules/has-tostringtag/.eslintrc +5 -0
- package/dist/node_modules/form-data/node_modules/has-tostringtag/.github/FUNDING.yml +12 -0
- package/dist/node_modules/form-data/node_modules/has-tostringtag/.nycrc +13 -0
- package/dist/node_modules/form-data/node_modules/has-tostringtag/index.d.ts +3 -0
- package/dist/node_modules/form-data/node_modules/has-tostringtag/index.js +8 -0
- package/dist/node_modules/form-data/node_modules/has-tostringtag/package.json +108 -0
- package/dist/node_modules/form-data/node_modules/has-tostringtag/shams.d.ts +3 -0
- package/dist/node_modules/form-data/node_modules/has-tostringtag/shams.js +8 -0
- package/dist/node_modules/form-data/node_modules/has-tostringtag/test/index.js +21 -0
- package/dist/node_modules/form-data/node_modules/has-tostringtag/test/shams/core-js.js +31 -0
- package/dist/node_modules/form-data/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js +30 -0
- package/dist/node_modules/form-data/node_modules/has-tostringtag/test/tests.js +15 -0
- package/dist/node_modules/form-data/node_modules/hasown/.github/FUNDING.yml +12 -0
- package/dist/node_modules/form-data/node_modules/hasown/.nycrc +13 -0
- package/dist/node_modules/form-data/node_modules/hasown/index.d.ts +3 -0
- package/dist/node_modules/form-data/node_modules/hasown/index.js +8 -0
- package/dist/node_modules/form-data/node_modules/hasown/package.json +91 -0
- package/dist/node_modules/form-data/package.json +1 -1
- package/dist/node_modules/mime-types/index.js +3 -3
- package/dist/node_modules/mime-types/package.json +1 -1
- package/dist/server/actions.js +45 -35
- package/package.json +57 -46
- package/src/client/index.tsx +15 -15
- package/src/client-v2/components/EndpointsTab.tsx +578 -578
- package/src/client-v2/components/JobsTab.tsx +294 -294
- package/src/client-v2/components/PipelinesTab.tsx +962 -962
- package/src/client-v2/components/PluginSettings.tsx +50 -50
- package/src/client-v2/components/ServiceConfigTab.tsx +139 -139
- package/src/client-v2/index.tsx +1 -1
- package/src/client-v2/locale.ts +21 -21
- package/src/client-v2/models/index.ts +12 -12
- package/src/client-v2/plugin.tsx +31 -21
- package/src/client-v2/types.ts +32 -32
- package/src/index.ts +2 -2
- package/src/locale/en-US.json +3 -1
- package/src/locale/zh-CN.json +3 -1
- package/src/server/__tests__/actions.test.ts +121 -98
- package/src/server/__tests__/cluster-safety.test.ts +259 -259
- package/src/server/__tests__/document-understanding-service.test.ts +82 -82
- package/src/server/__tests__/dugate-integration.test.ts +221 -221
- package/src/server/__tests__/smoke.test.ts +78 -55
- package/src/server/__tests__/upload-security.test.ts +128 -0
- package/src/server/actions.ts +53 -51
- package/src/server/collections/config.ts +18 -18
- package/src/server/collections/endpoints.ts +33 -33
- package/src/server/collections/jobs.ts +42 -42
- package/src/server/collections/pipeline-steps.ts +27 -27
- package/src/server/collections/pipelines.ts +19 -19
- package/src/server/dugate-seed.ts +491 -491
- package/src/server/index.ts +1 -1
- package/src/server/plugin.ts +143 -143
- package/src/server/services/AsyncJobManager.ts +238 -238
- package/src/server/services/DocumentUnderstandingService.ts +332 -332
- package/src/server/services/ExternalApiClient.ts +178 -178
- package/src/server/services/PipelineExecutor.ts +593 -593
- package/src/server/tools/document-understanding-tool.ts +181 -181
- package/src/server/types.ts +90 -90
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "es-set-tostringtag",
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"description": "A helper to optimistically set Symbol.toStringTag, when possible.",
|
|
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=autogenerated",
|
|
13
|
+
"prepublishOnly": "safe-publish-latest",
|
|
14
|
+
"prepublish": "not-in-publish || npm run prepublishOnly",
|
|
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/es-shims/es-set-tostringtag.git"
|
|
28
|
+
},
|
|
29
|
+
"author": "Jordan Harband <ljharb@gmail.com>",
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/es-shims/es-set-tostringtag/issues"
|
|
33
|
+
},
|
|
34
|
+
"homepage": "https://github.com/es-shims/es-set-tostringtag#readme",
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@arethetypeswrong/cli": "^0.17.2",
|
|
37
|
+
"@ljharb/eslint-config": "^21.1.1",
|
|
38
|
+
"@ljharb/tsconfig": "^0.2.3",
|
|
39
|
+
"@types/get-intrinsic": "^1.2.3",
|
|
40
|
+
"@types/has-symbols": "^1.0.2",
|
|
41
|
+
"@types/tape": "^5.8.0",
|
|
42
|
+
"auto-changelog": "^2.5.0",
|
|
43
|
+
"encoding": "^0.1.13",
|
|
44
|
+
"eslint": "=8.8.0",
|
|
45
|
+
"evalmd": "^0.0.19",
|
|
46
|
+
"in-publish": "^2.0.1",
|
|
47
|
+
"npmignore": "^0.3.1",
|
|
48
|
+
"nyc": "^10.3.2",
|
|
49
|
+
"safe-publish-latest": "^2.0.0",
|
|
50
|
+
"tape": "^5.9.0",
|
|
51
|
+
"typescript": "next"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"es-errors": "^1.3.0",
|
|
55
|
+
"get-intrinsic": "^1.2.6",
|
|
56
|
+
"has-tostringtag": "^1.0.2",
|
|
57
|
+
"hasown": "^2.0.2"
|
|
58
|
+
},
|
|
59
|
+
"engines": {
|
|
60
|
+
"node": ">= 0.4"
|
|
61
|
+
},
|
|
62
|
+
"auto-changelog": {
|
|
63
|
+
"output": "CHANGELOG.md",
|
|
64
|
+
"template": "keepachangelog",
|
|
65
|
+
"unreleased": false,
|
|
66
|
+
"commitLimit": false,
|
|
67
|
+
"backfillLimit": false,
|
|
68
|
+
"hideCredit": true
|
|
69
|
+
},
|
|
70
|
+
"testling": {
|
|
71
|
+
"files": "./test/index.js"
|
|
72
|
+
},
|
|
73
|
+
"publishConfig": {
|
|
74
|
+
"ignore": [
|
|
75
|
+
".github/workflows"
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var test = require('tape');
|
|
4
|
+
var hasToStringTag = require('has-tostringtag/shams')();
|
|
5
|
+
var hasOwn = require('hasown');
|
|
6
|
+
|
|
7
|
+
var setToStringTag = require('../');
|
|
8
|
+
|
|
9
|
+
test('setToStringTag', function (t) {
|
|
10
|
+
t.equal(typeof setToStringTag, 'function', 'is a function');
|
|
11
|
+
|
|
12
|
+
/** @type {{ [Symbol.toStringTag]?: typeof sentinel }} */
|
|
13
|
+
var obj = {};
|
|
14
|
+
var sentinel = {};
|
|
15
|
+
|
|
16
|
+
setToStringTag(obj, sentinel);
|
|
17
|
+
|
|
18
|
+
t['throws'](
|
|
19
|
+
// @ts-expect-error
|
|
20
|
+
function () { setToStringTag(obj, sentinel, { force: 'yes' }); },
|
|
21
|
+
TypeError,
|
|
22
|
+
'throws if options is not an object'
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
t.test('has Symbol.toStringTag', { skip: !hasToStringTag }, function (st) {
|
|
26
|
+
st.ok(hasOwn(obj, Symbol.toStringTag), 'has toStringTag property');
|
|
27
|
+
|
|
28
|
+
st.equal(obj[Symbol.toStringTag], sentinel, 'toStringTag property is as expected');
|
|
29
|
+
|
|
30
|
+
st.equal(String(obj), '[object Object]', 'toStringTag works');
|
|
31
|
+
|
|
32
|
+
/** @type {{ [Symbol.toStringTag]?: string }} */
|
|
33
|
+
var tagged = {};
|
|
34
|
+
tagged[Symbol.toStringTag] = 'already tagged';
|
|
35
|
+
st.equal(String(tagged), '[object already tagged]', 'toStringTag works');
|
|
36
|
+
|
|
37
|
+
setToStringTag(tagged, 'new tag');
|
|
38
|
+
st.equal(String(tagged), '[object already tagged]', 'toStringTag is unchanged');
|
|
39
|
+
|
|
40
|
+
setToStringTag(tagged, 'new tag', { force: true });
|
|
41
|
+
st.equal(String(tagged), '[object new tag]', 'toStringTag is changed with force: true');
|
|
42
|
+
|
|
43
|
+
st.deepEqual(
|
|
44
|
+
Object.getOwnPropertyDescriptor(tagged, Symbol.toStringTag),
|
|
45
|
+
{
|
|
46
|
+
configurable: true,
|
|
47
|
+
enumerable: false,
|
|
48
|
+
value: 'new tag',
|
|
49
|
+
writable: false
|
|
50
|
+
},
|
|
51
|
+
'has expected property descriptor'
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
setToStringTag(tagged, 'new tag', { force: true, nonConfigurable: true });
|
|
55
|
+
st.deepEqual(
|
|
56
|
+
Object.getOwnPropertyDescriptor(tagged, Symbol.toStringTag),
|
|
57
|
+
{
|
|
58
|
+
configurable: false,
|
|
59
|
+
enumerable: false,
|
|
60
|
+
value: 'new tag',
|
|
61
|
+
writable: false
|
|
62
|
+
},
|
|
63
|
+
'is nonconfigurable'
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
st.end();
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
t.test('does not have Symbol.toStringTag', { skip: hasToStringTag }, function (st) {
|
|
70
|
+
var passed = true;
|
|
71
|
+
for (var key in obj) { // eslint-disable-line no-restricted-syntax
|
|
72
|
+
if (hasOwn(obj, key)) {
|
|
73
|
+
st.fail('object has own key ' + key);
|
|
74
|
+
passed = false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (passed) {
|
|
78
|
+
st.ok(true, 'object has no enumerable own keys');
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
st.end();
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
t.end();
|
|
85
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"root": true,
|
|
3
|
+
|
|
4
|
+
"extends": "@ljharb",
|
|
5
|
+
|
|
6
|
+
"env": {
|
|
7
|
+
"es6": true,
|
|
8
|
+
"es2017": true,
|
|
9
|
+
"es2020": true,
|
|
10
|
+
"es2021": true,
|
|
11
|
+
"es2022": true,
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
"globals": {
|
|
15
|
+
"Float16Array": false,
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
"rules": {
|
|
19
|
+
"array-bracket-newline": 0,
|
|
20
|
+
"complexity": 0,
|
|
21
|
+
"eqeqeq": [2, "allow-null"],
|
|
22
|
+
"func-name-matching": 0,
|
|
23
|
+
"id-length": 0,
|
|
24
|
+
"max-lines": 0,
|
|
25
|
+
"max-lines-per-function": [2, 90],
|
|
26
|
+
"max-params": [2, 4],
|
|
27
|
+
"max-statements": 0,
|
|
28
|
+
"max-statements-per-line": [2, { "max": 2 }],
|
|
29
|
+
"multiline-comment-style": 0,
|
|
30
|
+
"no-magic-numbers": 0,
|
|
31
|
+
"sort-keys": 0,
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
"overrides": [
|
|
35
|
+
{
|
|
36
|
+
"files": "test/**",
|
|
37
|
+
"rules": {
|
|
38
|
+
"new-cap": 0,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
}
|
|
@@ -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/get-intrinsic
|
|
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']
|
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var undefined;
|
|
4
|
+
|
|
5
|
+
var $Object = require('es-object-atoms');
|
|
6
|
+
|
|
7
|
+
var $Error = require('es-errors');
|
|
8
|
+
var $EvalError = require('es-errors/eval');
|
|
9
|
+
var $RangeError = require('es-errors/range');
|
|
10
|
+
var $ReferenceError = require('es-errors/ref');
|
|
11
|
+
var $SyntaxError = require('es-errors/syntax');
|
|
12
|
+
var $TypeError = require('es-errors/type');
|
|
13
|
+
var $URIError = require('es-errors/uri');
|
|
14
|
+
|
|
15
|
+
var abs = require('math-intrinsics/abs');
|
|
16
|
+
var floor = require('math-intrinsics/floor');
|
|
17
|
+
var max = require('math-intrinsics/max');
|
|
18
|
+
var min = require('math-intrinsics/min');
|
|
19
|
+
var pow = require('math-intrinsics/pow');
|
|
20
|
+
var round = require('math-intrinsics/round');
|
|
21
|
+
var sign = require('math-intrinsics/sign');
|
|
22
|
+
|
|
23
|
+
var $Function = Function;
|
|
24
|
+
|
|
25
|
+
// eslint-disable-next-line consistent-return
|
|
26
|
+
var getEvalledConstructor = function (expressionSyntax) {
|
|
27
|
+
try {
|
|
28
|
+
return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
|
|
29
|
+
} catch (e) {}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
var $gOPD = require('gopd');
|
|
33
|
+
var $defineProperty = require('es-define-property');
|
|
34
|
+
|
|
35
|
+
var throwTypeError = function () {
|
|
36
|
+
throw new $TypeError();
|
|
37
|
+
};
|
|
38
|
+
var ThrowTypeError = $gOPD
|
|
39
|
+
? (function () {
|
|
40
|
+
try {
|
|
41
|
+
// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
|
|
42
|
+
arguments.callee; // IE 8 does not throw here
|
|
43
|
+
return throwTypeError;
|
|
44
|
+
} catch (calleeThrows) {
|
|
45
|
+
try {
|
|
46
|
+
// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
|
|
47
|
+
return $gOPD(arguments, 'callee').get;
|
|
48
|
+
} catch (gOPDthrows) {
|
|
49
|
+
return throwTypeError;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}())
|
|
53
|
+
: throwTypeError;
|
|
54
|
+
|
|
55
|
+
var hasSymbols = require('has-symbols')();
|
|
56
|
+
|
|
57
|
+
var getProto = require('get-proto');
|
|
58
|
+
var $ObjectGPO = require('get-proto/Object.getPrototypeOf');
|
|
59
|
+
var $ReflectGPO = require('get-proto/Reflect.getPrototypeOf');
|
|
60
|
+
|
|
61
|
+
var $apply = require('call-bind-apply-helpers/functionApply');
|
|
62
|
+
var $call = require('call-bind-apply-helpers/functionCall');
|
|
63
|
+
|
|
64
|
+
var needsEval = {};
|
|
65
|
+
|
|
66
|
+
var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);
|
|
67
|
+
|
|
68
|
+
var INTRINSICS = {
|
|
69
|
+
__proto__: null,
|
|
70
|
+
'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
|
|
71
|
+
'%Array%': Array,
|
|
72
|
+
'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
|
|
73
|
+
'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,
|
|
74
|
+
'%AsyncFromSyncIteratorPrototype%': undefined,
|
|
75
|
+
'%AsyncFunction%': needsEval,
|
|
76
|
+
'%AsyncGenerator%': needsEval,
|
|
77
|
+
'%AsyncGeneratorFunction%': needsEval,
|
|
78
|
+
'%AsyncIteratorPrototype%': needsEval,
|
|
79
|
+
'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
|
|
80
|
+
'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
|
|
81
|
+
'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,
|
|
82
|
+
'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,
|
|
83
|
+
'%Boolean%': Boolean,
|
|
84
|
+
'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
|
|
85
|
+
'%Date%': Date,
|
|
86
|
+
'%decodeURI%': decodeURI,
|
|
87
|
+
'%decodeURIComponent%': decodeURIComponent,
|
|
88
|
+
'%encodeURI%': encodeURI,
|
|
89
|
+
'%encodeURIComponent%': encodeURIComponent,
|
|
90
|
+
'%Error%': $Error,
|
|
91
|
+
'%eval%': eval, // eslint-disable-line no-eval
|
|
92
|
+
'%EvalError%': $EvalError,
|
|
93
|
+
'%Float16Array%': typeof Float16Array === 'undefined' ? undefined : Float16Array,
|
|
94
|
+
'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
|
|
95
|
+
'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
|
|
96
|
+
'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
|
|
97
|
+
'%Function%': $Function,
|
|
98
|
+
'%GeneratorFunction%': needsEval,
|
|
99
|
+
'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
|
|
100
|
+
'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
|
|
101
|
+
'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
|
|
102
|
+
'%isFinite%': isFinite,
|
|
103
|
+
'%isNaN%': isNaN,
|
|
104
|
+
'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,
|
|
105
|
+
'%JSON%': typeof JSON === 'object' ? JSON : undefined,
|
|
106
|
+
'%Map%': typeof Map === 'undefined' ? undefined : Map,
|
|
107
|
+
'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),
|
|
108
|
+
'%Math%': Math,
|
|
109
|
+
'%Number%': Number,
|
|
110
|
+
'%Object%': $Object,
|
|
111
|
+
'%Object.getOwnPropertyDescriptor%': $gOPD,
|
|
112
|
+
'%parseFloat%': parseFloat,
|
|
113
|
+
'%parseInt%': parseInt,
|
|
114
|
+
'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
|
|
115
|
+
'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
|
|
116
|
+
'%RangeError%': $RangeError,
|
|
117
|
+
'%ReferenceError%': $ReferenceError,
|
|
118
|
+
'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
|
|
119
|
+
'%RegExp%': RegExp,
|
|
120
|
+
'%Set%': typeof Set === 'undefined' ? undefined : Set,
|
|
121
|
+
'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),
|
|
122
|
+
'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
|
|
123
|
+
'%String%': String,
|
|
124
|
+
'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,
|
|
125
|
+
'%Symbol%': hasSymbols ? Symbol : undefined,
|
|
126
|
+
'%SyntaxError%': $SyntaxError,
|
|
127
|
+
'%ThrowTypeError%': ThrowTypeError,
|
|
128
|
+
'%TypedArray%': TypedArray,
|
|
129
|
+
'%TypeError%': $TypeError,
|
|
130
|
+
'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
|
|
131
|
+
'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
|
|
132
|
+
'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
|
|
133
|
+
'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
|
|
134
|
+
'%URIError%': $URIError,
|
|
135
|
+
'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
|
|
136
|
+
'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
|
|
137
|
+
'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet,
|
|
138
|
+
|
|
139
|
+
'%Function.prototype.call%': $call,
|
|
140
|
+
'%Function.prototype.apply%': $apply,
|
|
141
|
+
'%Object.defineProperty%': $defineProperty,
|
|
142
|
+
'%Object.getPrototypeOf%': $ObjectGPO,
|
|
143
|
+
'%Math.abs%': abs,
|
|
144
|
+
'%Math.floor%': floor,
|
|
145
|
+
'%Math.max%': max,
|
|
146
|
+
'%Math.min%': min,
|
|
147
|
+
'%Math.pow%': pow,
|
|
148
|
+
'%Math.round%': round,
|
|
149
|
+
'%Math.sign%': sign,
|
|
150
|
+
'%Reflect.getPrototypeOf%': $ReflectGPO
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
if (getProto) {
|
|
154
|
+
try {
|
|
155
|
+
null.error; // eslint-disable-line no-unused-expressions
|
|
156
|
+
} catch (e) {
|
|
157
|
+
// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
|
|
158
|
+
var errorProto = getProto(getProto(e));
|
|
159
|
+
INTRINSICS['%Error.prototype%'] = errorProto;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
var doEval = function doEval(name) {
|
|
164
|
+
var value;
|
|
165
|
+
if (name === '%AsyncFunction%') {
|
|
166
|
+
value = getEvalledConstructor('async function () {}');
|
|
167
|
+
} else if (name === '%GeneratorFunction%') {
|
|
168
|
+
value = getEvalledConstructor('function* () {}');
|
|
169
|
+
} else if (name === '%AsyncGeneratorFunction%') {
|
|
170
|
+
value = getEvalledConstructor('async function* () {}');
|
|
171
|
+
} else if (name === '%AsyncGenerator%') {
|
|
172
|
+
var fn = doEval('%AsyncGeneratorFunction%');
|
|
173
|
+
if (fn) {
|
|
174
|
+
value = fn.prototype;
|
|
175
|
+
}
|
|
176
|
+
} else if (name === '%AsyncIteratorPrototype%') {
|
|
177
|
+
var gen = doEval('%AsyncGenerator%');
|
|
178
|
+
if (gen && getProto) {
|
|
179
|
+
value = getProto(gen.prototype);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
INTRINSICS[name] = value;
|
|
184
|
+
|
|
185
|
+
return value;
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
var LEGACY_ALIASES = {
|
|
189
|
+
__proto__: null,
|
|
190
|
+
'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
|
|
191
|
+
'%ArrayPrototype%': ['Array', 'prototype'],
|
|
192
|
+
'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
|
|
193
|
+
'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
|
|
194
|
+
'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
|
|
195
|
+
'%ArrayProto_values%': ['Array', 'prototype', 'values'],
|
|
196
|
+
'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
|
|
197
|
+
'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
|
|
198
|
+
'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
|
|
199
|
+
'%BooleanPrototype%': ['Boolean', 'prototype'],
|
|
200
|
+
'%DataViewPrototype%': ['DataView', 'prototype'],
|
|
201
|
+
'%DatePrototype%': ['Date', 'prototype'],
|
|
202
|
+
'%ErrorPrototype%': ['Error', 'prototype'],
|
|
203
|
+
'%EvalErrorPrototype%': ['EvalError', 'prototype'],
|
|
204
|
+
'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
|
|
205
|
+
'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
|
|
206
|
+
'%FunctionPrototype%': ['Function', 'prototype'],
|
|
207
|
+
'%Generator%': ['GeneratorFunction', 'prototype'],
|
|
208
|
+
'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
|
|
209
|
+
'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
|
|
210
|
+
'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
|
|
211
|
+
'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
|
|
212
|
+
'%JSONParse%': ['JSON', 'parse'],
|
|
213
|
+
'%JSONStringify%': ['JSON', 'stringify'],
|
|
214
|
+
'%MapPrototype%': ['Map', 'prototype'],
|
|
215
|
+
'%NumberPrototype%': ['Number', 'prototype'],
|
|
216
|
+
'%ObjectPrototype%': ['Object', 'prototype'],
|
|
217
|
+
'%ObjProto_toString%': ['Object', 'prototype', 'toString'],
|
|
218
|
+
'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
|
|
219
|
+
'%PromisePrototype%': ['Promise', 'prototype'],
|
|
220
|
+
'%PromiseProto_then%': ['Promise', 'prototype', 'then'],
|
|
221
|
+
'%Promise_all%': ['Promise', 'all'],
|
|
222
|
+
'%Promise_reject%': ['Promise', 'reject'],
|
|
223
|
+
'%Promise_resolve%': ['Promise', 'resolve'],
|
|
224
|
+
'%RangeErrorPrototype%': ['RangeError', 'prototype'],
|
|
225
|
+
'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
|
|
226
|
+
'%RegExpPrototype%': ['RegExp', 'prototype'],
|
|
227
|
+
'%SetPrototype%': ['Set', 'prototype'],
|
|
228
|
+
'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
|
|
229
|
+
'%StringPrototype%': ['String', 'prototype'],
|
|
230
|
+
'%SymbolPrototype%': ['Symbol', 'prototype'],
|
|
231
|
+
'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
|
|
232
|
+
'%TypedArrayPrototype%': ['TypedArray', 'prototype'],
|
|
233
|
+
'%TypeErrorPrototype%': ['TypeError', 'prototype'],
|
|
234
|
+
'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
|
|
235
|
+
'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
|
|
236
|
+
'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
|
|
237
|
+
'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
|
|
238
|
+
'%URIErrorPrototype%': ['URIError', 'prototype'],
|
|
239
|
+
'%WeakMapPrototype%': ['WeakMap', 'prototype'],
|
|
240
|
+
'%WeakSetPrototype%': ['WeakSet', 'prototype']
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
var bind = require('function-bind');
|
|
244
|
+
var hasOwn = require('hasown');
|
|
245
|
+
var $concat = bind.call($call, Array.prototype.concat);
|
|
246
|
+
var $spliceApply = bind.call($apply, Array.prototype.splice);
|
|
247
|
+
var $replace = bind.call($call, String.prototype.replace);
|
|
248
|
+
var $strSlice = bind.call($call, String.prototype.slice);
|
|
249
|
+
var $exec = bind.call($call, RegExp.prototype.exec);
|
|
250
|
+
|
|
251
|
+
/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
|
|
252
|
+
var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
|
|
253
|
+
var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
|
|
254
|
+
var stringToPath = function stringToPath(string) {
|
|
255
|
+
var first = $strSlice(string, 0, 1);
|
|
256
|
+
var last = $strSlice(string, -1);
|
|
257
|
+
if (first === '%' && last !== '%') {
|
|
258
|
+
throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
|
|
259
|
+
} else if (last === '%' && first !== '%') {
|
|
260
|
+
throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
|
|
261
|
+
}
|
|
262
|
+
var result = [];
|
|
263
|
+
$replace(string, rePropName, function (match, number, quote, subString) {
|
|
264
|
+
result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
|
|
265
|
+
});
|
|
266
|
+
return result;
|
|
267
|
+
};
|
|
268
|
+
/* end adaptation */
|
|
269
|
+
|
|
270
|
+
var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
|
|
271
|
+
var intrinsicName = name;
|
|
272
|
+
var alias;
|
|
273
|
+
if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
|
|
274
|
+
alias = LEGACY_ALIASES[intrinsicName];
|
|
275
|
+
intrinsicName = '%' + alias[0] + '%';
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
if (hasOwn(INTRINSICS, intrinsicName)) {
|
|
279
|
+
var value = INTRINSICS[intrinsicName];
|
|
280
|
+
if (value === needsEval) {
|
|
281
|
+
value = doEval(intrinsicName);
|
|
282
|
+
}
|
|
283
|
+
if (typeof value === 'undefined' && !allowMissing) {
|
|
284
|
+
throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
return {
|
|
288
|
+
alias: alias,
|
|
289
|
+
name: intrinsicName,
|
|
290
|
+
value: value
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
module.exports = function GetIntrinsic(name, allowMissing) {
|
|
298
|
+
if (typeof name !== 'string' || name.length === 0) {
|
|
299
|
+
throw new $TypeError('intrinsic name must be a non-empty string');
|
|
300
|
+
}
|
|
301
|
+
if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
|
|
302
|
+
throw new $TypeError('"allowMissing" argument must be a boolean');
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
if ($exec(/^%?[^%]*%?$/, name) === null) {
|
|
306
|
+
throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
|
|
307
|
+
}
|
|
308
|
+
var parts = stringToPath(name);
|
|
309
|
+
var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
|
|
310
|
+
|
|
311
|
+
var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
|
|
312
|
+
var intrinsicRealName = intrinsic.name;
|
|
313
|
+
var value = intrinsic.value;
|
|
314
|
+
var skipFurtherCaching = false;
|
|
315
|
+
|
|
316
|
+
var alias = intrinsic.alias;
|
|
317
|
+
if (alias) {
|
|
318
|
+
intrinsicBaseName = alias[0];
|
|
319
|
+
$spliceApply(parts, $concat([0, 1], alias));
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
for (var i = 1, isOwn = true; i < parts.length; i += 1) {
|
|
323
|
+
var part = parts[i];
|
|
324
|
+
var first = $strSlice(part, 0, 1);
|
|
325
|
+
var last = $strSlice(part, -1);
|
|
326
|
+
if (
|
|
327
|
+
(
|
|
328
|
+
(first === '"' || first === "'" || first === '`')
|
|
329
|
+
|| (last === '"' || last === "'" || last === '`')
|
|
330
|
+
)
|
|
331
|
+
&& first !== last
|
|
332
|
+
) {
|
|
333
|
+
throw new $SyntaxError('property names with quotes must have matching quotes');
|
|
334
|
+
}
|
|
335
|
+
if (part === 'constructor' || !isOwn) {
|
|
336
|
+
skipFurtherCaching = true;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
intrinsicBaseName += '.' + part;
|
|
340
|
+
intrinsicRealName = '%' + intrinsicBaseName + '%';
|
|
341
|
+
|
|
342
|
+
if (hasOwn(INTRINSICS, intrinsicRealName)) {
|
|
343
|
+
value = INTRINSICS[intrinsicRealName];
|
|
344
|
+
} else if (value != null) {
|
|
345
|
+
if (!(part in value)) {
|
|
346
|
+
if (!allowMissing) {
|
|
347
|
+
throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
|
|
348
|
+
}
|
|
349
|
+
return void undefined;
|
|
350
|
+
}
|
|
351
|
+
if ($gOPD && (i + 1) >= parts.length) {
|
|
352
|
+
var desc = $gOPD(value, part);
|
|
353
|
+
isOwn = !!desc;
|
|
354
|
+
|
|
355
|
+
// By convention, when a data property is converted to an accessor
|
|
356
|
+
// property to emulate a data property that does not suffer from
|
|
357
|
+
// the override mistake, that accessor's getter is marked with
|
|
358
|
+
// an `originalValue` property. Here, when we detect this, we
|
|
359
|
+
// uphold the illusion by pretending to see that original data
|
|
360
|
+
// property, i.e., returning the value rather than the getter
|
|
361
|
+
// itself.
|
|
362
|
+
if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
|
|
363
|
+
value = desc.get;
|
|
364
|
+
} else {
|
|
365
|
+
value = value[part];
|
|
366
|
+
}
|
|
367
|
+
} else {
|
|
368
|
+
isOwn = hasOwn(value, part);
|
|
369
|
+
value = value[part];
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
if (isOwn && !skipFurtherCaching) {
|
|
373
|
+
INTRINSICS[intrinsicRealName] = value;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
return value;
|
|
378
|
+
};
|
|
@@ -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/has-symbols
|
|
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']
|
package/dist/node_modules/form-data/node_modules/get-intrinsic/node_modules/has-symbols/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var origSymbol = typeof Symbol !== 'undefined' && Symbol;
|
|
4
|
+
var hasSymbolSham = require('./shams');
|
|
5
|
+
|
|
6
|
+
/** @type {import('.')} */
|
|
7
|
+
module.exports = function hasNativeSymbols() {
|
|
8
|
+
if (typeof origSymbol !== 'function') { return false; }
|
|
9
|
+
if (typeof Symbol !== 'function') { return false; }
|
|
10
|
+
if (typeof origSymbol('foo') !== 'symbol') { return false; }
|
|
11
|
+
if (typeof Symbol('bar') !== 'symbol') { return false; }
|
|
12
|
+
|
|
13
|
+
return hasSymbolSham();
|
|
14
|
+
};
|