Skip to content

Commit

Permalink
v0feat: added ability to replace context in the example shortcutConte…
Browse files Browse the repository at this point in the history
…xtParser
  • Loading branch information
AlansCodeLog committed May 19, 2024
1 parent 98ddb2c commit 634de6f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/examples/shortcutContextParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ export class ShortcutContextParser<T extends
this._extractKeysFromContext(dummyContext)
}

setContext(context: Record<string, any>): void {
this.validKeys = []
this._extractKeysFromContext(context)
}

private _extractKeysFromContext(context: Record<string, any>, prev?: string): void {
for (const key of Object.keys(context)) {
if (typeof context[key] === "boolean") {
Expand Down

0 comments on commit 634de6f

Please sign in to comment.