es-value-fixtures
Advanced tools
Comparing version 1.2.1 to 1.3.0
@@ -8,2 +8,22 @@ # Changelog | ||
## [v1.3.0](https://github.com/ljharb/es-value-fixtures/compare/v1.2.1...v1.3.0) - 2022-04-24 | ||
### Commits | ||
- [actions] reuse common workflows [`daa6f95`](https://github.com/ljharb/es-value-fixtures/commit/daa6f95db55e20074a15133080236f15c415f23b) | ||
- [actions] use `node/install` instead of `node/run`; use `codecov` action [`82c5018`](https://github.com/ljharb/es-value-fixtures/commit/82c5018cb0d4b2caf01fed37b29a69c43ea6b0ad) | ||
- [New] add `wellKnownSymbols` [`09be804`](https://github.com/ljharb/es-value-fixtures/commit/09be804c27a7a20493b472407cdaaf0d363b76c3) | ||
- [actions] update codecov uploader [`36d3723`](https://github.com/ljharb/es-value-fixtures/commit/36d3723e5ffa71bf0cf9612bf2cec31a5d9ef36d) | ||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`012e579`](https://github.com/ljharb/es-value-fixtures/commit/012e57954f9998596f5edd72def66288b5c6fa6f) | ||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`c962990`](https://github.com/ljharb/es-value-fixtures/commit/c962990f6a43b4de55829248c00dc8bad40c377c) | ||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`750a189`](https://github.com/ljharb/es-value-fixtures/commit/750a189c98b1ca80bcb14bc9f50f5ede5c08cd70) | ||
- [meta] simplify "exports" [`3351b98`](https://github.com/ljharb/es-value-fixtures/commit/3351b9896bfbb08f2618a4cd64fcab2760e8bdc2) | ||
- [Deps] update `has-bigints`, `has-symbols` [`a2c65f4`](https://github.com/ljharb/es-value-fixtures/commit/a2c65f45bdf8f36f2af51ed04fcea7040cfe82e7) | ||
- [Dev Deps] update `eslint`, `tape` [`4502b8f`](https://github.com/ljharb/es-value-fixtures/commit/4502b8f87208bd0507da65992d4ceeab2bb14215) | ||
- [meta] use `prepublishOnly` script for npm 7+ [`4fd486b`](https://github.com/ljharb/es-value-fixtures/commit/4fd486b7111548be51e4f779cbbfd105c3f96981) | ||
- [Tests] sort fixture names before comparing [`4ef2d6b`](https://github.com/ljharb/es-value-fixtures/commit/4ef2d6b1a61676e4ea9e5e2b0b62358cb7d53adf) | ||
- [Dev Deps] update `@ljharb/eslint-config` [`4c0e3bc`](https://github.com/ljharb/es-value-fixtures/commit/4c0e3bcebc2128c2b56c0bdb28dfc3b6a7413298) | ||
- [Deps] update `has-symbols` [`a73b6cf`](https://github.com/ljharb/es-value-fixtures/commit/a73b6cf74497ee1a36e259d8431635af372a525b) | ||
- [Tests] fix omission from 8b85bae [`e71399c`](https://github.com/ljharb/es-value-fixtures/commit/e71399c77e28d609117a675f3a4d36e414bca7fa) | ||
## [v1.2.1](https://github.com/ljharb/es-value-fixtures/compare/v1.2.0...v1.2.1) - 2021-02-14 | ||
@@ -10,0 +30,0 @@ |
16
index.js
@@ -34,2 +34,17 @@ 'use strict'; | ||
var symbols = hasSymbols ? [Symbol.iterator, Symbol('foo')] : []; | ||
var wellKnownSymbols = hasSymbols ? [].concat( | ||
Symbol.iterator || [], | ||
Symbol.toStringTag || [], | ||
Symbol.hasInstance || [], | ||
Symbol.isConcatSpreadable || [], | ||
Symbol.asyncIterator || [], | ||
Symbol.match || [], | ||
Symbol.matchAll || [], | ||
Symbol.replace || [], | ||
Symbol.search || [], | ||
Symbol.species || [], | ||
Symbol.split || [], | ||
Symbol.toPrimitive || [], | ||
Symbol.unscopables || [] | ||
) : []; | ||
var bigints = hasBigInts ? [BigInt(42), BigInt(0)] : []; | ||
@@ -110,2 +125,3 @@ var nonSymbolPrimitives = [].concat(nullPrimitives, booleans, strings, numbers, bigints); | ||
symbols: symbols, | ||
wellKnownSymbols: wellKnownSymbols, | ||
timestamps: timestamps, | ||
@@ -112,0 +128,0 @@ toStringOnlyObject: toStringOnlyObject, |
{ | ||
"name": "es-value-fixtures", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "Fixtures of ES values, for testing purposes", | ||
"main": "index.js", | ||
"exports": { | ||
".": [ | ||
{ | ||
"default": "./index.js" | ||
}, | ||
"./index.js" | ||
], | ||
".": "./index.js", | ||
"./package.json": "./package.json" | ||
}, | ||
"scripts": { | ||
"prepublish": "not-in-publish || npm run prepublishOnly", | ||
"prepublishOnly": "safe-publish-latest", | ||
"lint": "eslint --ext=.js,.mjs .", | ||
@@ -49,15 +46,18 @@ "pretest": "npm run lint", | ||
"devDependencies": { | ||
"@ljharb/eslint-config": "^17.5.1", | ||
"aud": "^1.1.4", | ||
"auto-changelog": "^2.2.1", | ||
"eslint": "^7.20.0", | ||
"@ljharb/eslint-config": "^21.0.0", | ||
"array.prototype.flatmap": "^1.3.0", | ||
"aud": "^2.0.0", | ||
"auto-changelog": "^2.4.0", | ||
"eslint": "=8.8.0", | ||
"foreach": "^2.0.5", | ||
"isarray": "^2.0.5", | ||
"nyc": "^10.3.2", | ||
"object-keys": "^1.1.1", | ||
"tape": "^5.1.1" | ||
"reflect.ownkeys": "^1.1.0", | ||
"safe-publish-latest": "^2.0.0", | ||
"symbol.prototype.description": "^1.0.5", | ||
"tape": "^5.5.3" | ||
}, | ||
"dependencies": { | ||
"has-bigints": "^1.0.1", | ||
"has-symbols": "^1.0.1", | ||
"has-bigints": "^1.0.2", | ||
"has-symbols": "^1.0.3", | ||
"make-arrow-function": "^1.2.0", | ||
@@ -64,0 +64,0 @@ "make-async-function": "^1.0.0", |
@@ -6,5 +6,8 @@ 'use strict'; | ||
var test = require('tape'); | ||
var keys = require('object-keys'); | ||
var ownKeys = require('reflect.ownkeys'); | ||
var forEach = require('foreach'); | ||
var isArray = require('isarray'); | ||
var hasSymbols = require('has-symbols')(); | ||
var flatMap = require('array.prototype.flatmap'); | ||
var description = require('symbol.prototype.description'); | ||
@@ -23,3 +26,3 @@ function testItem(t, key, item) { | ||
if (key.slice(-'Object'.length) !== 'Object') { | ||
forEach(keys(item), function (itemKey) { | ||
forEach(ownKeys(item), function (itemKey) { | ||
testItem(t, key + '.' + itemKey, item[itemKey]); | ||
@@ -44,2 +47,3 @@ }); | ||
'nonArrays', | ||
'bigints', | ||
'nonBigInts', | ||
@@ -68,2 +72,3 @@ 'nonBooleans', | ||
'symbols', | ||
'wellKnownSymbols', | ||
'timestamps', | ||
@@ -85,3 +90,3 @@ 'toStringOnlyObject', | ||
t.deepEqual(keys(values), expected, 'has expected fixture names'); | ||
t.deepEqual(ownKeys(values).sort(), expected.sort(), 'has expected fixture names'); | ||
@@ -94,1 +99,15 @@ forEach(expected, function (key) { | ||
}); | ||
test('well-known symbols', { skip: !hasSymbols }, function (t) { | ||
var comparator = function (a, b) { | ||
return description(a).localeCompare(description(b)); | ||
}; | ||
var actual = flatMap(ownKeys(Symbol), function (k) { return typeof Symbol[k] === 'symbol' ? Symbol[k] : []; }); | ||
t.deepEqual( | ||
values.wellKnownSymbols.sort(comparator), | ||
actual.sort(comparator), | ||
'well-known symbols are accounted for' | ||
); | ||
t.end(); | ||
}); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18912
250
12
9
Updatedhas-bigints@^1.0.2
Updatedhas-symbols@^1.0.3