@creately/array-chunk-by-size
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -0,1 +1,3 @@ | ||
require('fast-text-encoding'); | ||
/** | ||
@@ -45,3 +47,3 @@ * Chunk array of objects by their size when stringified into JSON | ||
const str = JSON.stringify(obj); | ||
return Buffer.byteLength(str, 'utf8'); | ||
return new TextEncoder().encode(str).length; | ||
} catch (error) { | ||
@@ -48,0 +50,0 @@ return 0; |
{ | ||
"name": "@creately/array-chunk-by-size", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"main": "index.js", | ||
@@ -31,3 +31,6 @@ "description": "Chunk array of objects by their size in JSON", | ||
"jest": "24.8.0" | ||
}, | ||
"dependencies": { | ||
"fast-text-encoding": "^1.0.0" | ||
} | ||
} |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a 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
2532
43
1
1
+ Addedfast-text-encoding@^1.0.0
+ Addedfast-text-encoding@1.0.6(transitive)