@@ -1166,26 +1166,26 @@ export function deep_read(value, visited = new Set()) {
1166
1166
}
1167
1167
1168
1168
/**
1169
- * Like `unstate `, but recursively traverses into normal arrays/objects to find potential states in them.
1169
+ * Like `snapshot `, but recursively traverses into normal arrays/objects to find potential states in them.
1170
1170
* @param {any } value
1171
1171
* @param {Map<any, any> } visited
1172
1172
* @returns {any }
1173
1173
*/
1174
- function deep_unstate ( value , visited = new Map ( ) ) {
1174
+ function deep_snapshot ( value , visited = new Map ( ) ) {
1175
1175
if ( typeof value === 'object' && value !== null && ! visited . has ( value ) ) {
1176
1176
const unstated = snapshot ( value ) ;
1177
1177
if ( unstated !== value ) {
1178
1178
visited . set ( value , unstated ) ;
1179
1179
return unstated ;
1180
1180
}
1181
1181
const prototype = get_prototype_of ( value ) ;
1182
- // Only deeply unstate plain objects and arrays
1182
+ // Only deeply snapshot plain objects and arrays
1183
1183
if ( prototype === object_prototype || prototype === array_prototype ) {
1184
1184
let contains_unstated = false ;
1185
1185
/** @type {any } */
1186
1186
const nested_unstated = Array . isArray ( value ) ? [ ] : { } ;
1187
1187
for ( let key in value ) {
1188
- const result = deep_unstate ( value [ key ] , visited ) ;
1188
+ const result = deep_snapshot ( value [ key ] , visited ) ;
1189
1189
nested_unstated [ key ] = result ;
1190
1190
if ( result !== value [ key ] ) {
1191
1191
contains_unstated = true ;
@@ -1213,7 +1213,7 @@ export function inspect(get_value, inspect = console.log) {
1213
1213
1214
1214
user_pre_effect ( ( ) => {
1215
1215
const fn = ( ) => {
1216
- const value = untrack ( ( ) => get_value ( ) . map ( ( v ) => deep_unstate ( v ) ) ) ;
1216
+ const value = untrack ( ( ) => get_value ( ) . map ( ( v ) => deep_snapshot ( v ) ) ) ;
1217
1217
if ( value . length === 2 && typeof value [ 1 ] === 'function' && ! warned_inspect_changed ) {
1218
1218
// eslint-disable-next-line no-console
1219
1219
console . warn (
@@ -1301,7 +1301,7 @@ if (DEV) {
1301
1301
*/
1302
1302
export function freeze ( value ) {
1303
1303
if ( typeof value === 'object' && value != null && ! is_frozen ( value ) ) {
1304
- // If the object is already proxified, then unstate the value
1304
+ // If the object is already proxified, then snapshot the value
1305
1305
if ( STATE_SYMBOL in value ) {
1306
1306
return object_freeze ( snapshot ( value ) ) ;
1307
1307
}
0 commit comments