isutf8 3.1.1 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +2 -1
- package/{index.d.ts → dist/index.d.ts} +1 -2
- package/dist/index.esm.js +3 -3
- package/dist/index.js +2 -2
- package/package.json +19 -25
- package/CHANGELOG.md +0 -26
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2021 Denis Seleznev, hcodes@yandex.ru
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
[](https://www.npmjs.org/package/isutf8)
|
|
2
2
|
[](https://www.npmjs.org/package/isutf8)
|
|
3
|
-
[](https://bundlephobia.com/result?p=isutf8)
|
|
4
|
+
[](https://packagephobia.com/result?p=isutf8)
|
|
4
5
|
|
|
5
6
|
isutf8
|
|
6
7
|
======
|
package/dist/index.esm.js
CHANGED
|
@@ -25,8 +25,8 @@ function isUtf8(buf) {
|
|
|
25
25
|
if (!buf) {
|
|
26
26
|
return false;
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
var i = 0;
|
|
29
|
+
var len = buf.length;
|
|
30
30
|
while (i < len) {
|
|
31
31
|
// UTF8-1 = %x00-7F
|
|
32
32
|
if (buf[i] <= 0x7F) {
|
|
@@ -76,4 +76,4 @@ function isUtf8(buf) {
|
|
|
76
76
|
return true;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
export default
|
|
79
|
+
export { isUtf8 as default };
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isutf8",
|
|
3
|
-
"description": "Check if a Node.js Buffer or Uint8Array is
|
|
4
|
-
"version": "
|
|
3
|
+
"description": "Check if a Node.js Buffer or Uint8Array is UTF-8",
|
|
4
|
+
"version": "4.0.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Denis Seleznev",
|
|
7
7
|
"email": "hcodes@yandex.ru",
|
|
@@ -25,38 +25,32 @@
|
|
|
25
25
|
"Uint8Array"
|
|
26
26
|
],
|
|
27
27
|
"engines": {
|
|
28
|
-
"node": ">=
|
|
28
|
+
"node": ">= 12"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@rollup/plugin-typescript": "^
|
|
32
|
-
"@types/jest": "^
|
|
33
|
-
"@
|
|
34
|
-
"@typescript-eslint/
|
|
35
|
-
"
|
|
36
|
-
"eslint": "^
|
|
37
|
-
"jest": "^
|
|
38
|
-
"rollup": "^2.
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"typescript": "^4.0.3"
|
|
31
|
+
"@rollup/plugin-typescript": "^8.3.0",
|
|
32
|
+
"@types/jest": "^27.0.2",
|
|
33
|
+
"@typescript-eslint/eslint-plugin": "^5.2.0",
|
|
34
|
+
"@typescript-eslint/parser": "^5.2.0",
|
|
35
|
+
"del-cli": "^4.0.1",
|
|
36
|
+
"eslint": "^8.1.0",
|
|
37
|
+
"jest": "^27.3.1",
|
|
38
|
+
"rollup": "^2.58.3",
|
|
39
|
+
"ts-jest": "^27.0.7",
|
|
40
|
+
"tslib": "^2.3.1",
|
|
41
|
+
"typescript": "^4.4.4"
|
|
43
42
|
},
|
|
44
43
|
"scripts": {
|
|
45
44
|
"test": "npm run eslint && npm run unit",
|
|
46
45
|
"eslint": "eslint --ext .ts",
|
|
47
|
-
"clean": "
|
|
46
|
+
"clean": "del-cli dist/*",
|
|
48
47
|
"unit": "jest --config ./jest.config.js",
|
|
49
|
-
"build": "npm run clean &&
|
|
50
|
-
"build:esm": "rollup src/index.ts --config rollup.config.js --file dist/index.esm.js --format esm",
|
|
51
|
-
"build:common": "rollup src/index.ts --config rollup.config.js --file dist/index.js --format commonjs --exports=auto"
|
|
48
|
+
"build": "npm run clean && rollup --config rollup.config.js"
|
|
52
49
|
},
|
|
53
|
-
"
|
|
50
|
+
"typings": "dist/index.d.ts",
|
|
54
51
|
"files": [
|
|
55
52
|
"LICENSE",
|
|
56
53
|
"README.md",
|
|
57
|
-
"dist
|
|
58
|
-
|
|
59
|
-
"index.d.ts"
|
|
60
|
-
],
|
|
61
|
-
"dependencies": {}
|
|
54
|
+
"dist"
|
|
55
|
+
]
|
|
62
56
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
# Changelog
|
|
3
|
-
|
|
4
|
-
## v3.1.1
|
|
5
|
-
- Fixes for typings.
|
|
6
|
-
|
|
7
|
-
## v3.1.0
|
|
8
|
-
- Add support for ES modules.
|
|
9
|
-
|
|
10
|
-
## v3.0.0
|
|
11
|
-
- Add typings for TypeScript.
|
|
12
|
-
- Drop support for old Node.js < 10.
|
|
13
|
-
|
|
14
|
-
## v2.1.0
|
|
15
|
-
- Add support for `Uint8Array`.
|
|
16
|
-
- Updated dev deps in package.json.
|
|
17
|
-
|
|
18
|
-
## v2.0.4
|
|
19
|
-
- Updated dev deps in package.json.
|
|
20
|
-
|
|
21
|
-
## v2.0.3
|
|
22
|
-
- Updated dev deps in package.json.
|
|
23
|
-
|
|
24
|
-
## v2.0.2
|
|
25
|
-
- Added package-lock.json.
|
|
26
|
-
- Updated the example in README.md.
|