Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/svelte-cloudinary/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { VERSION as SVELTE_CLOUDINARY_VERSION } from './version';
import { VERSION as SVELTE_VERSION } from 'svelte/compiler';
import { VERSION as SVELTE_VERSION } from 'svelte';
import { setContext, getContext } from 'svelte';
import { klona } from './internal/klona';
import { defu } from 'defu';
Expand All @@ -10,7 +10,8 @@ import type {

const STORE_KEY = 'svelte-cloudinary-v2-config';

function normaliseVersion(version: string) {
function normaliseVersion(version?: string) {
if (!version) return '0.0.0';
return version.includes('-') ? version.split('-')[0] : version;
}

Expand Down
1 change: 1 addition & 0 deletions packages/svelte-cloudinary/tests/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ vi.mock('svelte', () => {
const context = new Map<string, any>();

return {
VERSION: '5.0.0-next.1',
getContext(key: string) {
return context.get(key);
},
Expand Down
Loading