Skip to content

Commit 9157490

Browse files
committed
feat(schema): Strand.isEmpty
1 parent 720419e commit 9157490

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

schema/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sourcemod-dev/schema",
3-
"version": "0.1.9",
3+
"version": "0.1.10",
44
"main": "dist/index.js",
55
"types": "dist/index.d.ts",
66
"files": [

schema/src/classes/bundle.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,19 @@ export class Strand implements IStrand, Searchable {
174174
}
175175
}
176176

177+
public isEmpty(): boolean {
178+
return (
179+
Object.keys(this.functions).length === 0 &&
180+
Object.keys(this.methodmaps).length === 0 &&
181+
Object.keys(this.enumstructs).length === 0 &&
182+
Object.keys(this.constants).length === 0 &&
183+
Object.keys(this.defines).length === 0 &&
184+
Object.keys(this.enums).length === 0 &&
185+
Object.keys(this.typesets).length === 0 &&
186+
Object.keys(this.typedefs).length === 0
187+
);
188+
}
189+
177190
private static mapFibers<T, F>(fibers: Record<string, T>, symbol: new (...args: any[]) => F): Record<string, F> {
178191
return Object.keys(fibers).reduce((acc, key) => {
179192
acc[key] = new symbol(fibers[key]);

0 commit comments

Comments
 (0)