diff --git a/src/plug.ts b/src/plug.ts index a61f492b..0129d36b 100644 --- a/src/plug.ts +++ b/src/plug.ts @@ -373,15 +373,12 @@ export class GlobalPlug implements Plug { slotId: I, options: FetchOptions = {}, ): Promise> => { - const [id, version] = slotId.split('@') as [string, `${number}` | 'latest' | undefined]; + const [id, version = 'latest'] = slotId.split('@') as [string, `${number}` | 'latest' | undefined]; const logger = this.sdk.getLogger(); return this.sdk .contentFetcher - .fetch>(id, { - ...options, - version: version === 'latest' ? undefined : version, - }) + .fetch>(id, version === 'latest' ? options : {...options, version: version}) .then( response => ({ get payload(): SlotContent {