@e-mc/types 0.11.5 → 0.11.8
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/README.md +5 -5
- package/constant.d.ts +1 -1
- package/index.js +10 -5
- package/lib/filemanager.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
## Interface
|
|
11
11
|
|
|
12
|
-
* [View Source](https://www.unpkg.com/@e-mc/types@0.11.
|
|
12
|
+
* [View Source](https://www.unpkg.com/@e-mc/types@0.11.8/index.d.ts)
|
|
13
13
|
|
|
14
14
|
```typescript
|
|
15
15
|
import type { LogArguments } from "./lib/logger";
|
|
@@ -198,10 +198,10 @@ const IMPORT_MAP: Record<string, string | undefined>;
|
|
|
198
198
|
|
|
199
199
|
## References
|
|
200
200
|
|
|
201
|
-
- https://www.unpkg.com/@e-mc/types@0.11.
|
|
202
|
-
- https://www.unpkg.com/@e-mc/types@0.11.
|
|
203
|
-
- https://www.unpkg.com/@e-mc/types@0.11.
|
|
204
|
-
- https://www.unpkg.com/@e-mc/types@0.11.
|
|
201
|
+
- https://www.unpkg.com/@e-mc/types@0.11.8/index.d.ts
|
|
202
|
+
- https://www.unpkg.com/@e-mc/types@0.11.8/lib/logger.d.ts
|
|
203
|
+
- https://www.unpkg.com/@e-mc/types@0.11.8/lib/module.d.ts
|
|
204
|
+
- https://www.unpkg.com/@e-mc/types@0.11.8/lib/node.d.ts
|
|
205
205
|
|
|
206
206
|
* https://developer.mozilla.org/en-US/docs/Web/API/DOMException
|
|
207
207
|
* https://www.npmjs.com/package/@types/bytes
|
package/constant.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -356,7 +356,6 @@ function checkFlags(value, flags) {
|
|
|
356
356
|
return typeof value === 'number' && (value & flags) === flags;
|
|
357
357
|
}
|
|
358
358
|
const padStart = (value, char) => value > 9 ? value.toString() : char + value;
|
|
359
|
-
const convertScrypt = (key, iv, data) => crypto.scryptSync(key, iv, Math.ceil(data.length / 16) * 16);
|
|
360
359
|
const isFunction = (value) => typeof value === 'function';
|
|
361
360
|
var LOG_TYPE;
|
|
362
361
|
(function (LOG_TYPE) {
|
|
@@ -980,22 +979,28 @@ function getEncoding(value, fallback = 'utf-8') {
|
|
|
980
979
|
}
|
|
981
980
|
function encryptUTF8(algorithm, key, iv, data, encoding = 'hex') {
|
|
982
981
|
if (checkCipherType(algorithm) && isString(data)) {
|
|
982
|
+
let result;
|
|
983
983
|
try {
|
|
984
|
-
const gcm = crypto.createCipheriv(algorithm,
|
|
985
|
-
|
|
984
|
+
const gcm = crypto.createCipheriv(algorithm, crypto.scryptSync(key, iv, 32), iv);
|
|
985
|
+
result = gcm.update(data, 'utf8', encoding);
|
|
986
|
+
result += gcm.final(encoding);
|
|
986
987
|
}
|
|
987
988
|
catch {
|
|
988
989
|
}
|
|
990
|
+
return result;
|
|
989
991
|
}
|
|
990
992
|
}
|
|
991
993
|
function decryptUTF8(algorithm, key, iv, data, encoding = 'hex') {
|
|
992
994
|
if (checkCipherType(algorithm) && isString(data)) {
|
|
995
|
+
let result;
|
|
993
996
|
try {
|
|
994
|
-
const gcm = crypto.createDecipheriv(algorithm,
|
|
995
|
-
|
|
997
|
+
const gcm = crypto.createDecipheriv(algorithm, crypto.scryptSync(key, iv, 32), iv);
|
|
998
|
+
result = gcm.update(data, encoding, 'utf8');
|
|
999
|
+
result += gcm.final('utf8');
|
|
996
1000
|
}
|
|
997
1001
|
catch {
|
|
998
1002
|
}
|
|
1003
|
+
return result;
|
|
999
1004
|
}
|
|
1000
1005
|
}
|
|
1001
1006
|
function randomString(format, dictionary) {
|
package/lib/filemanager.d.ts
CHANGED
|
@@ -110,6 +110,7 @@ export interface FindAssetOptions<T extends ExternalAsset = ExternalAsset> {
|
|
|
110
110
|
|
|
111
111
|
export interface ChecksumOptions extends ReadHashOptions, Pick<ChecksumOutput, "include" | "exclude" | "recursive"> {
|
|
112
112
|
dot?: boolean;
|
|
113
|
+
matchBase?: boolean;
|
|
113
114
|
sortBy?: number;
|
|
114
115
|
verbose?: boolean;
|
|
115
116
|
ignore?: string[];
|