diff --git a/src/lib/internals.ts b/src/lib/internals.ts index d4843ad..92d1154 100644 --- a/src/lib/internals.ts +++ b/src/lib/internals.ts @@ -28,7 +28,7 @@ function transformKeyOption(key: StorageKey): string[] { key = [key]; } - return key.map((token: string | StateClass) => { + return key.map((token: string | StateClass | StateToken) => { if (typeof token === 'string') { return token; } else if (token instanceof StateToken) { @@ -36,6 +36,11 @@ function transformKeyOption(key: StorageKey): string[] { } const options = (token as any)[META_OPTIONS_KEY]; + + if (options.name instanceof StateToken) { + return options.name.getName(); + } + return options.name; }); }