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 CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2020 Denis Seleznev, hcodes@yandex.ru
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
  [![NPM Version](https://img.shields.io/npm/v/isutf8.svg?style=flat)](https://www.npmjs.org/package/isutf8)
2
2
  [![NPM Downloads](https://img.shields.io/npm/dm/isutf8.svg?style=flat)](https://www.npmjs.org/package/isutf8)
3
- [![Dependency Status](https://img.shields.io/david/hcodes/isutf8.svg?style=flat)](https://david-dm.org/hcodes/isutf8)
3
+ [![Bundlephobia](https://badgen.net/bundlephobia/minzip/isutf8)](https://bundlephobia.com/result?p=isutf8)
4
+ [![install size](https://packagephobia.com/badge?p=isutf8)](https://packagephobia.com/result?p=isutf8)
4
5
 
5
6
  isutf8
6
7
  ======
@@ -2,5 +2,4 @@
2
2
  /**
3
3
  * Check if a Node.js Buffer or Uint8Array is UTF-8.
4
4
  */
5
- declare function isUtf8(buf?: Buffer | Uint8Array): boolean;
6
- export = isUtf8;
5
+ export default function isUtf8(buf?: Buffer | Uint8Array): boolean;
package/dist/index.esm.js CHANGED
@@ -25,8 +25,8 @@ function isUtf8(buf) {
25
25
  if (!buf) {
26
26
  return false;
27
27
  }
28
- let i = 0;
29
- const len = buf.length;
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 isUtf8;
79
+ export { isUtf8 as default };
package/dist/index.js CHANGED
@@ -27,8 +27,8 @@ function isUtf8(buf) {
27
27
  if (!buf) {
28
28
  return false;
29
29
  }
30
- let i = 0;
31
- const len = buf.length;
30
+ var i = 0;
31
+ var len = buf.length;
32
32
  while (i < len) {
33
33
  // UTF8-1 = %x00-7F
34
34
  if (buf[i] <= 0x7F) {
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 utf-8",
4
- "version": "3.1.1",
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": ">= 10.12.0"
28
+ "node": ">= 12"
29
29
  },
30
30
  "devDependencies": {
31
- "@rollup/plugin-typescript": "^6.0.0",
32
- "@types/jest": "^26.0.14",
33
- "@types/node": "^14.11.2",
34
- "@typescript-eslint/eslint-plugin": "^4.2.0",
35
- "@typescript-eslint/parser": "^4.2.0",
36
- "eslint": "^7.9.0",
37
- "jest": "^26.4.2",
38
- "rollup": "^2.28.1",
39
- "rollup-plugin-typescript": "^1.0.1",
40
- "ts-jest": "^26.4.0",
41
- "tslib": "^2.0.1",
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": "rm -rf dist",
46
+ "clean": "del-cli dist/*",
48
47
  "unit": "jest --config ./jest.config.js",
49
- "build": "npm run clean && npm run build:esm && npm run build:common",
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
- "types": "index.d.ts",
50
+ "typings": "dist/index.d.ts",
54
51
  "files": [
55
52
  "LICENSE",
56
53
  "README.md",
57
- "dist/index.js",
58
- "dist/index.esm.js",
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.