@@ -2,6 +2,7 @@ import * as $ from '../client/runtime.js';
22import { is_promise , noop } from '../common.js' ;
33import { subscribe_to_store } from '../../store/utils.js' ;
44import { DOMBooleanAttributes } from '../../constants.js' ;
5+ import { DEV } from 'esm-env' ;
56
67export * from '../client/validate.js' ;
78
@@ -340,6 +341,10 @@ export function merge_styles(style_attribute, style_directive) {
340341 * @returns {V }
341342 */
342343export 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