@shelf/fast-chunk-string
Advanced tools
Comparing version 1.1.1 to 1.2.0
@@ -47,5 +47,6 @@ "use strict"; | ||
let o = 0; | ||
const runeChars = (0, _runes.default)(str); | ||
for (; i < numChunks; ++i, o += size) { | ||
chunks[i] = _runes.default.substr(str, o, size); | ||
chunks[i] = runeChars.slice(o, o + size).join(''); | ||
} | ||
@@ -52,0 +53,0 @@ |
{ | ||
"name": "@shelf/fast-chunk-string", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"description": "Chunk string into equal substrings with unicode support", | ||
@@ -14,15 +14,16 @@ "keywords": [ | ||
], | ||
"repository": "vladgolubev/fast-chunk-string", | ||
"repository": "shelfio/fast-chunk-string", | ||
"license": "MIT", | ||
"author": { | ||
"name": "Vlad Holubiev", | ||
"email": "golubev.vld@gmail.com", | ||
"url": "vladholubiev.com" | ||
"email": "vlad@shelf.io", | ||
"url": "https://shelf.io" | ||
}, | ||
"main": "lib", | ||
"types": "lib/index.d.ts", | ||
"files": [ | ||
"lib" | ||
], | ||
"main": "lib", | ||
"scripts": { | ||
"benchmark": "node benchmark", | ||
"benchmark": "babel benchmark.ts | node", | ||
"build": "rm -rf lib/ && yarn build:types && babel src --out-dir lib --ignore '**/*.test.ts' --extensions '.ts'", | ||
@@ -59,20 +60,22 @@ "build:types": "tsc --emitDeclarationOnly --declaration --isolatedModules false --declarationDir lib", | ||
"runes": "0.4.3", | ||
"string-length": "3.1.0" | ||
"string-length": "4.0.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "7.8.0", | ||
"@babel/core": "7.8.0", | ||
"@babel/preset-env": "7.8.2", | ||
"@babel/preset-typescript": "7.8.0", | ||
"@shelf/eslint-config": "0.13.0", | ||
"@types/jest": "24.0.25", | ||
"@types/node": "12", | ||
"@babel/cli": "7.10.5", | ||
"@babel/core": "7.11.1", | ||
"@babel/preset-env": "7.11.0", | ||
"@babel/preset-typescript": "7.10.4", | ||
"@shelf/eslint-config": "0.19.0", | ||
"@types/benchmark": "1.0.33", | ||
"@types/jest": "26.0.9", | ||
"@types/node": "12.12.28", | ||
"@types/runes": "0.4.1", | ||
"benchmark": "2.1.4", | ||
"eslint": "6.8.0", | ||
"fast-lorem-ipsum": "1.2.0", | ||
"husky": "3.1.0", | ||
"jest": "24.9.0", | ||
"lint-staged": "9.5.0", | ||
"husky": "4.2.5", | ||
"jest": "26.2.2", | ||
"lint-staged": "10.2.11", | ||
"prettier": "1.19.1", | ||
"typescript": "3.7.4" | ||
"typescript": "3.9.7" | ||
}, | ||
@@ -79,0 +82,0 @@ "engines": { |
@@ -1,2 +0,2 @@ | ||
# fast-chunk-string [![CircleCI](https://img.shields.io/circleci/project/shelfio/vladgolubev/fast-chunk-string.svg)](https://circleci.com/gh/vladgolubev/fast-chunk-string) | ||
# fast-chunk-string [![CircleCI](https://img.shields.io/circleci/project/shelfio/fast-chunk-string.svg)](https://circleci.com/gh/shelfio/fast-chunk-string) | ||
@@ -33,21 +33,30 @@ > Chunk string into equal substrings with unicode support | ||
Run via `yarn benchmark` | ||
Run via `yarn benchmark`. Measured on Macbook Pro 13" with M1 processor. | ||
``` | ||
~33 kb split by 2 kb x 1,246,204 ops/sec ±3.08% (75 runs sampled) | ||
~33 kb split by 1 mb x 8,349,993 ops/sec ±0.63% (90 runs sampled) | ||
~330 kb split by 2 kb x 155,141 ops/sec ±1.49% (81 runs sampled) | ||
~330 kb split by 1 mb x 8,311,089 ops/sec ±1.92% (83 runs sampled) | ||
~3.3 mb split by 2 kb x 15,827 ops/sec ±1.56% (86 runs sampled) | ||
~3.3 mb split by 1 mb x 3,741,173 ops/sec ±1.14% (87 runs sampled) | ||
~33 mb split by 2 kb x 1,579 ops/sec ±0.88% (84 runs sampled) | ||
~33 mb split by 1 mb x 738,667 ops/sec ±0.38% (88 runs sampled) | ||
~33 kb split by 2 kb with unicodeAware x 6.24 ops/sec ±2.67% (20 runs sampled) | ||
~33 kb split by 1 mb with unicodeAware x 95.48 ops/sec ±1.01% (67 runs sampled) | ||
~330 kb split by 2 kb with unicodeAware x 0.06 ops/sec ±5.09% (5 runs sampled) | ||
~330 kb split by 1 mb with unicodeAware x 8.34 ops/sec ±3.33% (25 runs sampled) | ||
~33 kb split by 2 kb x 8,902,281 ops/sec ±0.37% (97 runs sampled) | ||
~33 kb split by 1 mb x 100,872,434 ops/sec ±0.65% (92 runs sampled) | ||
~330 kb split by 2 kb x 1,009,220 ops/sec ±0.89% (95 runs sampled) | ||
~330 kb split by 1 mb x 97,087,201 ops/sec ±5.51% (90 runs sampled) | ||
~3.3 mb split by 2 kb x 102,498 ops/sec ±1.74% (97 runs sampled) | ||
~3.3 mb split by 1 mb x 33,719,853 ops/sec ±2.55% (94 runs sampled) | ||
~33 mb split by 2 kb x 9,953 ops/sec ±1.21% (95 runs sampled) | ||
~33 mb split by 1 mb x 4,976,079 ops/sec ±1.22% (94 runs sampled) | ||
~33 kb split by 2 kb with unicodeAware x 37.98 ops/sec ±0.16% (65 runs sampled) | ||
~33 kb split by 1 mb with unicodeAware x 355 ops/sec ±0.29% (89 runs sampled) | ||
~330 kb split by 2 kb with unicodeAware x 0.40 ops/sec ±1.19% (5 runs sampled) | ||
~330 kb split by 1 mb with unicodeAware x 34.99 ops/sec ±0.91% (61 runs sampled) | ||
``` | ||
## Publish | ||
```sh | ||
$ git checkout master | ||
$ yarn version | ||
$ yarn publish | ||
$ git push origin master --tags | ||
``` | ||
## License | ||
MIT © [Shelf](https://shelf.io) |
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
6548
46
62
17
+ Addedansi-regex@5.0.1(transitive)
+ Addedchar-regex@1.0.2(transitive)
+ Addedstring-length@4.0.0(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
- Removedansi-regex@4.1.1(transitive)
- Removedastral-regex@1.0.0(transitive)
- Removedstring-length@3.1.0(transitive)
- Removedstrip-ansi@5.2.0(transitive)
Updatedstring-length@4.0.0