Skip to content

Commit e5aa112

Browse files
committed
fix docs and add sanitizeScope fallback
1 parent d194c79 commit e5aa112

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Example usage:
7777
```typescript
7878
import { FileSystem } from "mmrl";
7979

80-
const fs = new FileSystem();
80+
const fs = new FileSystem("net-switch");
8181
fs.write("example.txt", "Hello, MMRL!");
8282
const content = fs.read("example.txt");
8383
console.log(content);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mmrl",
3-
"version": "0.2.22",
3+
"version": "0.2.23",
44
"description": "A library to make your life easier when working with MMRL's WebUI",
55
"source": "src/index.ts",
66
"main": "dist/index.cjs.js",

src/util/AccessorScope.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,14 @@ export const AccessorScope = {
2323

2424
parseScope(scope: ObjectScope): object {
2525
if (typeof scope === "string") {
26-
return window[`$${this.sanitizeScope(scope)}`];
26+
const sanitizedScope = window[`$${this.sanitizeScope(scope)}`];
27+
const unsanitizedScope = window[`$${scope}`];
28+
29+
if (typeof sanitizedScope !== "undefined") {
30+
return sanitizedScope;
31+
} else {
32+
return unsanitizedScope;
33+
}
2734
}
2835

2936
return scope;

0 commit comments

Comments
 (0)