jai shree ram
This commit is contained in:
1
node_modules/get-symbol-description/.eslintignore
generated
vendored
Normal file
1
node_modules/get-symbol-description/.eslintignore
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
coverage/
|
14
node_modules/get-symbol-description/.eslintrc
generated
vendored
Normal file
14
node_modules/get-symbol-description/.eslintrc
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"root": true,
|
||||
|
||||
"extends": "@ljharb",
|
||||
|
||||
"rules": {
|
||||
"id-length": 0,
|
||||
"new-cap": [2, {
|
||||
"capIsNewExceptions": [
|
||||
"GetIntrinsic",
|
||||
],
|
||||
}],
|
||||
},
|
||||
}
|
12
node_modules/get-symbol-description/.github/FUNDING.yml
generated
vendored
Normal file
12
node_modules/get-symbol-description/.github/FUNDING.yml
generated
vendored
Normal file
@@ -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/symbol-description
|
||||
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']
|
9
node_modules/get-symbol-description/.nycrc
generated
vendored
Normal file
9
node_modules/get-symbol-description/.nycrc
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"all": true,
|
||||
"check-coverage": false,
|
||||
"reporter": ["text-summary", "text", "html", "json"],
|
||||
"exclude": [
|
||||
"coverage",
|
||||
"test"
|
||||
]
|
||||
}
|
16
node_modules/get-symbol-description/CHANGELOG.md
generated
vendored
Normal file
16
node_modules/get-symbol-description/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
# 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.0.0 - 2021-08-17
|
||||
|
||||
### Commits
|
||||
|
||||
- Initial commit: pulled from es-abstract [`6e34a05`](https://github.com/inspect-js/get-symbol-description/commit/6e34a05ef10ce8620078cf4cecbe276c1fc1ae77)
|
||||
- Initial commit [`3862092`](https://github.com/inspect-js/get-symbol-description/commit/3862092248d8ffa071ec90ec39d73e8be14ba6f1)
|
||||
- [meta] do not publish github action workflow files [`9d1e2b9`](https://github.com/inspect-js/get-symbol-description/commit/9d1e2b94dd97664da5d0666985a3695c23f45865)
|
||||
- npm init [`5051b32`](https://github.com/inspect-js/get-symbol-description/commit/5051b3221829f364c44b4d5e9a0c35aab3247f6a)
|
||||
- Only apps should have lockfiles [`b866d1c`](https://github.com/inspect-js/get-symbol-description/commit/b866d1c4b4029277618d968cfb3cbe00f012d1a7)
|
21
node_modules/get-symbol-description/LICENSE
generated
vendored
Normal file
21
node_modules/get-symbol-description/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Inspect JS
|
||||
|
||||
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.
|
43
node_modules/get-symbol-description/README.md
generated
vendored
Normal file
43
node_modules/get-symbol-description/README.md
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
# get-symbol-description <sup>[![Version Badge][2]][1]</sup>
|
||||
|
||||
[![github actions][actions-image]][actions-url]
|
||||
[![coverage][codecov-image]][codecov-url]
|
||||
[![dependency status][5]][6]
|
||||
[![dev dependency status][7]][8]
|
||||
[![License][license-image]][license-url]
|
||||
[![Downloads][downloads-image]][downloads-url]
|
||||
|
||||
[![npm badge][11]][1]
|
||||
|
||||
Gets the description of a Symbol. Handles `Symbol()` vs `Symbol('')` properly when possible.
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var getSymbolDescription = require('get-symbol-description');
|
||||
var assert = require('assert');
|
||||
|
||||
assert(getSymbolDescription(Symbol()) === undefined);
|
||||
assert(getSymbolDescription(Symbol('')) === ''); // or `undefined`, if in an engine that lacks name inference from concise method
|
||||
assert(getSymbolDescription(Symbol('foo')) === 'foo');
|
||||
assert(getSymbolDescription(Symbol.iterator) === 'Symbol.iterator');
|
||||
```
|
||||
|
||||
## Tests
|
||||
Simply clone the repo, `npm install`, and run `npm test`
|
||||
|
||||
[1]: https://npmjs.org/package/get-symbol-description
|
||||
[2]: https://versionbadg.es/inspect-js/get-symbol-description.svg
|
||||
[5]: https://david-dm.org/inspect-js/get-symbol-description.svg
|
||||
[6]: https://david-dm.org/inspect-js/get-symbol-description
|
||||
[7]: https://david-dm.org/inspect-js/get-symbol-description/dev-status.svg
|
||||
[8]: https://david-dm.org/inspect-js/get-symbol-description#info=devDependencies
|
||||
[11]: https://nodei.co/npm/get-symbol-description.png?downloads=true&stars=true
|
||||
[license-image]: https://img.shields.io/npm/l/get-symbol-description.svg
|
||||
[license-url]: LICENSE
|
||||
[downloads-image]: https://img.shields.io/npm/dm/get-symbol-description.svg
|
||||
[downloads-url]: https://npm-stat.com/charts.html?package=get-symbol-description
|
||||
[codecov-image]: https://codecov.io/gh/inspect-js/get-symbol-description/branch/main/graphs/badge.svg
|
||||
[codecov-url]: https://app.codecov.io/gh/inspect-js/get-symbol-description/
|
||||
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/get-symbol-description
|
||||
[actions-url]: https://github.com/inspect-js/get-symbol-description/actions
|
10
node_modules/get-symbol-description/getInferredName.js
generated
vendored
Normal file
10
node_modules/get-symbol-description/getInferredName.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
var getInferredName;
|
||||
try {
|
||||
// eslint-disable-next-line no-new-func
|
||||
getInferredName = Function('s', 'return { [s]() {} }[s].name;');
|
||||
} catch (e) {}
|
||||
|
||||
var inferred = function () {};
|
||||
module.exports = getInferredName && inferred.name === 'inferred' ? getInferredName : null;
|
43
node_modules/get-symbol-description/index.js
generated
vendored
Normal file
43
node_modules/get-symbol-description/index.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var callBound = require('call-bind/callBound');
|
||||
|
||||
var $SyntaxError = GetIntrinsic('%SyntaxError%');
|
||||
var getGlobalSymbolDescription = GetIntrinsic('%Symbol.keyFor%', true);
|
||||
var thisSymbolValue = callBound('%Symbol.prototype.valueOf%', true);
|
||||
var symToStr = callBound('Symbol.prototype.toString', true);
|
||||
|
||||
var getInferredName = require('./getInferredName');
|
||||
|
||||
/* eslint-disable consistent-return */
|
||||
module.exports = callBound('%Symbol.prototype.description%', true) || function getSymbolDescription(symbol) {
|
||||
if (!thisSymbolValue) {
|
||||
throw new $SyntaxError('Symbols are not supported in this environment');
|
||||
}
|
||||
|
||||
// will throw if not a symbol primitive or wrapper object
|
||||
var sym = thisSymbolValue(symbol);
|
||||
|
||||
if (getInferredName) {
|
||||
var name = getInferredName(sym);
|
||||
if (name === '') {
|
||||
return;
|
||||
}
|
||||
return name.slice(1, -1); // name.slice('['.length, -']'.length);
|
||||
}
|
||||
|
||||
var desc;
|
||||
if (getGlobalSymbolDescription) {
|
||||
desc = getGlobalSymbolDescription(sym);
|
||||
if (typeof desc === 'string') {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
|
||||
desc = symToStr(sym).slice(7, -1); // str.slice('Symbol('.length, -')'.length);
|
||||
if (desc) {
|
||||
return desc;
|
||||
}
|
||||
};
|
71
node_modules/get-symbol-description/package.json
generated
vendored
Normal file
71
node_modules/get-symbol-description/package.json
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
{
|
||||
"name": "get-symbol-description",
|
||||
"version": "1.0.0",
|
||||
"description": "Gets the description of a Symbol. Handles `Symbol()` vs `Symbol('')` properly when possible.",
|
||||
"main": "index.js",
|
||||
"exports": {
|
||||
".": "./index.js",
|
||||
"./getInferredName": "./getInferredName.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"scripts": {
|
||||
"prepublish": "not-in-publish || npm run prepublishOnly",
|
||||
"prepublishOnly": "safe-publish-latest",
|
||||
"lint": "eslint --ext=.js,.mjs .",
|
||||
"postlint": "evalmd README.md",
|
||||
"pretest": "npm run lint",
|
||||
"tests-only": "nyc tape 'test/**/*.js'",
|
||||
"test": "npm run tests-only",
|
||||
"posttest": "aud --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/inspect-js/get-symbol-description.git"
|
||||
},
|
||||
"keywords": [
|
||||
"symbol",
|
||||
"ecmascript",
|
||||
"javascript",
|
||||
"description"
|
||||
],
|
||||
"author": "Jordan Harband <ljharb@gmail.com>",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
},
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/inspect-js/get-symbol-description/issues"
|
||||
},
|
||||
"homepage": "https://github.com/inspect-js/get-symbol-description#readme",
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.2",
|
||||
"get-intrinsic": "^1.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ljharb/eslint-config": "^17.6.0",
|
||||
"aud": "^1.1.5",
|
||||
"auto-changelog": "^2.3.0",
|
||||
"es-value-fixtures": "^1.2.1",
|
||||
"eslint": "^7.32.0",
|
||||
"evalmd": "^0.0.19",
|
||||
"foreach": "^2.0.5",
|
||||
"has": "^1.0.3",
|
||||
"nyc": "^10.3.2",
|
||||
"object-inspect": "^1.11.0",
|
||||
"safe-publish-latest": "^1.1.4",
|
||||
"tape": "^5.3.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"auto-changelog": {
|
||||
"output": "CHANGELOG.md",
|
||||
"template": "keepachangelog",
|
||||
"unreleased": false,
|
||||
"commitLimit": false,
|
||||
"backfillLimit": false,
|
||||
"hideCredit": true
|
||||
}
|
||||
}
|
67
node_modules/get-symbol-description/test/index.js
generated
vendored
Normal file
67
node_modules/get-symbol-description/test/index.js
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
'use strict';
|
||||
|
||||
var test = require('tape');
|
||||
var debug = require('object-inspect');
|
||||
var forEach = require('foreach');
|
||||
var has = require('has');
|
||||
var v = require('es-value-fixtures');
|
||||
|
||||
var getSymbolDescription = require('../');
|
||||
var getInferredName = require('../getInferredName');
|
||||
|
||||
test('getSymbolDescription', function (t) {
|
||||
t.test('no symbols', { skip: v.hasSymbols }, function (st) {
|
||||
st['throws'](
|
||||
getSymbolDescription,
|
||||
SyntaxError,
|
||||
'requires Symbol support'
|
||||
);
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
forEach(v.nonSymbolPrimitives.concat(v.objects), function (nonSymbol) {
|
||||
t['throws'](
|
||||
function () { getSymbolDescription(nonSymbol); },
|
||||
v.hasSymbols ? TypeError : SyntaxError,
|
||||
debug(nonSymbol) + ' is not a Symbol'
|
||||
);
|
||||
});
|
||||
|
||||
t.test('with symbols', { skip: !v.hasSymbols }, function (st) {
|
||||
forEach(
|
||||
[
|
||||
[Symbol(), undefined],
|
||||
[Symbol(undefined), undefined],
|
||||
[Symbol(null), 'null'],
|
||||
[Symbol.iterator, 'Symbol.iterator'],
|
||||
[Symbol('foo'), 'foo']
|
||||
],
|
||||
function (pair) {
|
||||
var sym = pair[0];
|
||||
var desc = pair[1];
|
||||
st.equal(getSymbolDescription(sym), desc, debug(sym) + ' description is ' + debug(desc));
|
||||
}
|
||||
);
|
||||
|
||||
st.test('only possible when inference or native `Symbol.prototype.description` is supported', {
|
||||
skip: !getInferredName && !has(Symbol.prototype, 'description')
|
||||
}, function (s2t) {
|
||||
s2t.equal(getSymbolDescription(Symbol('')), '', 'Symbol("") description is ""');
|
||||
|
||||
s2t.end();
|
||||
});
|
||||
|
||||
st.test('only possible when global symbols are supported', {
|
||||
skip: !has(Symbol, 'for') || !has(Symbol, 'keyFor')
|
||||
}, function (s2t) {
|
||||
// eslint-disable-next-line no-restricted-properties
|
||||
s2t.equal(getSymbolDescription(Symbol['for']('')), '', 'Symbol.for("") description is ""');
|
||||
s2t.end();
|
||||
});
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.end();
|
||||
});
|
Reference in New Issue
Block a user