diff options
| author | Priyansh <[email protected]> | 2020-12-22 17:50:12 +0530 |
|---|---|---|
| committer | Priyansh <[email protected]> | 2020-12-22 17:50:12 +0530 |
| commit | 22dc033f4938d6a19e086a1cbd36ec5cade5eaab (patch) | |
| tree | 9feb963ccd5c1581e676e41004801abc67db3357 /node_modules/utf8-byte-length | |
| parent | e93da8b04da86773247aadb1cbb1912e4f4526b2 (diff) | |
| download | styx-22dc033f4938d6a19e086a1cbd36ec5cade5eaab.tar.xz styx-22dc033f4938d6a19e086a1cbd36ec5cade5eaab.zip | |
Remove node_modules
Diffstat (limited to 'node_modules/utf8-byte-length')
| -rw-r--r-- | node_modules/utf8-byte-length/.gitmodules | 3 | ||||
| -rw-r--r-- | node_modules/utf8-byte-length/.npmignore | 1 | ||||
| -rw-r--r-- | node_modules/utf8-byte-length/.travis.yml | 12 | ||||
| -rw-r--r-- | node_modules/utf8-byte-length/AUTHORS | 2 | ||||
| -rw-r--r-- | node_modules/utf8-byte-length/README.md | 28 | ||||
| -rw-r--r-- | node_modules/utf8-byte-length/browser.js | 47 | ||||
| -rw-r--r-- | node_modules/utf8-byte-length/index.js | 8 | ||||
| -rw-r--r-- | node_modules/utf8-byte-length/package.json | 64 | ||||
| -rw-r--r-- | node_modules/utf8-byte-length/test.js | 67 |
9 files changed, 0 insertions, 232 deletions
diff --git a/node_modules/utf8-byte-length/.gitmodules b/node_modules/utf8-byte-length/.gitmodules deleted file mode 100644 index d496220..0000000 --- a/node_modules/utf8-byte-length/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "vendor/big-list-of-naughty-strings"] - path = vendor/big-list-of-naughty-strings - url = https://github.com/minimaxir/big-list-of-naughty-strings.git diff --git a/node_modules/utf8-byte-length/.npmignore b/node_modules/utf8-byte-length/.npmignore deleted file mode 100644 index 48b8bf9..0000000 --- a/node_modules/utf8-byte-length/.npmignore +++ /dev/null @@ -1 +0,0 @@ -vendor/ diff --git a/node_modules/utf8-byte-length/.travis.yml b/node_modules/utf8-byte-length/.travis.yml deleted file mode 100644 index 1e25a8c..0000000 --- a/node_modules/utf8-byte-length/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: node_js -node_js: - - "0.10" - - "0.12" - - "1" - - "2" - - "3" - - "4" - - "5" - - "node" -before_install: - - npm install -g npm diff --git a/node_modules/utf8-byte-length/AUTHORS b/node_modules/utf8-byte-length/AUTHORS deleted file mode 100644 index 6212900..0000000 --- a/node_modules/utf8-byte-length/AUTHORS +++ /dev/null @@ -1,2 +0,0 @@ -Carl Xiong <[email protected]> -Parsha Pourkhomami <[email protected]> diff --git a/node_modules/utf8-byte-length/README.md b/node_modules/utf8-byte-length/README.md deleted file mode 100644 index a232c12..0000000 --- a/node_modules/utf8-byte-length/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# utf8-byte-length [](http://travis-ci.org/parshap/utf8-byte-length) - -Get the utf8 byte length of a string, taking into account multi-byte -characters and surrogate pairs. - -By default, this module defers to `Buffer.byteLength`. A browser -implementation is also provided that doesn't use `Buffer.byteLength` -minimize build size. - -## Example - -```js -var getLength = require("utf8-byte-length") -console.log(truncate("a☃", 2)) // a = 1 byte, ☃ = 3 bytes -// -> 4 -``` - -## API - -### `var getLength = require("utf8-byte-length")` - -*When using browserify or webpack*, this automatically resolves to an -implementation that does not use `Buffer.byteLength`. - -### `getLength(string)` - -Returns the byte length of `string`. Throws an error if `string` is not -a string. diff --git a/node_modules/utf8-byte-length/browser.js b/node_modules/utf8-byte-length/browser.js deleted file mode 100644 index a093731..0000000 --- a/node_modules/utf8-byte-length/browser.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -function isHighSurrogate(codePoint) { - return codePoint >= 0xd800 && codePoint <= 0xdbff; -} - -function isLowSurrogate(codePoint) { - return codePoint >= 0xdc00 && codePoint <= 0xdfff; -} - -// Truncate string by size in bytes -module.exports = function getByteLength(string) { - if (typeof string !== "string") { - throw new Error("Input must be string"); - } - - var charLength = string.length; - var byteLength = 0; - var codePoint = null; - var prevCodePoint = null; - for (var i = 0; i < charLength; i++) { - codePoint = string.charCodeAt(i); - // handle 4-byte non-BMP chars - // low surrogate - if (isLowSurrogate(codePoint)) { - // when parsing previous hi-surrogate, 3 is added to byteLength - if (prevCodePoint != null && isHighSurrogate(prevCodePoint)) { - byteLength += 1; - } - else { - byteLength += 3; - } - } - else if (codePoint <= 0x7f ) { - byteLength += 1; - } - else if (codePoint >= 0x80 && codePoint <= 0x7ff) { - byteLength += 2; - } - else if (codePoint >= 0x800 && codePoint <= 0xffff) { - byteLength += 3; - } - prevCodePoint = codePoint; - } - - return byteLength; -}; diff --git a/node_modules/utf8-byte-length/index.js b/node_modules/utf8-byte-length/index.js deleted file mode 100644 index 921ea6a..0000000 --- a/node_modules/utf8-byte-length/index.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; - -module.exports = function getByteLength(string) { - if (typeof string !== "string") { - throw new Error("Input must be string"); - } - return Buffer.byteLength(string, "utf8"); -}; diff --git a/node_modules/utf8-byte-length/package.json b/node_modules/utf8-byte-length/package.json deleted file mode 100644 index 9d7c019..0000000 --- a/node_modules/utf8-byte-length/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "_from": "utf8-byte-length@^1.0.1", - "_id": "[email protected]", - "_inBundle": false, - "_integrity": "sha1-9F8VDExm7uloGGUFq5P8u4rWv2E=", - "_location": "/utf8-byte-length", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "utf8-byte-length@^1.0.1", - "name": "utf8-byte-length", - "escapedName": "utf8-byte-length", - "rawSpec": "^1.0.1", - "saveSpec": null, - "fetchSpec": "^1.0.1" - }, - "_requiredBy": [ - "/truncate-utf8-bytes" - ], - "_resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz", - "_shasum": "f45f150c4c66eee968186505ab93fcbb8ad6bf61", - "_spec": "utf8-byte-length@^1.0.1", - "_where": "/Users/lucifer/Documents/styx/node_modules/truncate-utf8-bytes", - "author": { - "name": "Carl Xiong", - "email": "[email protected]" - }, - "browser": "browser.js", - "bugs": { - "url": "https://github.com/parshap/utf8-byte-length/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Carl Xiong", - "email": "[email protected]" - }, - { - "name": "Parsha Pourkhomami", - "email": "[email protected]" - } - ], - "deprecated": false, - "description": "Get utf8 byte length of string", - "devDependencies": { - "tape": "^4.2.2" - }, - "homepage": "https://github.com/parshap/utf8-byte-length#readme", - "keywords": [ - "utf8" - ], - "license": "WTFPL", - "main": "index.js", - "name": "utf8-byte-length", - "repository": { - "type": "git", - "url": "git+https://github.com/parshap/utf8-byte-length.git" - }, - "scripts": { - "test": "tape test.js" - }, - "version": "1.0.4" -} diff --git a/node_modules/utf8-byte-length/test.js b/node_modules/utf8-byte-length/test.js deleted file mode 100644 index 4f3cdbc..0000000 --- a/node_modules/utf8-byte-length/test.js +++ /dev/null @@ -1,67 +0,0 @@ -"use strict"; - -var test = require("tape"); -var getLength = require("./index"); -var browserGetLength = require("./browser"); - -function repeat(string, times) { - return new Array(times + 1).join(string); -} - -// Test writing files to the fs -// - -try { - var blns = require("./vendor/big-list-of-naughty-strings/blns.json"); -} -catch (err) { - console.error("Error: Cannot load file './vendor/big-list-of-naughty-strings/blns.json'"); - console.error(); - console.error("Make sure you've initialized git submodules by running"); - console.error(); - console.error(" git submodule update --init"); - console.error(); - process.exit(1); -} - - -// 8-byte, 4-character string -var THUMB = "👍🏽"; - -// Tests run against both implementations -[getLength, browserGetLength].forEach(function(getLength) { - // Strings with known lengths - [ - ["", 0], - ["a", 1], - ["☃", 3], - ["a☃", 4], - [repeat("a", 250) + '\uD800\uDC00', 254], - [repeat("a", 251) + '\uD800\uDC00', 255], - [repeat("a", 252) + '\uD800\uDC00', 256], - [THUMB, 8], - [THUMB[0], 3], - [THUMB[1], 3], - [THUMB[2], 3], - [THUMB[3], 3], - [THUMB.slice(0, 2), 4], - [THUMB.slice(2, 4), 4], - [THUMB.slice(1, 3), 6], - ].forEach(function(desc) { - var string = desc[0]; - var length = desc[1]; - test(JSON.stringify(string) + "=" + length, function(t) { - t.equal(getLength(string), length); - t.end(); - }); - }); - - // Make sure result matches Buffer.byteLength for various strings - blns.forEach(function(str) { - test(JSON.stringify(str), function(t) { - t.equal(getLength(str), Buffer.byteLength(str)); - t.end(); - }); - }); -}); - |
