string-length
Advanced tools
Comparing version 2.0.0 to 3.0.0
@@ -5,2 +5,5 @@ 'use strict'; | ||
module.exports = input => stripAnsi(input).replace(astralRegex(), ' ').length; | ||
const stringLength = string => stripAnsi(string).replace(astralRegex(), ' ').length; | ||
module.exports = stringLength; | ||
module.exports.default = stringLength; |
{ | ||
"name": "string-length", | ||
"version": "2.0.0", | ||
"description": "Get the real length of a string - by correctly counting astral symbols and ignoring ansi escape codes", | ||
"license": "MIT", | ||
"repository": "sindresorhus/string-length", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=4" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava" | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"keywords": [ | ||
"unicode", | ||
"string", | ||
"length", | ||
"size", | ||
"count", | ||
"astral", | ||
"symbol", | ||
"surrogates", | ||
"codepoints", | ||
"ansi", | ||
"escape", | ||
"codes" | ||
], | ||
"dependencies": { | ||
"astral-regex": "^1.0.0", | ||
"strip-ansi": "^4.0.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "*", | ||
"xo": "*" | ||
} | ||
"name": "string-length", | ||
"version": "3.0.0", | ||
"description": "Get the real length of a string - by correctly counting astral symbols and ignoring ansi escape codes", | ||
"license": "MIT", | ||
"repository": "sindresorhus/string-length", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=8" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava && tsd-check" | ||
}, | ||
"files": [ | ||
"index.js", | ||
"index.d.ts" | ||
], | ||
"keywords": [ | ||
"unicode", | ||
"string", | ||
"length", | ||
"size", | ||
"count", | ||
"astral", | ||
"symbol", | ||
"surrogates", | ||
"codepoints", | ||
"ansi", | ||
"escape", | ||
"codes" | ||
], | ||
"dependencies": { | ||
"astral-regex": "^1.0.0", | ||
"strip-ansi": "^5.1.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "^1.3.1", | ||
"tsd-check": "^0.5.0", | ||
"xo": "^0.24.0" | ||
} | ||
} |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
3606
5
21
0
3
+ Addedansi-regex@4.1.1(transitive)
+ Addedstrip-ansi@5.2.0(transitive)
- Removedansi-regex@3.0.1(transitive)
- Removedstrip-ansi@4.0.0(transitive)
Updatedstrip-ansi@^5.1.0