Skip to content

Commit 8d5c2a1

Browse files
Split into sub modules
1 parent d830b03 commit 8d5c2a1

4 files changed

Lines changed: 21 additions & 13 deletions

File tree

deno.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,16 @@
33
"version": "0.0.0",
44
"license": "MIT",
55
"exports": {
6-
".": "./mod.ts"
6+
".": "./mod.ts",
7+
"./CommonCrypto": "./CommonCrypto/mod.ts",
8+
"./kern": "./kern/mod.ts",
9+
"./libc": "./libc/mod.ts",
10+
"./mach": "./mach/mod.ts",
11+
"./mach-o": "./mach-o/mod.ts",
12+
"./MacOSX": "./MacOSX/mod.ts",
13+
"./Security": "./Security/mod.ts",
14+
"./struct": "./struct/mod.ts",
15+
"./util": "./util/mod.ts"
716
},
817
"imports": {
918
"@deno/dnt": "jsr:@deno/dnt@^0.42.3",

mod.test.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,18 @@ const ext = `.${file.split('.').at(-1)!}`;
1717

1818
const exports = (() => {
1919
let r;
20+
const exclude = new Set([
21+
'./struct',
22+
]);
23+
const filter = ([k, _]: [string, string]) => !exclude.has(k);
2024
return (): Promise<[string, Exports][]> =>
2125
r ??= Promise.all(
22-
Object.entries(deno.exports).map(async ([name, path]) => [
23-
name,
24-
await import(`${dir}/${path.replace(/\.ts$/, ext)}`),
25-
]),
26+
Object.entries(deno.exports).filter(filter).map(
27+
async ([name, path]) => [
28+
name,
29+
await import(`${dir}/${path.replace(/\.ts$/, ext)}`),
30+
],
31+
),
2632
);
2733
})();
2834

mod.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +0,0 @@
1-
export * from './CommonCrypto/mod.ts';
2-
export * from './kern/mod.ts';
3-
export * from './libc/mod.ts';
4-
export * from './mach/mod.ts';
5-
export * from './mach-o/mod.ts';
6-
export * from './MacOSX/mod.ts';
7-
export * from './Security/mod.ts';
8-
export * from './util/mod.ts';

struct/mod.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from '@hqtsm/struct';

0 commit comments

Comments
 (0)