Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

symbol.prototype.description

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

symbol.prototype.description - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

42

CHANGELOG.md

@@ -1,3 +0,39 @@

1.0.0 / 2018-01-23
==================
* Initial relase
### Changelog
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
#### [v1.0.1](https://github.com/es-shims/Symbol.prototype.description/compare/v1.0.0...v1.0.1)
> 19 October 2019
- [Fix] `polyfill`: fix always-true logic [`#3`](https://github.com/es-shims/Symbol.prototype.description/issues/3)
- [Tests] up to `node` `v12.12`, `v11.15`, `v10.16`, `v8.16`, `v6.17` [`66278dd`](https://github.com/es-shims/Symbol.prototype.description/commit/66278dd1d06771eb13a9b02903740bb751e0f39d)
- [Tests] up to `node` `v10.4`, `v9.11`, `v8.11`, `v6.14`, `v4.9` [`8bdca03`](https://github.com/es-shims/Symbol.prototype.description/commit/8bdca03cb3296b0f2a73815255dd1d2cde7114cd)
- [Refactor] use `getSymbolDescription` and `getInferredName` helpers from `es-abstract` [`d6b2c51`](https://github.com/es-shims/Symbol.prototype.description/commit/d6b2c51d2f7d1489cef94705be0c9ced8becd779)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`; add `safe-publish-latest` [`ea4841b`](https://github.com/es-shims/Symbol.prototype.description/commit/ea4841b269810db4d788ff1913c47494a3bab6de)
- [meta] add `auto-changelog` [`415dcaf`](https://github.com/es-shims/Symbol.prototype.description/commit/415dcafd2f95836497fdf2e4336ebd2d5319434c)
- [Dev Deps] update `eslint`, `nsp`, `tape` [`25d2c71`](https://github.com/es-shims/Symbol.prototype.description/commit/25d2c71074f7f8e7844196c00df908528a6dc3e9)
- [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops [`32f79e9`](https://github.com/es-shims/Symbol.prototype.description/commit/32f79e9e1eeacb14cb968113c16becdf73477ba3)
#### v1.0.0
> 23 January 2018
- [Fix] use function name inference and computed properties to distinguish `Symbol()` from `Symbol(‘’)`, when available [`#2`](https://github.com/es-shims/Symbol.prototype.description/pull/2)
- [Fix] use function name inference and computed properties to distinguish `Symbol()` from `Symbol(‘’)`, when available. [`#1`](https://github.com/es-shims/Symbol.prototype.description/issues/1)
- [Tests] add travis-ci and `npm run security` [`b889123`](https://github.com/es-shims/Symbol.prototype.description/commit/b8891233987b6d3b3805d25071f7353d30275f41)
- Implementation. [`5bafd04`](https://github.com/es-shims/Symbol.prototype.description/commit/5bafd04c3efdb20feb62a9512cc74572ce44fe72)
- Tests [`96aee94`](https://github.com/es-shims/Symbol.prototype.description/commit/96aee940ec05d288462e109f0e531b128963d262)
- Initial commit [`fff1a67`](https://github.com/es-shims/Symbol.prototype.description/commit/fff1a671c95a111fe782014f2be56c3ee9567fa8)
- Read me [`3d21280`](https://github.com/es-shims/Symbol.prototype.description/commit/3d21280e12c8c24c2ba059b9bd3224bce5ee3439)
- [Tests] up to `node` `v9.2`, `v8.9`, `v6.12`; use `nvm install-latest-npm`; pin included builds to LTSr [`c6d1807`](https://github.com/es-shims/Symbol.prototype.description/commit/c6d18077067a5fc2835a0d38bbc90b28fb98e8e4)
- [Tests] add `npm run lint` [`1e4562c`](https://github.com/es-shims/Symbol.prototype.description/commit/1e4562c1f13aa0d9a7fc08f1801d47f13ba2d644)
- package.json [`6d53036`](https://github.com/es-shims/Symbol.prototype.description/commit/6d530361a2c930490d0e6799992c0639b01b95c8)
- [Fix] only shim global Symbol when needed [`10f4fa2`](https://github.com/es-shims/Symbol.prototype.description/commit/10f4fa2f8d6102ef8f5a07b23438d6a793c65c6b)
- Flesh out es-shim-api requirements. [`6bf128a`](https://github.com/es-shims/Symbol.prototype.description/commit/6bf128a0e383d6dc1acbc33e394644dca7e3e4dc)
- [Dev Deps] update `@es-shims/api`, `@ljharb/eslint-config`, `eslint`, `nsp`, `tape` [`9651fb6`](https://github.com/es-shims/Symbol.prototype.description/commit/9651fb616ca37ae24f85ebc9c4bd57bf6f722f24)
- Rename and move the repo. [`e136d90`](https://github.com/es-shims/Symbol.prototype.description/commit/e136d90b2213102cb4b60c00039b394d0ebba33d)
- Only apps should have lockfiles. [`74239df`](https://github.com/es-shims/Symbol.prototype.description/commit/74239df051bb8bf488aa08b16be04a7e672f4d74)
- [Dev Deps] update `@es-shims/api`, `eslint` [`e3c8d64`](https://github.com/es-shims/Symbol.prototype.description/commit/e3c8d64ea4016682298c8ac97a2726e9b61f77b0)

10

helpers/getInferredName.js
'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;
module.exports = require('es-abstract/helpers/getInferredName');
'use strict';
var hasSymbols = require('has-symbols')();
var symToStr = hasSymbols ? Function.call.bind(Symbol.prototype.toString) : null;
var getInferredName = require('./helpers/getInferredName');
var getSymbolDescription = require('es-abstract/helpers/getSymbolDescription');
module.exports = function description() {
var str = symToStr(this); // will throw if not a Symbol
if (getInferredName) {
var name = getInferredName(this);
if (name === '') { return; }
return name.slice(1, -1); // name.slice('['.length, -']'.length);
}
var desc = str.slice(7, -1); // str.slice('Symbol('.length, -')'.length);
if (desc) {
return desc;
}
return getSymbolDescription(this);
};
{
"name": "symbol.prototype.description",
"version": "1.0.0",
"version": "1.0.1",
"description": "Spec-compliant shim for Symbol.prototype.description proposal.",
"main": "index.js",
"scripts": {
"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)\")\"",
"prepublish": "safe-publish-latest",
"lint": "eslint .",
"postlint": "es-shim-api --bound --skip-shim-returns-polyfill",
"security": "nsp check",
"tests-only": "node test && node test/shimmed",
"pretest": "npm run lint",
"test": "npm run tests-only",
"posttest": "npm run security"
"posttest": "npx aud"
},

@@ -35,2 +37,3 @@ "repository": {

"dependencies": {
"es-abstract": "^1.16.0",
"has-symbols": "^1.0.0"

@@ -40,10 +43,17 @@ },

"@es-shims/api": "^2.1.2",
"@ljharb/eslint-config": "^12.2.1",
"eslint": "^4.16.0",
"nsp": "^3.1.0",
"tape": "^4.8.0"
"@ljharb/eslint-config": "^14.1.0",
"auto-changelog": "^1.16.1",
"eslint": "^6.5.1",
"safe-publish-latest": "^1.1.3",
"tape": "^4.11.0"
},
"engines": {
"node": ">= 0.12"
},
"auto-changelog": {
"output": "CHANGELOG.md",
"unreleased": false,
"commitLimit": false,
"backfillLimit": false
}
}

@@ -12,2 +12,3 @@ 'use strict';

}
var desc = gOPD(Symbol.prototype, 'description');

@@ -17,3 +18,6 @@ if (!desc || typeof desc.get !== 'function') {

}
if (typeof desc.get.call(Symbol()) !== 'undefined' || desc.get.call(Symbol()) !== '' || desc.get.call(Symbol('a')) !== 'a') {
var emptySymbolDesc = desc.get.call(Symbol());
var emptyDescValid = typeof emptySymbolDesc === 'undefined' || emptySymbolDesc === '';
if (!emptyDescValid || desc.get.call(Symbol('a')) !== 'a') {
return implementation;

@@ -20,0 +24,0 @@ }

@@ -5,3 +5,3 @@ 'use strict';

var polyfill = require('./polyfill');
var getInferredName = require('./helpers/getInferredName');
var getInferredName = require('es-abstract/helpers/getInferredName');

@@ -8,0 +8,0 @@ var gOPD = Object.getOwnPropertyDescriptor;

@@ -12,3 +12,3 @@ 'use strict';

var runTests = require('./tests');
var getInferredName = require('../helpers/getInferredName');
var getInferredName = require('es-abstract/helpers/getInferredName');

@@ -15,0 +15,0 @@ test('shimmed', function (t) {

'use strict';
var hasSymbols = require('has-symbols')();
var getInferredName = require('../helpers/getInferredName');
var getInferredName = require('es-abstract/helpers/getInferredName');

@@ -6,0 +6,0 @@ module.exports = function (description, t) {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc