@wtasnorg/node-lib 0.0.8 → 0.0.9
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/changelog.txt +12 -0
- package/docs/README.md +10 -0
- package/docs/docs.json +570 -137
- package/docs/functions/createFindDirectories.md +1 -1
- package/docs/functions/decode.md +49 -0
- package/docs/functions/encode.md +45 -0
- package/docs/functions/hello.md +1 -1
- package/docs/functions/parseUserAgent.md +1 -1
- package/docs/functions/pojo.md +1 -1
- package/docs/interfaces/FileSystemDependencies.md +3 -3
- package/docs/interfaces/FindDirectoriesOptions.md +5 -5
- package/docs/interfaces/UserAgentInfo.md +6 -6
- package/docs/type-aliases/Base64CharsetType.md +13 -0
- package/docs/variables/Base64Charset.md +17 -0
- package/gen-docs/001_base64_refine.txt +50 -0
- package/gen-sec/001_base64_security.txt +75 -0
- package/package.json +1 -1
- package/readme.txt +1 -0
- package/src/base64.d.ts +58 -0
- package/src/base64.js +138 -0
- package/src/base64.test.d.ts +2 -0
- package/src/base64.test.js +106 -0
- package/src/base64.test.ts +125 -0
- package/src/base64.ts +163 -0
- package/src/index.d.ts +4 -2
- package/src/index.js +2 -1
- package/src/index.ts +7 -1
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { describe, it } from "node:test";
|
|
2
|
+
import { strictEqual, throws } from "node:assert";
|
|
3
|
+
import { encode, decode, Base64Charset } from "./base64.js";
|
|
4
|
+
describe("Base64 encode", () => {
|
|
5
|
+
it("encodes empty string", () => {
|
|
6
|
+
strictEqual(encode(""), "");
|
|
7
|
+
});
|
|
8
|
+
it("encodes 'Hello, World!' with standard charset", () => {
|
|
9
|
+
strictEqual(encode("Hello, World!"), "SGVsbG8sIFdvcmxkIQ==");
|
|
10
|
+
});
|
|
11
|
+
it("encodes single character", () => {
|
|
12
|
+
strictEqual(encode("A"), "QQ==");
|
|
13
|
+
});
|
|
14
|
+
it("encodes two characters (padding test)", () => {
|
|
15
|
+
strictEqual(encode("AB"), "QUI=");
|
|
16
|
+
});
|
|
17
|
+
it("encodes three characters (no padding)", () => {
|
|
18
|
+
strictEqual(encode("ABC"), "QUJD");
|
|
19
|
+
});
|
|
20
|
+
it("encodes with urlsafe charset", () => {
|
|
21
|
+
// Bytes that produce +/ in standard: 0xfb, 0xef, 0xbe -> ++/+
|
|
22
|
+
const input = "\xfb\xef\xbe";
|
|
23
|
+
const standard = encode(input, "standard");
|
|
24
|
+
const urlsafe = encode(input, "urlsafe");
|
|
25
|
+
// standard uses + and /, urlsafe uses - and _
|
|
26
|
+
strictEqual(standard.includes("+") || standard.includes("/"), true);
|
|
27
|
+
strictEqual(urlsafe.includes("+"), false);
|
|
28
|
+
strictEqual(urlsafe.includes("/"), false);
|
|
29
|
+
});
|
|
30
|
+
it("encodes with imap charset", () => {
|
|
31
|
+
// imap uses , instead of /
|
|
32
|
+
const input = "\xff\xff";
|
|
33
|
+
const standard = encode(input, "standard");
|
|
34
|
+
const imap = encode(input, "imap");
|
|
35
|
+
strictEqual(imap.includes(",") || !imap.includes("/"), true);
|
|
36
|
+
strictEqual(standard !== imap || !standard.includes("/"), true);
|
|
37
|
+
});
|
|
38
|
+
it("encodes UTF-8 characters", () => {
|
|
39
|
+
const input = "こんにちは";
|
|
40
|
+
const encoded = encode(input);
|
|
41
|
+
const decoded = decode(encoded);
|
|
42
|
+
strictEqual(decoded, input);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
describe("Base64 decode", () => {
|
|
46
|
+
it("decodes empty string", () => {
|
|
47
|
+
strictEqual(decode(""), "");
|
|
48
|
+
});
|
|
49
|
+
it("decodes 'SGVsbG8sIFdvcmxkIQ==' to 'Hello, World!'", () => {
|
|
50
|
+
strictEqual(decode("SGVsbG8sIFdvcmxkIQ=="), "Hello, World!");
|
|
51
|
+
});
|
|
52
|
+
it("decodes single character padded", () => {
|
|
53
|
+
strictEqual(decode("QQ=="), "A");
|
|
54
|
+
});
|
|
55
|
+
it("decodes two characters padded", () => {
|
|
56
|
+
strictEqual(decode("QUI="), "AB");
|
|
57
|
+
});
|
|
58
|
+
it("decodes three characters (no padding)", () => {
|
|
59
|
+
strictEqual(decode("QUJD"), "ABC");
|
|
60
|
+
});
|
|
61
|
+
it("throws on invalid character", () => {
|
|
62
|
+
throws(() => decode("!!!"), /Invalid Base64 character/);
|
|
63
|
+
});
|
|
64
|
+
it("decodes without padding characters", () => {
|
|
65
|
+
strictEqual(decode("SGVsbG8sIFdvcmxkIQ"), "Hello, World!");
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
describe("Base64 round-trip", () => {
|
|
69
|
+
const testCases = [
|
|
70
|
+
"",
|
|
71
|
+
"a",
|
|
72
|
+
"ab",
|
|
73
|
+
"abc",
|
|
74
|
+
"abcd",
|
|
75
|
+
"Hello, World!",
|
|
76
|
+
"The quick brown fox jumps over the lazy dog",
|
|
77
|
+
"こんにちは世界",
|
|
78
|
+
"🎉🚀✨",
|
|
79
|
+
"\x00\x01\x02\xff"
|
|
80
|
+
];
|
|
81
|
+
for (const charset of Base64Charset) {
|
|
82
|
+
describe(`charset: ${charset}`, () => {
|
|
83
|
+
for (const input of testCases) {
|
|
84
|
+
it(`round-trips: ${JSON.stringify(input)}`, () => {
|
|
85
|
+
const encoded = encode(input, charset);
|
|
86
|
+
const decoded = decode(encoded, charset);
|
|
87
|
+
strictEqual(decoded, input);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
describe("Base64Charset", () => {
|
|
94
|
+
it("exports array with four charsets", () => {
|
|
95
|
+
strictEqual(Base64Charset.length, 4);
|
|
96
|
+
strictEqual(Base64Charset[0], "standard");
|
|
97
|
+
strictEqual(Base64Charset[1], "urlsafe");
|
|
98
|
+
strictEqual(Base64Charset[2], "imap");
|
|
99
|
+
strictEqual(Base64Charset[3], "radix64");
|
|
100
|
+
});
|
|
101
|
+
it("charset type works correctly", () => {
|
|
102
|
+
const cs = "urlsafe";
|
|
103
|
+
strictEqual(encode("test", cs), encode("test", "urlsafe"));
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
//# sourceMappingURL=base64.test.js.map
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { describe, it } from "node:test";
|
|
2
|
+
import { strictEqual, throws } from "node:assert";
|
|
3
|
+
import { encode, decode, Base64Charset } from "./base64.js";
|
|
4
|
+
import type { Base64CharsetType } from "./base64.js";
|
|
5
|
+
|
|
6
|
+
describe("Base64 encode", () => {
|
|
7
|
+
it("encodes empty string", () => {
|
|
8
|
+
strictEqual(encode(""), "");
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it("encodes 'Hello, World!' with standard charset", () => {
|
|
12
|
+
strictEqual(encode("Hello, World!"), "SGVsbG8sIFdvcmxkIQ==");
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it("encodes single character", () => {
|
|
16
|
+
strictEqual(encode("A"), "QQ==");
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("encodes two characters (padding test)", () => {
|
|
20
|
+
strictEqual(encode("AB"), "QUI=");
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it("encodes three characters (no padding)", () => {
|
|
24
|
+
strictEqual(encode("ABC"), "QUJD");
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("encodes with urlsafe charset", () => {
|
|
28
|
+
// Bytes that produce +/ in standard: 0xfb, 0xef, 0xbe -> ++/+
|
|
29
|
+
const input = "\xfb\xef\xbe";
|
|
30
|
+
const standard = encode(input, "standard");
|
|
31
|
+
const urlsafe = encode(input, "urlsafe");
|
|
32
|
+
// standard uses + and /, urlsafe uses - and _
|
|
33
|
+
strictEqual(standard.includes("+") || standard.includes("/"), true);
|
|
34
|
+
strictEqual(urlsafe.includes("+"), false);
|
|
35
|
+
strictEqual(urlsafe.includes("/"), false);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it("encodes with imap charset", () => {
|
|
39
|
+
// imap uses , instead of /
|
|
40
|
+
const input = "\xff\xff";
|
|
41
|
+
const standard = encode(input, "standard");
|
|
42
|
+
const imap = encode(input, "imap");
|
|
43
|
+
strictEqual(imap.includes(",") || !imap.includes("/"), true);
|
|
44
|
+
strictEqual(standard !== imap || !standard.includes("/"), true);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it("encodes UTF-8 characters", () => {
|
|
48
|
+
const input = "こんにちは";
|
|
49
|
+
const encoded = encode(input);
|
|
50
|
+
const decoded = decode(encoded);
|
|
51
|
+
strictEqual(decoded, input);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
describe("Base64 decode", () => {
|
|
56
|
+
it("decodes empty string", () => {
|
|
57
|
+
strictEqual(decode(""), "");
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it("decodes 'SGVsbG8sIFdvcmxkIQ==' to 'Hello, World!'", () => {
|
|
61
|
+
strictEqual(decode("SGVsbG8sIFdvcmxkIQ=="), "Hello, World!");
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it("decodes single character padded", () => {
|
|
65
|
+
strictEqual(decode("QQ=="), "A");
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it("decodes two characters padded", () => {
|
|
69
|
+
strictEqual(decode("QUI="), "AB");
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it("decodes three characters (no padding)", () => {
|
|
73
|
+
strictEqual(decode("QUJD"), "ABC");
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it("throws on invalid character", () => {
|
|
77
|
+
throws(() => decode("!!!"), /Invalid Base64 character/);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it("decodes without padding characters", () => {
|
|
81
|
+
strictEqual(decode("SGVsbG8sIFdvcmxkIQ"), "Hello, World!");
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
describe("Base64 round-trip", () => {
|
|
86
|
+
const testCases = [
|
|
87
|
+
"",
|
|
88
|
+
"a",
|
|
89
|
+
"ab",
|
|
90
|
+
"abc",
|
|
91
|
+
"abcd",
|
|
92
|
+
"Hello, World!",
|
|
93
|
+
"The quick brown fox jumps over the lazy dog",
|
|
94
|
+
"こんにちは世界",
|
|
95
|
+
"🎉🚀✨",
|
|
96
|
+
"\x00\x01\x02\xff"
|
|
97
|
+
];
|
|
98
|
+
|
|
99
|
+
for (const charset of Base64Charset) {
|
|
100
|
+
describe(`charset: ${charset}`, () => {
|
|
101
|
+
for (const input of testCases) {
|
|
102
|
+
it(`round-trips: ${JSON.stringify(input)}`, () => {
|
|
103
|
+
const encoded = encode(input, charset);
|
|
104
|
+
const decoded = decode(encoded, charset);
|
|
105
|
+
strictEqual(decoded, input);
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
describe("Base64Charset", () => {
|
|
113
|
+
it("exports array with four charsets", () => {
|
|
114
|
+
strictEqual(Base64Charset.length, 4);
|
|
115
|
+
strictEqual(Base64Charset[0], "standard");
|
|
116
|
+
strictEqual(Base64Charset[1], "urlsafe");
|
|
117
|
+
strictEqual(Base64Charset[2], "imap");
|
|
118
|
+
strictEqual(Base64Charset[3], "radix64");
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
it("charset type works correctly", () => {
|
|
122
|
+
const cs: Base64CharsetType = "urlsafe";
|
|
123
|
+
strictEqual(encode("test", cs), encode("test", "urlsafe"));
|
|
124
|
+
});
|
|
125
|
+
});
|
package/src/base64.ts
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base64 encoding/decoding with multiple charset variants.
|
|
3
|
+
* @module base64
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Available Base64 charset variants.
|
|
8
|
+
* - `standard`: RFC 4648 standard alphabet (A-Z, a-z, 0-9, +, /)
|
|
9
|
+
* - `urlsafe`: URL and filename safe (A-Z, a-z, 0-9, -, _)
|
|
10
|
+
* - `imap`: Modified Base64 for IMAP mailbox names (A-Z, a-z, 0-9, +, ,)
|
|
11
|
+
* - `radix64`: Base64 variant used in OpenPGP (A-Z, a-z, 0-9, +, /)
|
|
12
|
+
*/
|
|
13
|
+
const Base64Charset = ["standard", "urlsafe", "imap", "radix64"] as const;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Base64 charset type.
|
|
17
|
+
*/
|
|
18
|
+
type Base64CharsetType = (typeof Base64Charset)[number];
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Charset alphabets for Base64 variants.
|
|
22
|
+
*/
|
|
23
|
+
const CHARSETS: Record<Base64CharsetType, string> = {
|
|
24
|
+
standard: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
|
|
25
|
+
urlsafe: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",
|
|
26
|
+
imap: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+,",
|
|
27
|
+
radix64: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Padding character for Base64 encoding.
|
|
32
|
+
*/
|
|
33
|
+
const PAD = "=";
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Build a reverse lookup table for decoding.
|
|
37
|
+
* @param alphabet - The 64-character alphabet string.
|
|
38
|
+
* @returns Map of character to index.
|
|
39
|
+
*/
|
|
40
|
+
function buildDecodeTable(alphabet: string): Map<string, number> {
|
|
41
|
+
const table = new Map<string, number>();
|
|
42
|
+
for (let i = 0; i < alphabet.length; i++) {
|
|
43
|
+
const char = alphabet[i];
|
|
44
|
+
if (char !== undefined) {
|
|
45
|
+
table.set(char, i);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return table;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Pre-built decode tables for each charset.
|
|
53
|
+
*/
|
|
54
|
+
const DECODE_TABLES: Record<Base64CharsetType, Map<string, number>> = {
|
|
55
|
+
standard: buildDecodeTable(CHARSETS.standard),
|
|
56
|
+
urlsafe: buildDecodeTable(CHARSETS.urlsafe),
|
|
57
|
+
imap: buildDecodeTable(CHARSETS.imap),
|
|
58
|
+
radix64: buildDecodeTable(CHARSETS.radix64)
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Encode a string to Base64.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* import { encode } from "./base64.js";
|
|
67
|
+
*
|
|
68
|
+
* encode("Hello, World!");
|
|
69
|
+
* // => "SGVsbG8sIFdvcmxkIQ=="
|
|
70
|
+
*
|
|
71
|
+
* encode("Hello, World!", "urlsafe");
|
|
72
|
+
* // => "SGVsbG8sIFdvcmxkIQ=="
|
|
73
|
+
* ```
|
|
74
|
+
*
|
|
75
|
+
* @param input - The string to encode.
|
|
76
|
+
* @param charset - The charset variant to use (default: "standard").
|
|
77
|
+
* @returns The Base64 encoded string.
|
|
78
|
+
*/
|
|
79
|
+
function encode(input: string, charset: Base64CharsetType = "standard"): string {
|
|
80
|
+
const alphabet = CHARSETS[charset];
|
|
81
|
+
const bytes = new TextEncoder().encode(input);
|
|
82
|
+
let result = "";
|
|
83
|
+
|
|
84
|
+
for (let i = 0; i < bytes.length; i += 3) {
|
|
85
|
+
const b0 = bytes[i] ?? 0;
|
|
86
|
+
const b1 = i + 1 < bytes.length ? (bytes[i + 1] ?? 0) : 0;
|
|
87
|
+
const b2 = i + 2 < bytes.length ? (bytes[i + 2] ?? 0) : 0;
|
|
88
|
+
|
|
89
|
+
const triple = (b0 << 16) | (b1 << 8) | b2;
|
|
90
|
+
|
|
91
|
+
result += alphabet[(triple >> 18) & 0x3f];
|
|
92
|
+
result += alphabet[(triple >> 12) & 0x3f];
|
|
93
|
+
result += i + 1 < bytes.length ? alphabet[(triple >> 6) & 0x3f] : PAD;
|
|
94
|
+
result += i + 2 < bytes.length ? alphabet[triple & 0x3f] : PAD;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return result;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Decode a Base64 string.
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```typescript
|
|
105
|
+
* import { decode } from "./base64.js";
|
|
106
|
+
*
|
|
107
|
+
* decode("SGVsbG8sIFdvcmxkIQ==");
|
|
108
|
+
* // => "Hello, World!"
|
|
109
|
+
*
|
|
110
|
+
* decode("SGVsbG8sIFdvcmxkIQ==", "standard");
|
|
111
|
+
* // => "Hello, World!"
|
|
112
|
+
* ```
|
|
113
|
+
*
|
|
114
|
+
* @param input - The Base64 encoded string.
|
|
115
|
+
* @param charset - The charset variant to use (default: "standard").
|
|
116
|
+
* @returns The decoded string.
|
|
117
|
+
* @throws Error if the input contains invalid characters.
|
|
118
|
+
*/
|
|
119
|
+
function decode(input: string, charset: Base64CharsetType = "standard"): string {
|
|
120
|
+
const decodeTable = DECODE_TABLES[charset];
|
|
121
|
+
|
|
122
|
+
// Remove padding
|
|
123
|
+
const cleanInput = input.replace(/=+$/, "");
|
|
124
|
+
const bytes: number[] = [];
|
|
125
|
+
|
|
126
|
+
for (let i = 0; i < cleanInput.length; i += 4) {
|
|
127
|
+
const c0 = cleanInput[i];
|
|
128
|
+
const c1 = cleanInput[i + 1];
|
|
129
|
+
const c2 = cleanInput[i + 2];
|
|
130
|
+
const c3 = cleanInput[i + 3];
|
|
131
|
+
|
|
132
|
+
if (c0 === undefined) {
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const v0 = decodeTable.get(c0);
|
|
137
|
+
const v1 = c1 !== undefined ? decodeTable.get(c1) : 0;
|
|
138
|
+
const v2 = c2 !== undefined ? decodeTable.get(c2) : 0;
|
|
139
|
+
const v3 = c3 !== undefined ? decodeTable.get(c3) : 0;
|
|
140
|
+
|
|
141
|
+
if (v0 === undefined) {
|
|
142
|
+
throw new Error(`Invalid Base64 character: ${c0}`);
|
|
143
|
+
}
|
|
144
|
+
if (c1 !== undefined && v1 === undefined) {
|
|
145
|
+
throw new Error(`Invalid Base64 character: ${c1}`);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const triple = ((v0 ?? 0) << 18) | ((v1 ?? 0) << 12) | ((v2 ?? 0) << 6) | (v3 ?? 0);
|
|
149
|
+
|
|
150
|
+
bytes.push((triple >> 16) & 0xff);
|
|
151
|
+
if (c2 !== undefined) {
|
|
152
|
+
bytes.push((triple >> 8) & 0xff);
|
|
153
|
+
}
|
|
154
|
+
if (c3 !== undefined) {
|
|
155
|
+
bytes.push(triple & 0xff);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
return new TextDecoder().decode(new Uint8Array(bytes));
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export { encode, decode, Base64Charset };
|
|
163
|
+
export type { Base64CharsetType };
|
package/src/index.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ import type { FindDirectoriesOptions, FileSystemDependencies } from "./find.js";
|
|
|
4
4
|
import { createFindDirectories } from "./find.js";
|
|
5
5
|
import type { UserAgentInfo } from "./user-agent.js";
|
|
6
6
|
import { parseUserAgent } from "./user-agent.js";
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
import type { Base64CharsetType } from "./base64.js";
|
|
8
|
+
import { encode, decode, Base64Charset } from "./base64.js";
|
|
9
|
+
export { hello, pojo, createFindDirectories, parseUserAgent, encode, decode, Base64Charset };
|
|
10
|
+
export type { FindDirectoriesOptions, FileSystemDependencies, UserAgentInfo, Base64CharsetType };
|
|
9
11
|
//# sourceMappingURL=index.d.ts.map
|
package/src/index.js
CHANGED
|
@@ -2,5 +2,6 @@ import { hello } from "./hello.js";
|
|
|
2
2
|
import { pojo } from "./pojo.js";
|
|
3
3
|
import { createFindDirectories } from "./find.js";
|
|
4
4
|
import { parseUserAgent } from "./user-agent.js";
|
|
5
|
-
|
|
5
|
+
import { encode, decode, Base64Charset } from "./base64.js";
|
|
6
|
+
export { hello, pojo, createFindDirectories, parseUserAgent, encode, decode, Base64Charset };
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
package/src/index.ts
CHANGED
|
@@ -4,16 +4,22 @@ import type { FindDirectoriesOptions, FileSystemDependencies } from "./find.js";
|
|
|
4
4
|
import { createFindDirectories } from "./find.js";
|
|
5
5
|
import type { UserAgentInfo } from "./user-agent.js";
|
|
6
6
|
import { parseUserAgent } from "./user-agent.js";
|
|
7
|
+
import type { Base64CharsetType } from "./base64.js";
|
|
8
|
+
import { encode, decode, Base64Charset } from "./base64.js";
|
|
7
9
|
|
|
8
10
|
export {
|
|
9
11
|
hello,
|
|
10
12
|
pojo,
|
|
11
13
|
createFindDirectories,
|
|
12
|
-
parseUserAgent
|
|
14
|
+
parseUserAgent,
|
|
15
|
+
encode,
|
|
16
|
+
decode,
|
|
17
|
+
Base64Charset
|
|
13
18
|
};
|
|
14
19
|
|
|
15
20
|
export type {
|
|
16
21
|
FindDirectoriesOptions,
|
|
17
22
|
FileSystemDependencies,
|
|
18
23
|
UserAgentInfo,
|
|
24
|
+
Base64CharsetType
|
|
19
25
|
};
|