isutf8 4.0.0 → 4.0.1

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.
Files changed (3) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +10 -7
  3. package/package.json +21 -13
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2021 Denis Seleznev, hcodes@yandex.ru
3
+ Copyright (c) 2024 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
@@ -6,7 +6,12 @@
6
6
  isutf8
7
7
  ======
8
8
 
9
- Quick check if a Node.js Buffer or Uint8Array is UTF-8.
9
+ Quick check if a Node.js Buffer or Uint8Array is valid UTF-8.
10
+
11
+ ## Advantages
12
+ - Ultra-small package size
13
+ - No dependencies
14
+ - No pre-compilation
10
15
 
11
16
  ## Install
12
17
  `npm install isutf8`
@@ -15,17 +20,15 @@ Quick check if a Node.js Buffer or Uint8Array is UTF-8.
15
20
 
16
21
  ### CommonJS
17
22
  ```js
18
- 'use strict';
19
-
20
23
  const isUtf8 = require('isutf8');
21
24
 
22
25
  const buf = Buffer.from([0xd0, 0x90]);
23
- console.log(isUtf8(buf)); // => true
26
+ console.log(isUtf8(buf)); // => boolean
24
27
 
25
28
  // or
26
29
 
27
30
  const arr = new Uint8Array([0xd0, 0x90]);
28
- console.log(isUtf8(arr)); // => true
31
+ console.log(isUtf8(arr)); // => boolean
29
32
 
30
33
  ```
31
34
 
@@ -34,12 +37,12 @@ console.log(isUtf8(arr)); // => true
34
37
  import isUtf8 from 'isutf8';
35
38
 
36
39
  const buf = Buffer.from([0xd0, 0x90]);
37
- console.log(isUtf8(buf)); // => true
40
+ console.log(isUtf8(buf)); // => boolean
38
41
 
39
42
  // or
40
43
 
41
44
  const arr = new Uint8Array([0xd0, 0x90]);
42
- console.log(isUtf8(arr)); // => true
45
+ console.log(isUtf8(arr)); // => boolean
43
46
  ```
44
47
 
45
48
  ## License
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "isutf8",
3
3
  "description": "Check if a Node.js Buffer or Uint8Array is UTF-8",
4
- "version": "4.0.0",
4
+ "version": "4.0.1",
5
5
  "author": {
6
6
  "name": "Denis Seleznev",
7
7
  "email": "hcodes@yandex.ru",
@@ -18,8 +18,15 @@
18
18
  "keywords": [
19
19
  "charset",
20
20
  "utf-8",
21
+ "is utf",
22
+ "is utf-8",
23
+ "is utf8",
21
24
  "utf8",
25
+ "unicode",
26
+ "is unicode",
22
27
  "text",
28
+ "check",
29
+ "validate",
23
30
  "encoding",
24
31
  "Buffer",
25
32
  "Uint8Array"
@@ -28,24 +35,25 @@
28
35
  "node": ">= 12"
29
36
  },
30
37
  "devDependencies": {
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"
38
+ "@rollup/plugin-typescript": "^11.1.6",
39
+ "@types/jest": "^29.5.12",
40
+ "@typescript-eslint/eslint-plugin": "^8.3.0",
41
+ "@typescript-eslint/parser": "^8.3.0",
42
+ "del-cli": "^5.1.0",
43
+ "eslint": "^8.3.0",
44
+ "jest": "^29.7.0",
45
+ "rollup": "^4.21.1",
46
+ "ts-jest": "^29.2.5",
47
+ "tslib": "^2.7.0",
48
+ "typescript": "^5.5.4"
42
49
  },
43
50
  "scripts": {
44
51
  "test": "npm run eslint && npm run unit",
45
52
  "eslint": "eslint --ext .ts",
46
53
  "clean": "del-cli dist/*",
47
54
  "unit": "jest --config ./jest.config.js",
48
- "build": "npm run clean && rollup --config rollup.config.js"
55
+ "build": "npm run clean && rollup --config rollup.config.mjs",
56
+ "typecheck": "tsc --noEmit"
49
57
  },
50
58
  "typings": "dist/index.d.ts",
51
59
  "files": [