tangled
alpha
login
or
join now
atscan.net
/
plcbundle-bun
5
fork
atom
⚡ Zero-dependency plcbundle library exclusively for Bun
5
fork
atom
overview
issues
pulls
pipelines
update readme
tree.fail
4 months ago
523998b9
0356c8be
1/4
examples.yml
failed
3s
integration.yml
success
4s
lint.yml
failed
3s
test.yml
failed
3s
+16
-7
3 changed files
expand all
collapse all
unified
split
README.md
examples
detect.ts
package.json
+1
-1
README.md
reviewed
···
1
1
# plcbundle-bun
2
2
3
3
-
⚡ plcbundle library built exclusively for **[Bun](https://bun.sh)**.
3
3
+
⚡ [plcbundle](https://tangled.org/@atscan.net/plcbundle/blob/main/docs/specification.md) library built exclusively for **[Bun](https://bun.sh)**.
4
4
5
5
Leverages Bun's native features:
6
6
- 🗜️ Native `Bun.zstdDecompressSync()` - zero-copy decompression
+15
-3
examples/detect.ts
reviewed
···
1
1
/**
2
2
-
* Example detect function for use with plcbundle "detect" command
2
2
+
* Example detect function for filtering operations
3
3
+
*
4
4
+
* Usage:
5
5
+
* bun src/cli.ts detect --detect ./examples/detect.ts
3
6
*/
4
7
5
8
export function detect({ op }: { op: any }) {
6
9
const labels = [];
7
10
11
11
+
// Example: Detect test accounts
8
12
if (op.did.startsWith('did:plc:aa')) {
9
9
-
labels.push('test');
13
13
+
labels.push('test-account');
10
14
}
11
15
12
12
-
// Add your custom detection logic here
16
16
+
// Example: Detect by handle pattern
17
17
+
if (op.operation?.alsoKnownAs?.[0]?.includes('.test')) {
18
18
+
labels.push('test-handle');
19
19
+
}
20
20
+
21
21
+
// Example: Detect accounts created in 2024
22
22
+
if (op.createdAt?.startsWith('2024')) {
23
23
+
labels.push('created-2024');
24
24
+
}
13
25
14
26
return labels;
15
27
}
-3
package.json
reviewed
···
19
19
"test:coverage": "bun test --coverage",
20
20
"cli": "bun src/cli.ts"
21
21
},
22
22
-
"peerDependencies": {
23
23
-
"bun": ">=1.0.0"
24
24
-
},
25
22
"devDependencies": {
26
23
"@types/bun": "^1.3.1"
27
24
}