@e280/stz 0.2.22 → 0.2.23
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/package.json +1 -1
- package/s/data/txt.ts +11 -16
- package/x/data/txt.d.ts +8 -16
- package/x/data/txt.js +11 -16
- package/x/data/txt.js.map +1 -1
package/package.json
CHANGED
package/s/data/txt.ts
CHANGED
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
return new TextDecoder().decode(bytes)
|
|
5
|
-
},
|
|
2
|
+
const fromBytes = (bytes: Uint8Array) => new TextDecoder().decode(bytes)
|
|
3
|
+
const toBytes = (string: string): Uint8Array => new TextEncoder().encode(string)
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
export function txt(bytes: Uint8Array) {
|
|
6
|
+
return fromBytes(bytes)
|
|
7
|
+
}
|
|
8
|
+
txt.fromBytes = fromBytes
|
|
9
|
+
txt.toBytes = toBytes
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return txt.fromBytes(bytes)
|
|
14
|
-
},
|
|
11
|
+
/** @deprecated renamed to `fromBytes` */
|
|
12
|
+
txt.string = txt.fromBytes
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return txt.toBytes(string)
|
|
19
|
-
},
|
|
20
|
-
})
|
|
14
|
+
/** @deprecated renamed to `toBytes` */
|
|
15
|
+
txt.bytes = txt.toBytes
|
|
21
16
|
|
|
22
17
|
/** @deprecated renamed to `txt` */
|
|
23
18
|
export const Txt = txt
|
package/x/data/txt.d.ts
CHANGED
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
string(bytes: Uint8Array)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}>;
|
|
1
|
+
export declare function txt(bytes: Uint8Array): string;
|
|
2
|
+
export declare namespace txt {
|
|
3
|
+
var fromBytes: (bytes: Uint8Array) => string;
|
|
4
|
+
var toBytes: (string: string) => Uint8Array;
|
|
5
|
+
var string: (bytes: Uint8Array) => string;
|
|
6
|
+
var bytes: (string: string) => Uint8Array;
|
|
7
|
+
}
|
|
9
8
|
/** @deprecated renamed to `txt` */
|
|
10
|
-
export declare const Txt:
|
|
11
|
-
fromBytes(bytes: Uint8Array): string;
|
|
12
|
-
toBytes(string: string): Uint8Array;
|
|
13
|
-
/** @deprecated renamed to `fromBytes` */
|
|
14
|
-
string(bytes: Uint8Array): string;
|
|
15
|
-
/** @deprecated renamed to `toBytes` */
|
|
16
|
-
bytes(string: string): Uint8Array<ArrayBufferLike>;
|
|
17
|
-
}>;
|
|
9
|
+
export declare const Txt: typeof txt;
|
package/x/data/txt.js
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/** @deprecated renamed to `toBytes` */
|
|
13
|
-
bytes(string) {
|
|
14
|
-
return txt.toBytes(string);
|
|
15
|
-
},
|
|
16
|
-
});
|
|
1
|
+
const fromBytes = (bytes) => new TextDecoder().decode(bytes);
|
|
2
|
+
const toBytes = (string) => new TextEncoder().encode(string);
|
|
3
|
+
export function txt(bytes) {
|
|
4
|
+
return fromBytes(bytes);
|
|
5
|
+
}
|
|
6
|
+
txt.fromBytes = fromBytes;
|
|
7
|
+
txt.toBytes = toBytes;
|
|
8
|
+
/** @deprecated renamed to `fromBytes` */
|
|
9
|
+
txt.string = txt.fromBytes;
|
|
10
|
+
/** @deprecated renamed to `toBytes` */
|
|
11
|
+
txt.bytes = txt.toBytes;
|
|
17
12
|
/** @deprecated renamed to `txt` */
|
|
18
13
|
export const Txt = txt;
|
|
19
14
|
//# sourceMappingURL=txt.js.map
|
package/x/data/txt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"txt.js","sourceRoot":"","sources":["../../s/data/txt.ts"],"names":[],"mappings":"AACA,MAAM,
|
|
1
|
+
{"version":3,"file":"txt.js","sourceRoot":"","sources":["../../s/data/txt.ts"],"names":[],"mappings":"AACA,MAAM,SAAS,GAAG,CAAC,KAAiB,EAAE,EAAE,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AACxE,MAAM,OAAO,GAAG,CAAC,MAAc,EAAc,EAAE,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;AAEhF,MAAM,UAAU,GAAG,CAAC,KAAiB;IACpC,OAAO,SAAS,CAAC,KAAK,CAAC,CAAA;AACxB,CAAC;AACD,GAAG,CAAC,SAAS,GAAG,SAAS,CAAA;AACzB,GAAG,CAAC,OAAO,GAAG,OAAO,CAAA;AAErB,yCAAyC;AACzC,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,SAAS,CAAA;AAE1B,uCAAuC;AACvC,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,OAAO,CAAA;AAEvB,mCAAmC;AACnC,MAAM,CAAC,MAAM,GAAG,GAAG,GAAG,CAAA"}
|