@@ -2,6 +2,7 @@ import * as $ from '../client/runtime.js';
2
2
import { is_promise , noop } from '../common.js' ;
3
3
import { subscribe_to_store } from '../../store/utils.js' ;
4
4
import { DOMBooleanAttributes } from '../../constants.js' ;
5
+ import { DEV } from 'esm-env' ;
5
6
6
7
export * from '../client/validate.js' ;
7
8
@@ -340,6 +341,10 @@ export function merge_styles(style_attribute, style_directive) {
340
341
* @returns {V }
341
342
*/
342
343
export function store_get ( store_values , store_name , store ) {
344
+ if ( DEV ) {
345
+ validate_store ( store , store_name . slice ( 1 ) ) ;
346
+ }
347
+
343
348
// it could be that someone eagerly updates the store in the instance script, so
344
349
// we should only reuse the store value in the template
345
350
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) {
356
361
return store_values [ store_name ] [ 2 ] ;
357
362
}
358
363
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
-
371
364
/**
372
365
* @param {any } store
373
366
* @param {string } name
0 commit comments