Skip to content

Commit 720419e

Browse files
committed
fix(schema): symbol lookup mutation
1 parent d150956 commit 720419e

2 files changed

Lines changed: 4 additions & 4 deletions

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.8",
3+
"version": "0.1.9",
44
"main": "dist/index.js",
55
"types": "dist/index.d.ts",
66
"files": [

schema/src/classes/bundle.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ export class Bundle implements IBundle, Searchable {
4848
return (await Promise.all(ret)).flat();
4949
}
5050

51-
public getSymbolByPath(path: string[]): ClassSymbol {
51+
public getSymbolByPath(p: readonly string[]): ClassSymbol {
5252
// Currently only supports class symbols, individual parts are not supported
53-
path = path.splice(0, 3);
53+
const path = p.slice(0, 3);
5454

5555
const strand: Strand = this.strands[path[0]];
5656

@@ -108,7 +108,7 @@ export class Strand implements IStrand, Searchable {
108108
return (await Promise.all(ret)).flat().filter(e => e.score > 0.5);
109109
}
110110

111-
public getSymbolByPath(p: string[]): ClassSymbol {
111+
public getSymbolByPath(p: readonly string[]): ClassSymbol {
112112
const path = p.filter(e => {
113113
// Ignore Enum entries, as it's not a dedicated symbol
114114
return e.includes('.') || [

0 commit comments

Comments
 (0)