@hugoalh/adler32 0.6.2 → 0.7.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/cli.js +8 -15
- package/mod.d.ts +0 -10
- package/mod.d.ts.map +1 -1
- package/mod.js +0 -5
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -52,27 +52,20 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
|
|
|
52
52
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
53
53
|
});
|
|
54
54
|
import { constants as fsConstants, open as openFile } from "node:fs/promises";
|
|
55
|
-
import
|
|
55
|
+
import process from "node:process";
|
|
56
56
|
import { parseArgs, styleText } from "node:util";
|
|
57
57
|
import { Adler32 } from "./mod.js";
|
|
58
58
|
if (!import.meta.main) {
|
|
59
59
|
throw new Error(`This entrypoint is for command line only!`);
|
|
60
60
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
message = event.reason.message;
|
|
66
|
-
if ((event.reason.stack ?? "").length > 0) {
|
|
67
|
-
message += `\n${event.reason.stack}`;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
message = String(event.reason);
|
|
61
|
+
process.addListener("uncaughtException", (error) => {
|
|
62
|
+
let message = error.message;
|
|
63
|
+
if ((error.stack ?? "").length > 0) {
|
|
64
|
+
message += `\n${error.stack}`;
|
|
72
65
|
}
|
|
73
66
|
console.error(`${styleText(["red"], "ERROR", { validateStream: false })}\t${message}`);
|
|
74
|
-
exit(1);
|
|
75
|
-
}
|
|
67
|
+
process.exit(1);
|
|
68
|
+
});
|
|
76
69
|
const { positionals, values: { file: fromFile = false, stdin: fromStdin = false } } = parseArgs({
|
|
77
70
|
allowPositionals: true,
|
|
78
71
|
options: {
|
|
@@ -109,7 +102,7 @@ if (fromFile) {
|
|
|
109
102
|
}
|
|
110
103
|
}
|
|
111
104
|
else if (fromStdin) {
|
|
112
|
-
await instance.updateFromStream(stdin);
|
|
105
|
+
await instance.updateFromStream(process.stdin);
|
|
113
106
|
}
|
|
114
107
|
else {
|
|
115
108
|
instance.update(positionals[0]);
|
package/mod.d.ts
CHANGED
|
@@ -5,16 +5,6 @@ export type Adler32AcceptDataType = string | BigUint64Array | Uint8Array | Uint1
|
|
|
5
5
|
export declare class Adler32 {
|
|
6
6
|
#private;
|
|
7
7
|
get [Symbol.toStringTag](): string;
|
|
8
|
-
/**
|
|
9
|
-
* Initialize.
|
|
10
|
-
*/
|
|
11
|
-
constructor();
|
|
12
|
-
/**
|
|
13
|
-
* Initialize.
|
|
14
|
-
* @param {Adler32AcceptDataType} data Data.
|
|
15
|
-
* @deprecated Append data via the method {@linkcode Adler32.update} or {@linkcode Adler32.updateFromStream} instead.
|
|
16
|
-
*/
|
|
17
|
-
constructor(data: Adler32AcceptDataType);
|
|
18
8
|
/**
|
|
19
9
|
* Whether the instance is freezed.
|
|
20
10
|
* @returns {boolean}
|
package/mod.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["src/mod.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,qBAAqB,GAC9B,MAAM,GACN,cAAc,GACd,UAAU,GACV,WAAW,GACX,WAAW,CAAC;AACf;;GAEG;AACH,qBAAa,OAAO;;IACnB,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAEjC;IAMD
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["src/mod.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,qBAAqB,GAC9B,MAAM,GACN,cAAc,GACd,UAAU,GACV,WAAW,GACX,WAAW,CAAC;AACf;;GAEG;AACH,qBAAa,OAAO;;IACnB,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAEjC;IAMD;;;OAGG;IACH,IAAI,OAAO,IAAI,OAAO,CAErB;IACD;;;OAGG;IACH,MAAM,IAAI,IAAI;IAId;;;OAGG;IACH,IAAI,IAAI,UAAU;IAIlB;;;OAGG;IACH,OAAO,IAAI,MAAM;IAUjB;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,qBAAqB,GAAG,IAAI;IAazC;;;;OAIG;IACG,gBAAgB,CAAC,MAAM,EAAE,cAAc,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAMpF;AACD,eAAe,OAAO,CAAC"}
|
package/mod.js
CHANGED