Skip to content

Commit b2f38ed

Browse files
committed
chore: remove unneeded store_get_dev function
1 parent 49ad7f9 commit b2f38ed

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

packages/svelte/src/compiler/phases/3-transform/server/transform-server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ function serialize_get_binding(node, state) {
321321
if (binding.kind === 'store_sub') {
322322
const store_id = b.id(node.name.slice(1));
323323
return b.call(
324-
state.options.dev ? '$.store_get_dev' : '$.store_get',
324+
'$.store_get',
325325
b.id('$$store_subs'),
326326
b.literal(node.name),
327327
serialize_get_binding(store_id, state)

packages/svelte/src/internal/server/index.js

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as $ from '../client/runtime.js';
22
import { is_promise, noop } from '../common.js';
33
import { subscribe_to_store } from '../../store/utils.js';
44
import { DOMBooleanAttributes } from '../../constants.js';
5+
import { DEV } from 'esm-env';
56

67
export * from '../client/validate.js';
78

@@ -340,6 +341,10 @@ export function merge_styles(style_attribute, style_directive) {
340341
* @returns {V}
341342
*/
342343
export function store_get(store_values, store_name, store) {
344+
if (DEV) {
345+
validate_store(store, store_name.slice(1));
346+
}
347+
343348
// it could be that someone eagerly updates the store in the instance script, so
344349
// we should only reuse the store value in the template
345350
if (store_name in store_values && store_values[store_name][0] === store) {
@@ -356,18 +361,6 @@ export function store_get(store_values, store_name, store) {
356361
return store_values[store_name][2];
357362
}
358363

359-
/**
360-
* @template V
361-
* @param {Record<string, [any, any, any]>} store_values
362-
* @param {string} store_name
363-
* @param {import('../client/types.js').Store<V> | null | undefined} store
364-
* @returns {V}
365-
*/
366-
export function store_get_dev(store_values, store_name, store) {
367-
validate_store(store, store_name.slice(1));
368-
return store_get(store_values, store_name, store);
369-
}
370-
371364
/**
372365
* @param {any} store
373366
* @param {string} name

0 commit comments

Comments
 (0)