string.prototype.trimleft
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -0,1 +1,16 @@ | ||
2.1.0 / 2019-09-09 | ||
================= | ||
* [New] add `auto` entry point | ||
* [Deps] update `function-bind`, `define-properties` | ||
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `covert`, `tape`, `@es-shims/api` | ||
* [meta] clean up scripts | ||
* [meta] Only apps should have lockfiles | ||
* [Tests] up to `node` `v12.10`, `v11.15`, `v10.16`, `v9.11`, `v8.16`, `v7.10`, `v6.17`, `v5.10`, `v4.9`; use `nvm install-latest-npm` | ||
* [Tests] allow a name of `trimLeft` or `trimStart` | ||
* [Tests] fix tests for the mongolian vowel separator | ||
* [Tests] use `functions-have-names` | ||
* [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops | ||
* [Tests] remove `jscs` | ||
* [Tests] use pretest/posttest for linting/security | ||
2.0.0 / 2016-02-06 | ||
@@ -2,0 +17,0 @@ ================= |
@@ -6,3 +6,5 @@ 'use strict'; | ||
/* eslint-disable no-control-regex */ | ||
var leftWhitespace = /^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]*/; | ||
/* eslint-enable no-control-regex */ | ||
@@ -9,0 +11,0 @@ module.exports = function trimLeft() { |
{ | ||
"name": "string.prototype.trimleft", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"author": "Jordan Harband", | ||
@@ -9,12 +9,10 @@ "description": "ES7 spec-compliant String.prototype.trimLeft shim.", | ||
"scripts": { | ||
"test": "npm run lint && es-shim-api --bound && npm run tests-only && npm run security", | ||
"tests-only": "npm run test:shimmed && npm run test:module", | ||
"test:shimmed": "node test/shimmed.js", | ||
"test:module": "node test/index.js", | ||
"pretest": "npm run lint && es-shim-api --bound", | ||
"test": "npm run tests-only", | ||
"posttest": "npx aud", | ||
"tests-only": "npm run --silent test:shimmed && npm run --silent test:module", | ||
"test:shimmed": "node test/shimmed", | ||
"test:module": "node test", | ||
"coverage": "covert test/*.js", | ||
"coverage-quiet": "covert test/*.js --quiet", | ||
"lint": "npm run jscs && npm run eslint", | ||
"eslint": "eslint test/*.js *.js", | ||
"jscs": "jscs test/*.js *.js", | ||
"security": "nsp check" | ||
"lint": "eslint ." | ||
}, | ||
@@ -37,13 +35,12 @@ "repository": { | ||
"dependencies": { | ||
"define-properties": "^1.1.2", | ||
"function-bind": "^1.0.2" | ||
"define-properties": "^1.1.3", | ||
"function-bind": "^1.1.1" | ||
}, | ||
"devDependencies": { | ||
"tape": "^4.4.0", | ||
"covert": "^1.1.0", | ||
"jscs": "^2.9.0", | ||
"nsp": "^2.2.0", | ||
"eslint": "^1.10.3", | ||
"@ljharb/eslint-config": "^1.6.1", | ||
"@es-shims/api": "^1.1.0" | ||
"@es-shims/api": "^2.1.2", | ||
"@ljharb/eslint-config": "^14.1.0", | ||
"covert": "^1.1.1", | ||
"eslint": "^6.3.0", | ||
"functions-have-names": "^1.1.1", | ||
"tape": "^4.11.0" | ||
}, | ||
@@ -50,0 +47,0 @@ "testling": { |
@@ -10,4 +10,4 @@ 'use strict'; | ||
t.test('bad array/this value', function (st) { | ||
st.throws(function () { trimLeft(undefined, 'a'); }, TypeError, 'undefined is not an object'); | ||
st.throws(function () { trimLeft(null, 'a'); }, TypeError, 'null is not an object'); | ||
st['throws'](function () { trimLeft(undefined, 'a'); }, TypeError, 'undefined is not an object'); | ||
st['throws'](function () { trimLeft(null, 'a'); }, TypeError, 'null is not an object'); | ||
st.end(); | ||
@@ -14,0 +14,0 @@ }); |
@@ -12,3 +12,3 @@ 'use strict'; | ||
var isEnumerable = Object.prototype.propertyIsEnumerable; | ||
var functionsHaveNames = function f() {}.name === 'f'; | ||
var functionsHaveNames = require('functions-have-names')(); | ||
@@ -18,3 +18,3 @@ test('shimmed', function (t) { | ||
t.test('Function name', { skip: !functionsHaveNames }, function (st) { | ||
st.equal(String.prototype.trimLeft.name, 'trimLeft', 'String#trimLeft has name "trimLeft"'); | ||
st.equal((/^(?:trimLeft|trimStart)$/).test(String.prototype.trimLeft.name), true, 'String#trimLeft has name "trimLeft" or "trimStart"'); | ||
st.end(); | ||
@@ -31,4 +31,4 @@ }); | ||
t.test('bad string/this value', { skip: !supportsStrictMode }, function (st) { | ||
st.throws(function () { return trimLeft(undefined, 'a'); }, TypeError, 'undefined is not an object'); | ||
st.throws(function () { return trimLeft(null, 'a'); }, TypeError, 'null is not an object'); | ||
st['throws'](function () { return trimLeft(undefined, 'a'); }, TypeError, 'undefined is not an object'); | ||
st['throws'](function () { return trimLeft(null, 'a'); }, TypeError, 'null is not an object'); | ||
st.end(); | ||
@@ -35,0 +35,0 @@ }); |
@@ -8,3 +8,3 @@ 'use strict'; | ||
var allWhitespaceChars = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; | ||
var allWhitespaceChars = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; | ||
st.equal(trimLeft(allWhitespaceChars + 'a' + allWhitespaceChars), 'a' + allWhitespaceChars, 'all expected whitespace chars are trimmed'); | ||
@@ -15,2 +15,9 @@ | ||
// see https://codeblog.jonskeet.uk/2014/12/01/when-is-an-identifier-not-an-identifier-attack-of-the-mongolian-vowel-separator/ | ||
var mongolianVowelSeparator = '\u180E'; | ||
t.test('unicode >= 4 && < 6.3', { skip: !(/^\s$/).test(mongolianVowelSeparator) }, function (st) { | ||
st.equal(trimLeft(mongolianVowelSeparator + 'a' + mongolianVowelSeparator), 'a' + mongolianVowelSeparator, 'mongolian vowel separator is whitespace'); | ||
st.end(); | ||
}); | ||
t.test('zero-width spaces', function (st) { | ||
@@ -17,0 +24,0 @@ var zeroWidth = '\u200b'; |
Sorry, the diff of this file is not supported yet
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
20487
6
110
Updateddefine-properties@^1.1.3
Updatedfunction-bind@^1.1.1