Socket
Socket
Sign inDemoInstall

get-symbol-description

Package Overview
Dependencies
12
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

25

CHANGELOG.md

@@ -8,2 +8,27 @@ # Changelog

## [v1.0.1](https://github.com/inspect-js/get-symbol-description/compare/v1.0.0...v1.0.1) - 2024-02-05
### Commits
- [actions] reuse common workflows [`168adf2`](https://github.com/inspect-js/get-symbol-description/commit/168adf213f86e5c69a93b4768a20ad543a70b231)
- [meta] use `npmignore` to autogenerate an npmignore file [`fa3b323`](https://github.com/inspect-js/get-symbol-description/commit/fa3b323f0605cf966a5cef1a103ada46d63e466b)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `es-value-fixtures`, `foreach`, `object-inspect`, `tape` [`9301b9e`](https://github.com/inspect-js/get-symbol-description/commit/9301b9e274fd9b7544af3d7d437dd254e83095e0)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `object-inspect`, `tape` [`a92a011`](https://github.com/inspect-js/get-symbol-description/commit/a92a0119f373fb61c58e3eb1d5fb6b3a3f66f157)
- [actions] update rebase action to use reusable workflow [`66cea29`](https://github.com/inspect-js/get-symbol-description/commit/66cea29835bc88ab5e937ccf996ea96409475a0e)
- [actions] update codecov uploader [`84079e1`](https://github.com/inspect-js/get-symbol-description/commit/84079e12e1421a79b63757cc3ab9c599e8eecc75)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `object-inspect`, `safe-publish-latest`, `tape` [`9f298a5`](https://github.com/inspect-js/get-symbol-description/commit/9f298a521e6f8a9b974b6b95e0b3de8aeaf74d9c)
- [Dev Deps] use `hasown` instead of `has` [`e993bd6`](https://github.com/inspect-js/get-symbol-description/commit/e993bd62a08a1adc2f75664be99a36e031ecf604)
- [Dev Deps] update `aud`, `npmignore`, `tape` [`5044bed`](https://github.com/inspect-js/get-symbol-description/commit/5044bed49a1b2b529b0c92fee0504747fda78147)
- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`3923eab`](https://github.com/inspect-js/get-symbol-description/commit/3923eabcf3eb2ddad7dbfd542102c29646dac242)
- [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`a24f5c5`](https://github.com/inspect-js/get-symbol-description/commit/a24f5c5f6ddd1f24b22ecdc2546eb9b06924f62a)
- [Deps] update `call-bind`, `get-intrinsic` [`accd484`](https://github.com/inspect-js/get-symbol-description/commit/accd484cb970c11fb39eb5ec4301572fa4043e37)
- [Dev Deps] update `object-inspect`, `tape` [`6c66623`](https://github.com/inspect-js/get-symbol-description/commit/6c666237114333bcb548e2c9ba6eb4924cb154ad)
- [Dev Deps] update `object-inspect`, `tape` [`586dfe3`](https://github.com/inspect-js/get-symbol-description/commit/586dfe35b9b6e7dba3fb7577c5973b7466d101a3)
- [Dev Deps] update `@ljharb/eslint-config`, `aud` [`bc8c7e0`](https://github.com/inspect-js/get-symbol-description/commit/bc8c7e0382682164f78b87f41764a0a2e389c435)
- [Tests] use `for-each` instead of `foreach` [`ca97918`](https://github.com/inspect-js/get-symbol-description/commit/ca97918eaad4ff1df11fd6f187da60227722dfcd)
- [Robustness] cache String slice [`5ce0c56`](https://github.com/inspect-js/get-symbol-description/commit/5ce0c5658224ed5cf5c6775a18ee2ad60c5b7ba8)
- [Deps] update `get-intrinsic` [`b656c5c`](https://github.com/inspect-js/get-symbol-description/commit/b656c5c68fbeec35d75a635ca991b61ed004bf54)
- [Deps] update `get-intrinsic` [`74cf3b6`](https://github.com/inspect-js/get-symbol-description/commit/74cf3b6525c49998f2c984d350e4d59d7f70794c)
- [meta] fix FUNDING.yml [`6cf76c8`](https://github.com/inspect-js/get-symbol-description/commit/6cf76c8c56bf366f767a84e82038db54b508641a)
## v1.0.0 - 2021-08-17

@@ -10,0 +35,0 @@

5

index.js

@@ -7,6 +7,7 @@ 'use strict';

var $SyntaxError = GetIntrinsic('%SyntaxError%');
var $SyntaxError = require('es-errors/syntax');
var getGlobalSymbolDescription = GetIntrinsic('%Symbol.keyFor%', true);
var thisSymbolValue = callBound('%Symbol.prototype.valueOf%', true);
var symToStr = callBound('Symbol.prototype.toString', true);
var $strSlice = callBound('String.prototype.slice');

@@ -40,3 +41,3 @@ var getInferredName = require('./getInferredName');

desc = symToStr(sym).slice(7, -1); // str.slice('Symbol('.length, -')'.length);
desc = $strSlice(symToStr(sym), 7, -1); // str.slice('Symbol('.length, -')'.length);
if (desc) {

@@ -43,0 +44,0 @@ return desc;

34

package.json
{
"name": "get-symbol-description",
"version": "1.0.0",
"version": "1.0.1",
"description": "Gets the description of a Symbol. Handles `Symbol()` vs `Symbol('')` properly when possible.",

@@ -12,2 +12,3 @@ "main": "index.js",

"scripts": {
"prepack": "npmignore --auto --commentLines=autogenerated",
"prepublish": "not-in-publish || npm run prepublishOnly",

@@ -44,18 +45,20 @@ "prepublishOnly": "safe-publish-latest",

"dependencies": {
"call-bind": "^1.0.2",
"get-intrinsic": "^1.1.1"
"call-bind": "^1.0.5",
"es-errors": "^1.3.0"
},
"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",
"@ljharb/eslint-config": "^21.1.0",
"aud": "^2.0.4",
"auto-changelog": "^2.4.0",
"es-value-fixtures": "^1.4.2",
"eslint": "=8.8.0",
"evalmd": "^0.0.19",
"foreach": "^2.0.5",
"has": "^1.0.3",
"for-each": "^0.3.3",
"hasown": "^2.0.0",
"in-publish": "^2.0.1",
"npmignore": "^0.3.1",
"nyc": "^10.3.2",
"object-inspect": "^1.11.0",
"safe-publish-latest": "^1.1.4",
"tape": "^5.3.1"
"object-inspect": "^1.13.1",
"safe-publish-latest": "^2.0.0",
"tape": "^5.7.4"
},

@@ -72,3 +75,8 @@ "engines": {

"hideCredit": true
},
"publishConfig": {
"ignore": [
".github/workflows"
]
}
}

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

var debug = require('object-inspect');
var forEach = require('foreach');
var has = require('has');
var forEach = require('for-each');
var hasOwn = require('hasown');
var v = require('es-value-fixtures');

@@ -49,3 +49,3 @@

st.test('only possible when inference or native `Symbol.prototype.description` is supported', {
skip: !getInferredName && !has(Symbol.prototype, 'description')
skip: !getInferredName && !hasOwn(Symbol.prototype, 'description')
}, function (s2t) {

@@ -58,3 +58,3 @@ s2t.equal(getSymbolDescription(Symbol('')), '', 'Symbol("") description is ""');

st.test('only possible when global symbols are supported', {
skip: !has(Symbol, 'for') || !has(Symbol, 'keyFor')
skip: !hasOwn(Symbol, 'for') || !hasOwn(Symbol, 'keyFor')
}, function (s2t) {

@@ -61,0 +61,0 @@ // eslint-disable-next-line no-restricted-properties

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc