@rest-hooks/normalizr
Advanced tools
Comparing version 9.5.0 to 9.5.1
@@ -195,3 +195,2 @@ define(['exports'], (function (exports) { 'use strict'; | ||
const entity = getEntity(entityOrId, schema); | ||
const key = schema.key; | ||
if (typeof entity === 'symbol' && entity.toString().includes('DELETED')) { | ||
@@ -217,2 +216,3 @@ return [undefined, true, true]; | ||
} | ||
const key = schema.key; | ||
if (!(key in localCache)) { | ||
@@ -224,5 +224,11 @@ localCache[key] = Object.create(null); | ||
} | ||
if (!(key in entityCache)) { | ||
entityCache[key] = Object.create(null); | ||
} | ||
const localCacheKey = localCache[key]; | ||
const cycleCacheKey = cycleCache[key]; | ||
const entityCacheKey = entityCache[key]; | ||
let found = true; | ||
let deleted = false; | ||
if (!localCache[key][pk]) { | ||
if (!localCacheKey[pk]) { | ||
const trackingIndex = dependencies.length; | ||
@@ -232,3 +238,3 @@ dependencies.push(entity); | ||
if (schema.createIfValid) { | ||
entityCopy = localCache[key][pk] = isImmutable(entity) ? schema.createIfValid(entity.toObject()) : schema.createIfValid(entity); | ||
entityCopy = localCacheKey[pk] = isImmutable(entity) ? schema.createIfValid(entity.toObject()) : schema.createIfValid(entity); | ||
// TODO(breaking): remove once old verions no longer supported | ||
@@ -238,6 +244,5 @@ } else { | ||
unvisit = withTrackedEntities(unvisit); | ||
unvisit.setLocal = entityCopy => localCache[schema.key][pk] = entityCopy; | ||
unvisit.setLocal = entityCopy => localCacheKey[pk] = entityCopy; | ||
} | ||
cycleCache[key][pk] = trackingIndex; | ||
const globalCacheEntry = getGlobalCacheEntry(entityCache, schema, pk); | ||
cycleCacheKey[pk] = trackingIndex; | ||
if (entityCopy === undefined) { | ||
@@ -248,5 +253,6 @@ // undefined indicates we should suspense (perhaps failed validation) | ||
} else { | ||
[localCache[key][pk], found, deleted] = schema.denormalize(entityCopy, unvisit); | ||
[localCacheKey[pk], found, deleted] = schema.denormalize(entityCopy, unvisit); | ||
} | ||
delete cycleCache[key][pk]; | ||
delete cycleCacheKey[pk]; | ||
const globalCacheEntry = getGlobalCacheEntry(entityCacheKey, pk); | ||
@@ -257,5 +263,5 @@ // if in cycle, use the start of the cycle to track all deps | ||
if (!globalCacheEntry.has(localKey)) { | ||
globalCacheEntry.set(localKey, localCache[key][pk]); | ||
globalCacheEntry.set(localKey, localCacheKey[pk]); | ||
} else { | ||
localCache[key][pk] = globalCacheEntry.get(localKey); | ||
localCacheKey[pk] = globalCacheEntry.get(localKey); | ||
} | ||
@@ -269,4 +275,4 @@ | ||
// cycle detected | ||
if (pk in cycleCache[key]) { | ||
cycleIndex.i = cycleCache[key][pk]; | ||
if (pk in cycleCacheKey) { | ||
cycleIndex.i = cycleCacheKey[pk]; | ||
} else { | ||
@@ -277,3 +283,3 @@ // with no cycle, globalCacheEntry will have already been set | ||
} | ||
return [localCache[key][pk], found, deleted]; | ||
return [localCacheKey[pk], found, deleted]; | ||
}; | ||
@@ -360,6 +366,5 @@ const getUnvisit = (entities, entityCache, resultCache, localCache) => { | ||
}; | ||
function getGlobalCacheEntry(entityCache, schema, id) { | ||
if (!entityCache[schema.key]) entityCache[schema.key] = Object.create(null); | ||
if (!entityCache[schema.key][id]) entityCache[schema.key][id] = new WeakListMap(); | ||
return entityCache[schema.key][id]; | ||
function getGlobalCacheEntry(entityCache, id) { | ||
if (!entityCache[id]) entityCache[id] = new WeakListMap(); | ||
return entityCache[id]; | ||
} | ||
@@ -366,0 +371,0 @@ |
@@ -196,3 +196,2 @@ var rest_hooks_normalizr = (function (exports) { | ||
const entity = getEntity(entityOrId, schema); | ||
const key = schema.key; | ||
if (typeof entity === 'symbol' && entity.toString().includes('DELETED')) { | ||
@@ -218,2 +217,3 @@ return [undefined, true, true]; | ||
} | ||
const key = schema.key; | ||
if (!(key in localCache)) { | ||
@@ -225,5 +225,11 @@ localCache[key] = Object.create(null); | ||
} | ||
if (!(key in entityCache)) { | ||
entityCache[key] = Object.create(null); | ||
} | ||
const localCacheKey = localCache[key]; | ||
const cycleCacheKey = cycleCache[key]; | ||
const entityCacheKey = entityCache[key]; | ||
let found = true; | ||
let deleted = false; | ||
if (!localCache[key][pk]) { | ||
if (!localCacheKey[pk]) { | ||
const trackingIndex = dependencies.length; | ||
@@ -233,3 +239,3 @@ dependencies.push(entity); | ||
if (schema.createIfValid) { | ||
entityCopy = localCache[key][pk] = isImmutable(entity) ? schema.createIfValid(entity.toObject()) : schema.createIfValid(entity); | ||
entityCopy = localCacheKey[pk] = isImmutable(entity) ? schema.createIfValid(entity.toObject()) : schema.createIfValid(entity); | ||
// TODO(breaking): remove once old verions no longer supported | ||
@@ -239,6 +245,5 @@ } else { | ||
unvisit = withTrackedEntities(unvisit); | ||
unvisit.setLocal = entityCopy => localCache[schema.key][pk] = entityCopy; | ||
unvisit.setLocal = entityCopy => localCacheKey[pk] = entityCopy; | ||
} | ||
cycleCache[key][pk] = trackingIndex; | ||
const globalCacheEntry = getGlobalCacheEntry(entityCache, schema, pk); | ||
cycleCacheKey[pk] = trackingIndex; | ||
if (entityCopy === undefined) { | ||
@@ -249,5 +254,6 @@ // undefined indicates we should suspense (perhaps failed validation) | ||
} else { | ||
[localCache[key][pk], found, deleted] = schema.denormalize(entityCopy, unvisit); | ||
[localCacheKey[pk], found, deleted] = schema.denormalize(entityCopy, unvisit); | ||
} | ||
delete cycleCache[key][pk]; | ||
delete cycleCacheKey[pk]; | ||
const globalCacheEntry = getGlobalCacheEntry(entityCacheKey, pk); | ||
@@ -258,5 +264,5 @@ // if in cycle, use the start of the cycle to track all deps | ||
if (!globalCacheEntry.has(localKey)) { | ||
globalCacheEntry.set(localKey, localCache[key][pk]); | ||
globalCacheEntry.set(localKey, localCacheKey[pk]); | ||
} else { | ||
localCache[key][pk] = globalCacheEntry.get(localKey); | ||
localCacheKey[pk] = globalCacheEntry.get(localKey); | ||
} | ||
@@ -270,4 +276,4 @@ | ||
// cycle detected | ||
if (pk in cycleCache[key]) { | ||
cycleIndex.i = cycleCache[key][pk]; | ||
if (pk in cycleCacheKey) { | ||
cycleIndex.i = cycleCacheKey[pk]; | ||
} else { | ||
@@ -278,3 +284,3 @@ // with no cycle, globalCacheEntry will have already been set | ||
} | ||
return [localCache[key][pk], found, deleted]; | ||
return [localCacheKey[pk], found, deleted]; | ||
}; | ||
@@ -361,6 +367,5 @@ const getUnvisit = (entities, entityCache, resultCache, localCache) => { | ||
}; | ||
function getGlobalCacheEntry(entityCache, schema, id) { | ||
if (!entityCache[schema.key]) entityCache[schema.key] = Object.create(null); | ||
if (!entityCache[schema.key][id]) entityCache[schema.key][id] = new WeakListMap(); | ||
return entityCache[schema.key][id]; | ||
function getGlobalCacheEntry(entityCache, id) { | ||
if (!entityCache[id]) entityCache[id] = new WeakListMap(); | ||
return entityCache[id]; | ||
} | ||
@@ -367,0 +372,0 @@ |
@@ -1,1 +0,1 @@ | ||
function e(e){return null!==e&&void 0!==e.pk}const t=e=>{if("production"!==process.env.NODE_ENV){if(Array.isArray(e)&&e.length>1)throw new Error(`Expected schema definition to be a single schema, but found ${e.length}.`)}return e[0]},n=([e,,t])=>void 0!==e&&!t,r=(e,n,r,o,i,s,c)=>{e=t(e);const u=(e=>Array.isArray(e)?e:Object.keys(e).map((t=>e[t])))(n);return u.map(((t,n)=>i(t,r,o,e,s,c)))},o=(e,r,o)=>(e=t(e),[r.map?r.map((t=>o(t,e))).filter(n).map((([e])=>e)):r,!0,!1]);function i(e,t,n,r){}function s(e){return!("function"!=typeof e.hasOwnProperty||!(Object.hasOwnProperty.call(e,"__ownerID")||e._map&&Object.hasOwnProperty.call(e._map,"__ownerID")))}const c=(e,t,n,r,o,i,s)=>{const c=Object.assign({},t);return Object.keys(e).forEach((n=>{const r=e[n],u=o(t[n],t,n,r,i,s);null==u?delete c[n]:c[n]=u})),c},u=(e,t,n)=>{if(s(t))return function(e,t,n){let r=!0,o=!1;return[Object.keys(e).reduce(((t,i)=>{const s=`${i}`,[c,u,a]=n(t.get(s),e[s]);return u||(r=!1),a&&(o=!0),t.has(s)?t.set(s,c):t}),t),r,o]}(e,t,n);const r=Object.assign({},t);let o=!0,i=!1;return Object.keys(e).forEach((t=>{const[s,c,u]=n(r[t],e[t]);void 0!==r[t]&&(r[t]=s),u&&(i=!0),c||(o=!1)})),[r,o,i]};function a(e,t,n,r,o){const i={};for(const s of Object.keys(e))i[s]=r(e[s],t,n,o);return i}class l{constructor(){this.children=new WeakMap}}class f extends Error{constructor(...e){super(...e),this.message="Keys must include at least one member"}}class d{constructor(){this.first=new WeakMap}delete(e){const t=this.traverse(e);return null==t||delete t.value,!!t}get(e){const t=this.traverse(e);return null==t?void 0:t.value}has(e){const t=this.traverse(e);return!!t&&Object.hasOwn(t,"value")}set(e,t){if(e.length<1)throw new f;let n,r=this.first;for(let o=0;o<e.length;o++)r.has(e[o])?n=r.get(e[o]):(n=new l,r.set(e[o],n)),r=n.children,o===e.length-1&&(n.value=t);return this}traverse(e){let t,n=this.first;for(let r=0;r<e.length;r++){if(t=n.get(e[r]),!t)return;n=t.children}return t}}const p=(e,t,n,r,o,i,c,u,a)=>{const l=r(e,t),f=t.key;if("symbol"==typeof l&&l.toString().includes("DELETED"))return[void 0,!0,!0];if("object"!=typeof l||null===l)return[l,!1,!1];const p="string"==typeof e?e:t.pk(s(l)?l.toJS():l);if(void 0===p||""===p||"undefined"===p)return[l,!1,!1];f in o||(o[f]=Object.create(null)),f in i||(i[f]=Object.create(null));let y=!0,h=!1;if(o[f][p])p in i[f]?a.i=i[f][p]:u.push(l);else{const e=u.length;let r;u.push(l),t.createIfValid?r=o[f][p]=s(l)?t.createIfValid(l.toObject()):t.createIfValid(l):(r=l,n=function(e){const t=e.og||e,n=(e,n)=>t(e,n);return n.og=e,n}(n),n.setLocal=e=>o[t.key][p]=e),i[f][p]=e;const g=function(e,t,n){e[t.key]||(e[t.key]=Object.create(null));e[t.key][n]||(e[t.key][n]=new d);return e[t.key][n]}(c,t,p);void 0===r?(y=!1,h=!0):[o[f][p],y,h]=t.denormalize(r,n),delete i[f][p];const b=u.slice(-1===a.i?e:a.i);g.has(b)?o[f][p]=g.get(b):g.set(b,o[f][p]),a.i===e&&(a.i=-1)}return[o[f][p],y,h]},y=e=>{const t=s(e);return(n,r)=>{var o;const i=r.key;return"object"==typeof n?n:t?e.getIn([i,n]):null==(o=e[i])?void 0:o[n]}},h=(t,n,r,i={},s=new d)=>{if(void 0===n)return[t,!0,!1,{}];if(void 0===t)return[void 0,!1,!1,{}];const c={},a=((t,n,r,i)=>{const s=y(t),c=[],a={i:-1},l={};function f(t,r){if(!r)return[t,!0,!1];if(null===t)return[t,!0,!1];const d="function"==typeof r.denormalize;return d||"function"!=typeof r?void 0===t?[t,!1,!1]:d||"object"!=typeof r?e(r)?p(t,r,f,s,i,l,n,c,a):d?r.denormalize(t,f):[t,!0,!1]:(Array.isArray(r)?o:u)(r,t,f):t instanceof r||void 0===t?[t,!0,!1]:[new r(t),!0,!1]}return(e,t)=>{const n=f(e,t);return Object(e)!==e?n:(c.push(e),r.has(c)?[r.get(c),n[1],n[2]]:(r.set(c,n[0]),n))}})(r,i,s,c);return[...a(t,n),c]};const g=Symbol("ENTITY WAS DELETED"),b=(e,t,n,o,i,s)=>{if(!e||!o)return e;if(o.normalize&&"function"==typeof o.normalize)return"object"!=typeof e?e:o.normalize(e,t,n,b,i,s);if("function"==typeof o)return new o(e);if("object"!=typeof e||"object"!=typeof o)return e;return(Array.isArray(o)?r:c)(o,e,t,n,b,i,s)};const m=(e,t,n={},r={},o={},i={date:Date.now(),expiresAt:1/0,fetchedAt:0})=>{if(null==t)return{entities:n,indexes:r,result:e,entityMeta:o};const s=function(e){return["object","function"].includes(typeof e)?"object":typeof e}(t);if(null===e||typeof e!==s&&(void 0===t.key||void 0!==t.pk||"string"!=typeof e)){if("production"!==process.env.NODE_ENV){const n=e=>{try{return"string"!=typeof JSON.parse(e)}catch(e){return!1}};throw"string"==typeof e&&n(e)?new Error(`Normalizing a string, but this does match schema.\n\nParsing this input string as JSON worked. This likely indicates fetch function did not parse\nthe JSON. By default, this only happens if "content-type" header includes "json".\nSee https://resthooks.io/rest/api/RestEndpoint#parseResponse for more information\n\n Schema: ${JSON.stringify(t,void 0,2)}\n Input: "${e}"`):new Error(`Unexpected input given to normalize. Expected type to be "${s}", found "${null===e?"null":typeof e}".\n\n Schema: ${JSON.stringify(t,void 0,2)}\n Input: "${e}"`)}throw new Error(`Unexpected input given to normalize. Expected type to be "${s}", found "${null===e?"null":typeof e}".`)}const c=Object.assign({},n),u=Object.assign({},r),a=Object.assign({},o),l=((e,t,n,r,o,i)=>(s,c,u)=>{const a=s.key;a in e||(e[a]={},n[a]=Object.assign({},n[a]),o[a]=Object.assign({},o[a]));const l=e[a][u];if(l)e[a][u]=s.merge(l,c);else{const t=s.expiresAt?s.expiresAt(i,c):i.expiresAt,r=n[a][u];if(r){var f,d,p;const n=o[a][u];e[a][u]=s.mergeWithStore?s.mergeWithStore(n,i,r,c):function(e,t,n,r,o){return!t||(e.useIncoming&&n.fetchedAt?e.useIncoming(t,n,r,o):t.date<=n.date)?typeof o!=typeof r?o:e.merge(r,o):r}(s,n,i,r,c),o[a][u]={expiresAt:Math.max(t,null==n?void 0:n.expiresAt),date:Math.max(i.date,null!=(f=null==n?void 0:n.date)?f:0),fetchedAt:Math.max(null!=(d=i.fetchedAt)?d:0,null!=(p=null==n?void 0:n.fetchedAt)?p:0)}}else{var y;e[a][u]=c,o[a][u]={expiresAt:t,date:i.date,fetchedAt:null!=(y=i.fetchedAt)?y:i.date}}}if(Array.isArray(s.indexes)){const o=e[a][u];a in t||(t[a]={},r[a]=Object.assign({},r[a]));for(const e of s.indexes){e in t[a]||(r[a][e]=t[a][e]={});const i=t[a][e];l&&delete i[l[e]],n[a]&&n[a][u]&&n[a][u][e]!==o[e]&&(i[n[a][u][e]]=g),e in o?i[o[e]]=u:"production"!==process.env.NODE_ENV&&console.warn(`Index not found in entity. Indexes must be top-level members of your entity.\nIndex: ${e}\nEntity: ${JSON.stringify(o,void 0,2)}`)}}n[a][u]=e[a][u]})({},{},c,u,a,i);return{entities:c,indexes:u,result:b(e,e,void 0,t,l,{}),entityMeta:a}};function v(e,t,n,r={}){if(function(e){return!!e&&"function"==typeof e.infer}(e))return e.infer(t,n,v,r);if("object"==typeof e&&e){return(Array.isArray(e)?i:a)(e,t,n,v,r)}return e}var O={Invalid:1,InvalidIfStale:2,Valid:3};Object.hasOwn=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};export{g as DELETED,O as ExpiryStatus,d as WeakListMap,h as denormalize,v as inferResults,e as isEntity,m as normalize}; | ||
function e(e){return null!==e&&void 0!==e.pk}const t=e=>{if("production"!==process.env.NODE_ENV){if(Array.isArray(e)&&e.length>1)throw new Error(`Expected schema definition to be a single schema, but found ${e.length}.`)}return e[0]},n=([e,,t])=>void 0!==e&&!t,r=(e,n,r,o,i,s,c)=>{e=t(e);const u=(e=>Array.isArray(e)?e:Object.keys(e).map((t=>e[t])))(n);return u.map(((t,n)=>i(t,r,o,e,s,c)))},o=(e,r,o)=>(e=t(e),[r.map?r.map((t=>o(t,e))).filter(n).map((([e])=>e)):r,!0,!1]);function i(e,t,n,r){}function s(e){return!("function"!=typeof e.hasOwnProperty||!(Object.hasOwnProperty.call(e,"__ownerID")||e._map&&Object.hasOwnProperty.call(e._map,"__ownerID")))}const c=(e,t,n,r,o,i,s)=>{const c=Object.assign({},t);return Object.keys(e).forEach((n=>{const r=e[n],u=o(t[n],t,n,r,i,s);null==u?delete c[n]:c[n]=u})),c},u=(e,t,n)=>{if(s(t))return function(e,t,n){let r=!0,o=!1;return[Object.keys(e).reduce(((t,i)=>{const s=`${i}`,[c,u,a]=n(t.get(s),e[s]);return u||(r=!1),a&&(o=!0),t.has(s)?t.set(s,c):t}),t),r,o]}(e,t,n);const r=Object.assign({},t);let o=!0,i=!1;return Object.keys(e).forEach((t=>{const[s,c,u]=n(r[t],e[t]);void 0!==r[t]&&(r[t]=s),u&&(i=!0),c||(o=!1)})),[r,o,i]};function a(e,t,n,r,o){const i={};for(const s of Object.keys(e))i[s]=r(e[s],t,n,o);return i}class l{constructor(){this.children=new WeakMap}}class f extends Error{constructor(...e){super(...e),this.message="Keys must include at least one member"}}class d{constructor(){this.first=new WeakMap}delete(e){const t=this.traverse(e);return null==t||delete t.value,!!t}get(e){const t=this.traverse(e);return null==t?void 0:t.value}has(e){const t=this.traverse(e);return!!t&&Object.hasOwn(t,"value")}set(e,t){if(e.length<1)throw new f;let n,r=this.first;for(let o=0;o<e.length;o++)r.has(e[o])?n=r.get(e[o]):(n=new l,r.set(e[o],n)),r=n.children,o===e.length-1&&(n.value=t);return this}traverse(e){let t,n=this.first;for(let r=0;r<e.length;r++){if(t=n.get(e[r]),!t)return;n=t.children}return t}}const p=(e,t,n,r,o,i,c,u,a)=>{const l=r(e,t);if("symbol"==typeof l&&l.toString().includes("DELETED"))return[void 0,!0,!0];if("object"!=typeof l||null===l)return[l,!1,!1];const f="string"==typeof e?e:t.pk(s(l)?l.toJS():l);if(void 0===f||""===f||"undefined"===f)return[l,!1,!1];const p=t.key;p in o||(o[p]=Object.create(null)),p in i||(i[p]=Object.create(null)),p in c||(c[p]=Object.create(null));const y=o[p],h=i[p],g=c[p];let b=!0,m=!1;if(y[f])f in h?a.i=h[f]:u.push(l);else{const e=u.length;let r;u.push(l),t.createIfValid?r=y[f]=s(l)?t.createIfValid(l.toObject()):t.createIfValid(l):(r=l,n=function(e){const t=e.og||e,n=(e,n)=>t(e,n);return n.og=e,n}(n),n.setLocal=e=>y[f]=e),h[f]=e,void 0===r?(b=!1,m=!0):[y[f],b,m]=t.denormalize(r,n),delete h[f];const o=function(e,t){e[t]||(e[t]=new d);return e[t]}(g,f),i=u.slice(-1===a.i?e:a.i);o.has(i)?y[f]=o.get(i):o.set(i,y[f]),a.i===e&&(a.i=-1)}return[y[f],b,m]},y=e=>{const t=s(e);return(n,r)=>{var o;const i=r.key;return"object"==typeof n?n:t?e.getIn([i,n]):null==(o=e[i])?void 0:o[n]}},h=(t,n,r,i={},s=new d)=>{if(void 0===n)return[t,!0,!1,{}];if(void 0===t)return[void 0,!1,!1,{}];const c={},a=((t,n,r,i)=>{const s=y(t),c=[],a={i:-1},l={};function f(t,r){if(!r)return[t,!0,!1];if(null===t)return[t,!0,!1];const d="function"==typeof r.denormalize;return d||"function"!=typeof r?void 0===t?[t,!1,!1]:d||"object"!=typeof r?e(r)?p(t,r,f,s,i,l,n,c,a):d?r.denormalize(t,f):[t,!0,!1]:(Array.isArray(r)?o:u)(r,t,f):t instanceof r||void 0===t?[t,!0,!1]:[new r(t),!0,!1]}return(e,t)=>{const n=f(e,t);return Object(e)!==e?n:(c.push(e),r.has(c)?[r.get(c),n[1],n[2]]:(r.set(c,n[0]),n))}})(r,i,s,c);return[...a(t,n),c]};const g=Symbol("ENTITY WAS DELETED"),b=(e,t,n,o,i,s)=>{if(!e||!o)return e;if(o.normalize&&"function"==typeof o.normalize)return"object"!=typeof e?e:o.normalize(e,t,n,b,i,s);if("function"==typeof o)return new o(e);if("object"!=typeof e||"object"!=typeof o)return e;return(Array.isArray(o)?r:c)(o,e,t,n,b,i,s)};const m=(e,t,n={},r={},o={},i={date:Date.now(),expiresAt:1/0,fetchedAt:0})=>{if(null==t)return{entities:n,indexes:r,result:e,entityMeta:o};const s=function(e){return["object","function"].includes(typeof e)?"object":typeof e}(t);if(null===e||typeof e!==s&&(void 0===t.key||void 0!==t.pk||"string"!=typeof e)){if("production"!==process.env.NODE_ENV){const n=e=>{try{return"string"!=typeof JSON.parse(e)}catch(e){return!1}};throw"string"==typeof e&&n(e)?new Error(`Normalizing a string, but this does match schema.\n\nParsing this input string as JSON worked. This likely indicates fetch function did not parse\nthe JSON. By default, this only happens if "content-type" header includes "json".\nSee https://resthooks.io/rest/api/RestEndpoint#parseResponse for more information\n\n Schema: ${JSON.stringify(t,void 0,2)}\n Input: "${e}"`):new Error(`Unexpected input given to normalize. Expected type to be "${s}", found "${null===e?"null":typeof e}".\n\n Schema: ${JSON.stringify(t,void 0,2)}\n Input: "${e}"`)}throw new Error(`Unexpected input given to normalize. Expected type to be "${s}", found "${null===e?"null":typeof e}".`)}const c=Object.assign({},n),u=Object.assign({},r),a=Object.assign({},o),l=((e,t,n,r,o,i)=>(s,c,u)=>{const a=s.key;a in e||(e[a]={},n[a]=Object.assign({},n[a]),o[a]=Object.assign({},o[a]));const l=e[a][u];if(l)e[a][u]=s.merge(l,c);else{const t=s.expiresAt?s.expiresAt(i,c):i.expiresAt,r=n[a][u];if(r){var f,d,p;const n=o[a][u];e[a][u]=s.mergeWithStore?s.mergeWithStore(n,i,r,c):function(e,t,n,r,o){return!t||(e.useIncoming&&n.fetchedAt?e.useIncoming(t,n,r,o):t.date<=n.date)?typeof o!=typeof r?o:e.merge(r,o):r}(s,n,i,r,c),o[a][u]={expiresAt:Math.max(t,null==n?void 0:n.expiresAt),date:Math.max(i.date,null!=(f=null==n?void 0:n.date)?f:0),fetchedAt:Math.max(null!=(d=i.fetchedAt)?d:0,null!=(p=null==n?void 0:n.fetchedAt)?p:0)}}else{var y;e[a][u]=c,o[a][u]={expiresAt:t,date:i.date,fetchedAt:null!=(y=i.fetchedAt)?y:i.date}}}if(Array.isArray(s.indexes)){const o=e[a][u];a in t||(t[a]={},r[a]=Object.assign({},r[a]));for(const e of s.indexes){e in t[a]||(r[a][e]=t[a][e]={});const i=t[a][e];l&&delete i[l[e]],n[a]&&n[a][u]&&n[a][u][e]!==o[e]&&(i[n[a][u][e]]=g),e in o?i[o[e]]=u:"production"!==process.env.NODE_ENV&&console.warn(`Index not found in entity. Indexes must be top-level members of your entity.\nIndex: ${e}\nEntity: ${JSON.stringify(o,void 0,2)}`)}}n[a][u]=e[a][u]})({},{},c,u,a,i);return{entities:c,indexes:u,result:b(e,e,void 0,t,l,{}),entityMeta:a}};function v(e,t,n,r={}){if(function(e){return!!e&&"function"==typeof e.infer}(e))return e.infer(t,n,v,r);if("object"==typeof e&&e){return(Array.isArray(e)?i:a)(e,t,n,v,r)}return e}var O={Invalid:1,InvalidIfStale:2,Valid:3};Object.hasOwn=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};export{g as DELETED,O as ExpiryStatus,d as WeakListMap,h as denormalize,v as inferResults,e as isEntity,m as normalize}; |
@@ -201,3 +201,2 @@ 'use strict'; | ||
const entity = getEntity(entityOrId, schema); | ||
const key = schema.key; | ||
if (typeof entity === 'symbol' && entity.toString().includes('DELETED')) { | ||
@@ -223,2 +222,3 @@ return [undefined, true, true]; | ||
} | ||
const key = schema.key; | ||
if (!(key in localCache)) { | ||
@@ -230,5 +230,11 @@ localCache[key] = Object.create(null); | ||
} | ||
if (!(key in entityCache)) { | ||
entityCache[key] = Object.create(null); | ||
} | ||
const localCacheKey = localCache[key]; | ||
const cycleCacheKey = cycleCache[key]; | ||
const entityCacheKey = entityCache[key]; | ||
let found = true; | ||
let deleted = false; | ||
if (!localCache[key][pk]) { | ||
if (!localCacheKey[pk]) { | ||
const trackingIndex = dependencies.length; | ||
@@ -238,3 +244,3 @@ dependencies.push(entity); | ||
if (schema.createIfValid) { | ||
entityCopy = localCache[key][pk] = isImmutable(entity) ? schema.createIfValid(entity.toObject()) : schema.createIfValid(entity); | ||
entityCopy = localCacheKey[pk] = isImmutable(entity) ? schema.createIfValid(entity.toObject()) : schema.createIfValid(entity); | ||
// TODO(breaking): remove once old verions no longer supported | ||
@@ -244,6 +250,5 @@ } else { | ||
unvisit = withTrackedEntities(unvisit); | ||
unvisit.setLocal = entityCopy => localCache[schema.key][pk] = entityCopy; | ||
unvisit.setLocal = entityCopy => localCacheKey[pk] = entityCopy; | ||
} | ||
cycleCache[key][pk] = trackingIndex; | ||
const globalCacheEntry = getGlobalCacheEntry(entityCache, schema, pk); | ||
cycleCacheKey[pk] = trackingIndex; | ||
if (entityCopy === undefined) { | ||
@@ -254,5 +259,6 @@ // undefined indicates we should suspense (perhaps failed validation) | ||
} else { | ||
[localCache[key][pk], found, deleted] = schema.denormalize(entityCopy, unvisit); | ||
[localCacheKey[pk], found, deleted] = schema.denormalize(entityCopy, unvisit); | ||
} | ||
delete cycleCache[key][pk]; | ||
delete cycleCacheKey[pk]; | ||
const globalCacheEntry = getGlobalCacheEntry(entityCacheKey, pk); | ||
@@ -263,5 +269,5 @@ // if in cycle, use the start of the cycle to track all deps | ||
if (!globalCacheEntry.has(localKey)) { | ||
globalCacheEntry.set(localKey, localCache[key][pk]); | ||
globalCacheEntry.set(localKey, localCacheKey[pk]); | ||
} else { | ||
localCache[key][pk] = globalCacheEntry.get(localKey); | ||
localCacheKey[pk] = globalCacheEntry.get(localKey); | ||
} | ||
@@ -275,4 +281,4 @@ | ||
// cycle detected | ||
if (pk in cycleCache[key]) { | ||
cycleIndex.i = cycleCache[key][pk]; | ||
if (pk in cycleCacheKey) { | ||
cycleIndex.i = cycleCacheKey[pk]; | ||
} else { | ||
@@ -283,3 +289,3 @@ // with no cycle, globalCacheEntry will have already been set | ||
} | ||
return [localCache[key][pk], found, deleted]; | ||
return [localCacheKey[pk], found, deleted]; | ||
}; | ||
@@ -366,6 +372,5 @@ const getUnvisit = (entities, entityCache, resultCache, localCache) => { | ||
}; | ||
function getGlobalCacheEntry(entityCache, schema, id) { | ||
if (!entityCache[schema.key]) entityCache[schema.key] = Object.create(null); | ||
if (!entityCache[schema.key][id]) entityCache[schema.key][id] = new WeakListMap(); | ||
return entityCache[schema.key][id]; | ||
function getGlobalCacheEntry(entityCache, id) { | ||
if (!entityCache[id]) entityCache[id] = new WeakListMap(); | ||
return entityCache[id]; | ||
} | ||
@@ -372,0 +377,0 @@ |
@@ -199,3 +199,2 @@ (function (global, factory) { | ||
const entity = getEntity(entityOrId, schema); | ||
const key = schema.key; | ||
if (typeof entity === 'symbol' && entity.toString().includes('DELETED')) { | ||
@@ -221,2 +220,3 @@ return [undefined, true, true]; | ||
} | ||
const key = schema.key; | ||
if (!(key in localCache)) { | ||
@@ -228,5 +228,11 @@ localCache[key] = Object.create(null); | ||
} | ||
if (!(key in entityCache)) { | ||
entityCache[key] = Object.create(null); | ||
} | ||
const localCacheKey = localCache[key]; | ||
const cycleCacheKey = cycleCache[key]; | ||
const entityCacheKey = entityCache[key]; | ||
let found = true; | ||
let deleted = false; | ||
if (!localCache[key][pk]) { | ||
if (!localCacheKey[pk]) { | ||
const trackingIndex = dependencies.length; | ||
@@ -236,3 +242,3 @@ dependencies.push(entity); | ||
if (schema.createIfValid) { | ||
entityCopy = localCache[key][pk] = isImmutable(entity) ? schema.createIfValid(entity.toObject()) : schema.createIfValid(entity); | ||
entityCopy = localCacheKey[pk] = isImmutable(entity) ? schema.createIfValid(entity.toObject()) : schema.createIfValid(entity); | ||
// TODO(breaking): remove once old verions no longer supported | ||
@@ -242,6 +248,5 @@ } else { | ||
unvisit = withTrackedEntities(unvisit); | ||
unvisit.setLocal = entityCopy => localCache[schema.key][pk] = entityCopy; | ||
unvisit.setLocal = entityCopy => localCacheKey[pk] = entityCopy; | ||
} | ||
cycleCache[key][pk] = trackingIndex; | ||
const globalCacheEntry = getGlobalCacheEntry(entityCache, schema, pk); | ||
cycleCacheKey[pk] = trackingIndex; | ||
if (entityCopy === undefined) { | ||
@@ -252,5 +257,6 @@ // undefined indicates we should suspense (perhaps failed validation) | ||
} else { | ||
[localCache[key][pk], found, deleted] = schema.denormalize(entityCopy, unvisit); | ||
[localCacheKey[pk], found, deleted] = schema.denormalize(entityCopy, unvisit); | ||
} | ||
delete cycleCache[key][pk]; | ||
delete cycleCacheKey[pk]; | ||
const globalCacheEntry = getGlobalCacheEntry(entityCacheKey, pk); | ||
@@ -261,5 +267,5 @@ // if in cycle, use the start of the cycle to track all deps | ||
if (!globalCacheEntry.has(localKey)) { | ||
globalCacheEntry.set(localKey, localCache[key][pk]); | ||
globalCacheEntry.set(localKey, localCacheKey[pk]); | ||
} else { | ||
localCache[key][pk] = globalCacheEntry.get(localKey); | ||
localCacheKey[pk] = globalCacheEntry.get(localKey); | ||
} | ||
@@ -273,4 +279,4 @@ | ||
// cycle detected | ||
if (pk in cycleCache[key]) { | ||
cycleIndex.i = cycleCache[key][pk]; | ||
if (pk in cycleCacheKey) { | ||
cycleIndex.i = cycleCacheKey[pk]; | ||
} else { | ||
@@ -281,3 +287,3 @@ // with no cycle, globalCacheEntry will have already been set | ||
} | ||
return [localCache[key][pk], found, deleted]; | ||
return [localCacheKey[pk], found, deleted]; | ||
}; | ||
@@ -364,6 +370,5 @@ const getUnvisit = (entities, entityCache, resultCache, localCache) => { | ||
}; | ||
function getGlobalCacheEntry(entityCache, schema, id) { | ||
if (!entityCache[schema.key]) entityCache[schema.key] = Object.create(null); | ||
if (!entityCache[schema.key][id]) entityCache[schema.key][id] = new WeakListMap(); | ||
return entityCache[schema.key][id]; | ||
function getGlobalCacheEntry(entityCache, id) { | ||
if (!entityCache[id]) entityCache[id] = new WeakListMap(); | ||
return entityCache[id]; | ||
} | ||
@@ -370,0 +375,0 @@ |
@@ -8,3 +8,2 @@ import { isEntity } from './isEntity.js'; | ||
const entity = getEntity(entityOrId, schema); | ||
const key = schema.key; | ||
if (typeof entity === 'symbol' && entity.toString().includes('DELETED')) { | ||
@@ -30,2 +29,3 @@ return [undefined, true, true]; | ||
} | ||
const key = schema.key; | ||
if (!(key in localCache)) { | ||
@@ -37,5 +37,11 @@ localCache[key] = Object.create(null); | ||
} | ||
if (!(key in entityCache)) { | ||
entityCache[key] = Object.create(null); | ||
} | ||
const localCacheKey = localCache[key]; | ||
const cycleCacheKey = cycleCache[key]; | ||
const entityCacheKey = entityCache[key]; | ||
let found = true; | ||
let deleted = false; | ||
if (!localCache[key][pk]) { | ||
if (!localCacheKey[pk]) { | ||
const trackingIndex = dependencies.length; | ||
@@ -45,3 +51,3 @@ dependencies.push(entity); | ||
if (schema.createIfValid) { | ||
entityCopy = localCache[key][pk] = isImmutable(entity) ? schema.createIfValid(entity.toObject()) : schema.createIfValid(entity); | ||
entityCopy = localCacheKey[pk] = isImmutable(entity) ? schema.createIfValid(entity.toObject()) : schema.createIfValid(entity); | ||
// TODO(breaking): remove once old verions no longer supported | ||
@@ -51,6 +57,5 @@ } else { | ||
unvisit = withTrackedEntities(unvisit); | ||
unvisit.setLocal = entityCopy => localCache[schema.key][pk] = entityCopy; | ||
unvisit.setLocal = entityCopy => localCacheKey[pk] = entityCopy; | ||
} | ||
cycleCache[key][pk] = trackingIndex; | ||
const globalCacheEntry = getGlobalCacheEntry(entityCache, schema, pk); | ||
cycleCacheKey[pk] = trackingIndex; | ||
if (entityCopy === undefined) { | ||
@@ -61,5 +66,6 @@ // undefined indicates we should suspense (perhaps failed validation) | ||
} else { | ||
[localCache[key][pk], found, deleted] = schema.denormalize(entityCopy, unvisit); | ||
[localCacheKey[pk], found, deleted] = schema.denormalize(entityCopy, unvisit); | ||
} | ||
delete cycleCache[key][pk]; | ||
delete cycleCacheKey[pk]; | ||
const globalCacheEntry = getGlobalCacheEntry(entityCacheKey, pk); | ||
@@ -70,5 +76,5 @@ // if in cycle, use the start of the cycle to track all deps | ||
if (!globalCacheEntry.has(localKey)) { | ||
globalCacheEntry.set(localKey, localCache[key][pk]); | ||
globalCacheEntry.set(localKey, localCacheKey[pk]); | ||
} else { | ||
localCache[key][pk] = globalCacheEntry.get(localKey); | ||
localCacheKey[pk] = globalCacheEntry.get(localKey); | ||
} | ||
@@ -82,4 +88,4 @@ | ||
// cycle detected | ||
if (pk in cycleCache[key]) { | ||
cycleIndex.i = cycleCache[key][pk]; | ||
if (pk in cycleCacheKey) { | ||
cycleIndex.i = cycleCacheKey[pk]; | ||
} else { | ||
@@ -90,3 +96,3 @@ // with no cycle, globalCacheEntry will have already been set | ||
} | ||
return [localCache[key][pk], found, deleted]; | ||
return [localCacheKey[pk], found, deleted]; | ||
}; | ||
@@ -174,6 +180,5 @@ const getUnvisit = (entities, entityCache, resultCache, localCache) => { | ||
export const denormalizeSimple = (input, schema, entities, entityCache = {}, resultCache = new WeakListMap()) => denormalize(input, schema, entities, entityCache, resultCache).slice(0, 3); | ||
function getGlobalCacheEntry(entityCache, schema, id) { | ||
if (!entityCache[schema.key]) entityCache[schema.key] = Object.create(null); | ||
if (!entityCache[schema.key][id]) entityCache[schema.key][id] = new WeakListMap(); | ||
return entityCache[schema.key][id]; | ||
function getGlobalCacheEntry(entityCache, id) { | ||
if (!entityCache[id]) entityCache[id] = new WeakListMap(); | ||
return entityCache[id]; | ||
} | ||
@@ -190,2 +195,2 @@ | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJpc0VudGl0eSIsImRlbm9ybWFsaXplIiwiYXJyYXlEZW5vcm1hbGl6ZSIsImlzSW1tdXRhYmxlIiwib2JqZWN0RGVub3JtYWxpemUiLCJXZWFrTGlzdE1hcCIsInVudmlzaXRFbnRpdHkiLCJlbnRpdHlPcklkIiwic2NoZW1hIiwidW52aXNpdCIsImdldEVudGl0eSIsImxvY2FsQ2FjaGUiLCJjeWNsZUNhY2hlIiwiZW50aXR5Q2FjaGUiLCJkZXBlbmRlbmNpZXMiLCJjeWNsZUluZGV4IiwiZW50aXR5Iiwia2V5IiwidG9TdHJpbmciLCJpbmNsdWRlcyIsInVuZGVmaW5lZCIsInBrIiwidG9KUyIsIk9iamVjdCIsImNyZWF0ZSIsImZvdW5kIiwiZGVsZXRlZCIsInRyYWNraW5nSW5kZXgiLCJsZW5ndGgiLCJwdXNoIiwiZW50aXR5Q29weSIsImNyZWF0ZUlmVmFsaWQiLCJ0b09iamVjdCIsIndpdGhUcmFja2VkRW50aXRpZXMiLCJzZXRMb2NhbCIsImdsb2JhbENhY2hlRW50cnkiLCJnZXRHbG9iYWxDYWNoZUVudHJ5IiwibG9jYWxLZXkiLCJzbGljZSIsImkiLCJoYXMiLCJzZXQiLCJnZXQiLCJnZXRVbnZpc2l0IiwiZW50aXRpZXMiLCJyZXN1bHRDYWNoZSIsImdldEVudGl0aWVzIiwiaW5wdXQiLCJoYXNEZW5vcm1hbGl6ZSIsIm1ldGhvZCIsIkFycmF5IiwiaXNBcnJheSIsInJldCIsImVudGl0eUlzSW1tdXRhYmxlIiwic2NoZW1hS2V5IiwiZ2V0SW4i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FPO0VBQzNCLE9BQU91RCxjQUFjO0FBQ3ZCIn0= |
@@ -8,3 +8,2 @@ import { isEntity } from './isEntity.js'; | ||
const entity = getEntity(entityOrId, schema); | ||
const key = schema.key; | ||
if (typeof entity === 'symbol' && entity.toString().includes('DELETED')) { | ||
@@ -30,2 +29,3 @@ return [undefined, true, true]; | ||
} | ||
const key = schema.key; | ||
if (!(key in localCache)) { | ||
@@ -37,5 +37,11 @@ localCache[key] = Object.create(null); | ||
} | ||
if (!(key in entityCache)) { | ||
entityCache[key] = Object.create(null); | ||
} | ||
const localCacheKey = localCache[key]; | ||
const cycleCacheKey = cycleCache[key]; | ||
const entityCacheKey = entityCache[key]; | ||
let found = true; | ||
let deleted = false; | ||
if (!localCache[key][pk]) { | ||
if (!localCacheKey[pk]) { | ||
const trackingIndex = dependencies.length; | ||
@@ -45,3 +51,3 @@ dependencies.push(entity); | ||
if (schema.createIfValid) { | ||
entityCopy = localCache[key][pk] = isImmutable(entity) ? schema.createIfValid(entity.toObject()) : schema.createIfValid(entity); | ||
entityCopy = localCacheKey[pk] = isImmutable(entity) ? schema.createIfValid(entity.toObject()) : schema.createIfValid(entity); | ||
// TODO(breaking): remove once old verions no longer supported | ||
@@ -51,6 +57,5 @@ } else { | ||
unvisit = withTrackedEntities(unvisit); | ||
unvisit.setLocal = entityCopy => localCache[schema.key][pk] = entityCopy; | ||
unvisit.setLocal = entityCopy => localCacheKey[pk] = entityCopy; | ||
} | ||
cycleCache[key][pk] = trackingIndex; | ||
const globalCacheEntry = getGlobalCacheEntry(entityCache, schema, pk); | ||
cycleCacheKey[pk] = trackingIndex; | ||
if (entityCopy === undefined) { | ||
@@ -61,5 +66,6 @@ // undefined indicates we should suspense (perhaps failed validation) | ||
} else { | ||
[localCache[key][pk], found, deleted] = schema.denormalize(entityCopy, unvisit); | ||
[localCacheKey[pk], found, deleted] = schema.denormalize(entityCopy, unvisit); | ||
} | ||
delete cycleCache[key][pk]; | ||
delete cycleCacheKey[pk]; | ||
const globalCacheEntry = getGlobalCacheEntry(entityCacheKey, pk); | ||
@@ -70,5 +76,5 @@ // if in cycle, use the start of the cycle to track all deps | ||
if (!globalCacheEntry.has(localKey)) { | ||
globalCacheEntry.set(localKey, localCache[key][pk]); | ||
globalCacheEntry.set(localKey, localCacheKey[pk]); | ||
} else { | ||
localCache[key][pk] = globalCacheEntry.get(localKey); | ||
localCacheKey[pk] = globalCacheEntry.get(localKey); | ||
} | ||
@@ -82,4 +88,4 @@ | ||
// cycle detected | ||
if (pk in cycleCache[key]) { | ||
cycleIndex.i = cycleCache[key][pk]; | ||
if (pk in cycleCacheKey) { | ||
cycleIndex.i = cycleCacheKey[pk]; | ||
} else { | ||
@@ -90,3 +96,3 @@ // with no cycle, globalCacheEntry will have already been set | ||
} | ||
return [localCache[key][pk], found, deleted]; | ||
return [localCacheKey[pk], found, deleted]; | ||
}; | ||
@@ -174,6 +180,5 @@ const getUnvisit = (entities, entityCache, resultCache, localCache) => { | ||
export const denormalizeSimple = (input, schema, entities, entityCache = {}, resultCache = new WeakListMap()) => denormalize(input, schema, entities, entityCache, resultCache).slice(0, 3); | ||
function getGlobalCacheEntry(entityCache, schema, id) { | ||
if (!entityCache[schema.key]) entityCache[schema.key] = Object.create(null); | ||
if (!entityCache[schema.key][id]) entityCache[schema.key][id] = new WeakListMap(); | ||
return entityCache[schema.key][id]; | ||
function getGlobalCacheEntry(entityCache, id) { | ||
if (!entityCache[id]) entityCache[id] = new WeakListMap(); | ||
return entityCache[id]; | ||
} | ||
@@ -190,2 +195,2 @@ | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJpc0VudGl0eSIsImRlbm9ybWFsaXplIiwiYXJyYXlEZW5vcm1hbGl6ZSIsImlzSW1tdXRhYmxlIiwib2JqZWN0RGVub3JtYWxpemUiLCJXZWFrTGlzdE1hcCIsInVudmlzaXRFbnRpdHkiLCJlbnRpdHlPcklkIiwic2NoZW1hIiw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xQyxNQUFNLEVBQUV1QyxRQUFRLEVBQUVsQyxXQUFXLEVBQUVtQyxXQUFXLENBQUMsQ0FBQ1AsS0FBSyxDQUNsRSxDQUFDLEVBQ0QsQ0FBQyxDQUNLO0FBRVYsU0FBU0YsbUJBQW1CLENBQzFCMUIsV0FBd0UsRUFFeEVnRCxFQUFPLEVBQ1A7RUFDQSxJQUFJLENBQUNoRCxXQUFXLENBQUNnRCxFQUFFLENBQUMsRUFBRWhELFdBQVcsQ0FBQ2dELEVBQUUsQ0FBQyxHQUFHLElBQUl4RCxXQUFXLEVBQUU7RUFDekQsT0FBT1EsV0FBVyxDQUFDZ0QsRUFBRSxDQUFDO0FBQ3hCOztBQUVBO0FBQ0EsU0FBU3pCLG1CQUFtQixDQUFDM0IsT0FBd0IsRUFBbUI7RUFDdEU7RUFDQTtFQUNBLE1BQU1xRCxlQUFlLEdBQUdyRCxPQUFPLENBQUNzRCxFQUFFLElBQUl0RCxPQUFPO0VBQzdDLE1BQU11RCxjQUFjLEdBQUcsQ0FBQ2QsS0FBVSxFQUFFMUMsTUFBVyxLQUM3Q3NELGVBQWUsQ0FBQ1osS0FBSyxFQUFFMUMsTUFBTSxDQUFDO0VBQ2hDd0QsY0FBYyxDQUFDRCxFQUFFLEdBQUd0RCxPQUFPO0VBQzNCLE9BQU91RCxjQUFjO0FBQ3ZCIn0= |
{ | ||
"name": "@rest-hooks/normalizr", | ||
"version": "9.5.0", | ||
"version": "9.5.1", | ||
"description": "Normalizes and denormalizes JSON according to schema for Redux and Flux applications", | ||
@@ -118,3 +118,3 @@ "homepage": "https://resthooks.io/docs/concepts/normalization", | ||
}, | ||
"gitHead": "26fbbe5cf048e85986b06f35f04d1409c24b6a71" | ||
"gitHead": "8d3be93d44408c4b2b565486df25a30df543f21f" | ||
} |
Sorry, the diff of this file is not supported yet
4192
385142