Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rest-hooks/normalizr

Package Overview
Dependencies
Maintainers
2
Versions
126
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rest-hooks/normalizr - npm Package Compare versions

Comparing version 9.3.7 to 9.4.0

161

dist/normalizr.amd.js

@@ -347,2 +347,3 @@ define(['exports'], (function (exports) { 'use strict';

var _s = $RefreshSig$();
const visit = (value, parent, key, schema, addEntity, visitedEntities) => {

@@ -365,89 +366,93 @@ if (!value || !schema) {

};
const addEntities = (entities, indexes, existingEntities, existingIndexes, entityMeta, meta) => {
var _s = $RefreshSig$();
return _s((schema, processedEntity, id) => {
_s();
const schemaKey = schema.key;
if (!(schemaKey in entities)) {
entities[schemaKey] = {};
existingEntities[schemaKey] = Object.assign({}, existingEntities[schemaKey]);
entityMeta[schemaKey] = Object.assign({}, entityMeta[schemaKey]);
}
const existingEntity = entities[schemaKey][id];
if (existingEntity) {
entities[schemaKey][id] = schema.merge(existingEntity, processedEntity);
const addEntities = (entities, indexes, existingEntities, existingIndexes, entityMeta, meta) => (schema, processedEntity, id) => {
const schemaKey = schema.key;
if (!(schemaKey in entities)) {
entities[schemaKey] = {};
existingEntities[schemaKey] = Object.assign({}, existingEntities[schemaKey]);
entityMeta[schemaKey] = Object.assign({}, entityMeta[schemaKey]);
}
const existingEntity = entities[schemaKey][id];
if (existingEntity) {
entities[schemaKey][id] = schema.merge(existingEntity, processedEntity);
} else {
// TODO(breaking): eventually assume this exists and don't check for conditional. probably early 2022
const entityExpiresAt = schema.expiresAt ? schema.expiresAt(meta, processedEntity) : meta.expiresAt;
const inStoreEntity = existingEntities[schemaKey][id];
// this case we already have this entity in store
if (inStoreEntity) {
var _inStoreMeta$date, _meta$fetchedAt, _inStoreMeta$fetchedA;
const inStoreMeta = entityMeta[schemaKey][id];
entities[schemaKey][id] = schema.mergeWithStore ? schema.mergeWithStore(inStoreMeta, meta, inStoreEntity, processedEntity) : mergeWithStore(schema, inStoreMeta, meta, inStoreEntity, processedEntity);
entityMeta[schemaKey][id] = {
expiresAt: Math.max(entityExpiresAt, inStoreMeta == null ? void 0 : inStoreMeta.expiresAt),
date: Math.max(meta.date, (_inStoreMeta$date = inStoreMeta == null ? void 0 : inStoreMeta.date) != null ? _inStoreMeta$date : 0),
fetchedAt: Math.max((_meta$fetchedAt = meta.fetchedAt) != null ? _meta$fetchedAt : 0, (_inStoreMeta$fetchedA = inStoreMeta == null ? void 0 : inStoreMeta.fetchedAt) != null ? _inStoreMeta$fetchedA : 0)
};
} else {
// TODO: eventually assume this exists and don't check for conditional. probably early 2022
const entityExpiresAt = schema.expiresAt ? schema.expiresAt(meta, processedEntity) : meta.expiresAt;
const inStoreEntity = existingEntities[schemaKey][id];
// this case we already have this entity in store
if (inStoreEntity) {
var _entityMeta$schemaKey, _entityMeta$schemaKey2, _entityMeta$schemaKey3, _meta$fetchedAt, _entityMeta$schemaKey4, _entityMeta$schemaKey5;
const inStoreMeta = entityMeta[schemaKey][id];
const useIncoming =
// we may have in store but not in meta; so this existance check is still important
!inStoreMeta || (
// useIncoming should not be used with legacy optimistic
schema.useIncoming && meta.fetchedAt ? schema.useIncoming(inStoreMeta, meta, inStoreEntity, processedEntity) : entityMeta[schemaKey][id].date <= meta.date);
if (useIncoming) {
if (typeof processedEntity !== typeof inStoreEntity) {
entities[schemaKey][id] = processedEntity;
} else {
entities[schemaKey][id] = schema.merge(inStoreEntity, processedEntity);
}
} else {
entities[schemaKey][id] = inStoreEntity;
}
entityMeta[schemaKey][id] = {
expiresAt: Math.max(entityExpiresAt, (_entityMeta$schemaKey = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey.expiresAt),
date: Math.max(meta.date, (_entityMeta$schemaKey2 = (_entityMeta$schemaKey3 = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey3.date) != null ? _entityMeta$schemaKey2 : 0),
fetchedAt: Math.max((_meta$fetchedAt = meta.fetchedAt) != null ? _meta$fetchedAt : 0, (_entityMeta$schemaKey4 = (_entityMeta$schemaKey5 = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey5.fetchedAt) != null ? _entityMeta$schemaKey4 : 0)
};
} else {
var _meta$fetchedAt2;
entities[schemaKey][id] = processedEntity;
entityMeta[schemaKey][id] = {
expiresAt: entityExpiresAt,
date: meta.date,
fetchedAt: (_meta$fetchedAt2 = meta.fetchedAt) != null ? _meta$fetchedAt2 : meta.date
};
}
var _meta$fetchedAt2;
entities[schemaKey][id] = processedEntity;
entityMeta[schemaKey][id] = {
expiresAt: entityExpiresAt,
date: meta.date,
fetchedAt: (_meta$fetchedAt2 = meta.fetchedAt) != null ? _meta$fetchedAt2 : meta.date
};
}
}
// update index
if (Array.isArray(schema.indexes)) {
const entity = entities[schemaKey][id];
if (!(schemaKey in indexes)) {
indexes[schemaKey] = {};
existingIndexes[schemaKey] = Object.assign({}, existingIndexes[schemaKey]);
// update index
if (Array.isArray(schema.indexes)) {
const entity = entities[schemaKey][id];
if (!(schemaKey in indexes)) {
indexes[schemaKey] = {};
existingIndexes[schemaKey] = Object.assign({}, existingIndexes[schemaKey]);
}
for (const index of schema.indexes) {
if (!(index in indexes[schemaKey])) {
existingIndexes[schemaKey][index] = indexes[schemaKey][index] = {};
}
for (const index of schema.indexes) {
if (!(index in indexes[schemaKey])) {
existingIndexes[schemaKey][index] = indexes[schemaKey][index] = {};
}
const indexMap = indexes[schemaKey][index];
if (existingEntity) {
delete indexMap[existingEntity[index]];
}
// entity already in cache but the index changed
if (existingEntities[schemaKey] && existingEntities[schemaKey][id] && existingEntities[schemaKey][id][index] !== entity[index]) {
indexMap[existingEntities[schemaKey][id][index]] = DELETED;
}
if (index in entity) {
indexMap[entity[index]] = id;
} /* istanbul ignore next */else if (
// eslint-disable-next-line no-undef
process.env.NODE_ENV !== 'production') {
console.warn(`Index not found in entity. Indexes must be top-level members of your entity.
const indexMap = indexes[schemaKey][index];
if (existingEntity) {
delete indexMap[existingEntity[index]];
}
// entity already in cache but the index changed
if (existingEntities[schemaKey] && existingEntities[schemaKey][id] && existingEntities[schemaKey][id][index] !== entity[index]) {
indexMap[existingEntities[schemaKey][id][index]] = DELETED;
}
if (index in entity) {
indexMap[entity[index]] = id;
} /* istanbul ignore next */else if (
// eslint-disable-next-line no-undef
process.env.NODE_ENV !== 'production') {
console.warn(`Index not found in entity. Indexes must be top-level members of your entity.
Index: ${index}
Entity: ${JSON.stringify(entity, undefined, 2)}`);
}
}
}
// set this after index updates so we know what indexes to remove from
existingEntities[schemaKey][id] = entities[schemaKey][id];
}, "RSHyr3aBwsmLX8s7SwDQGEQTEhQ=", false, function () {
return [schema.useIncoming];
});
}
// set this after index updates so we know what indexes to remove from
existingEntities[schemaKey][id] = entities[schemaKey][id];
};
// TODO(breaking): remove this in 2 breaking releases
/** @deprecated use Entity.mergeStore() instead */
function mergeWithStore(schema, existingMeta, incomingMeta, existing, incoming) {
_s();
const useIncoming =
// we may have in store but not in meta; so this existance check is still important
!existingMeta || (
// useIncoming should not be used with legacy optimistic
schema.useIncoming && incomingMeta.fetchedAt ? schema.useIncoming(existingMeta, incomingMeta, existing, incoming) : existingMeta.date <= incomingMeta.date);
if (useIncoming) {
if (typeof incoming !== typeof existing) {
return incoming;
} else {
return schema.merge(existing, incoming);
}
} else {
return existing;
}
}
_s(mergeWithStore, "RSHyr3aBwsmLX8s7SwDQGEQTEhQ=", false, function () {
return [schema.useIncoming];
});
function expectedSchemaType(schema) {

@@ -454,0 +459,0 @@ return ['object', 'function'].includes(typeof schema) ? 'object' : typeof schema;

@@ -348,2 +348,3 @@ var rest_hooks_normalizr = (function (exports) {

var _s = $RefreshSig$();
const visit = (value, parent, key, schema, addEntity, visitedEntities) => {

@@ -366,89 +367,93 @@ if (!value || !schema) {

};
const addEntities = (entities, indexes, existingEntities, existingIndexes, entityMeta, meta) => {
var _s = $RefreshSig$();
return _s((schema, processedEntity, id) => {
_s();
const schemaKey = schema.key;
if (!(schemaKey in entities)) {
entities[schemaKey] = {};
existingEntities[schemaKey] = Object.assign({}, existingEntities[schemaKey]);
entityMeta[schemaKey] = Object.assign({}, entityMeta[schemaKey]);
}
const existingEntity = entities[schemaKey][id];
if (existingEntity) {
entities[schemaKey][id] = schema.merge(existingEntity, processedEntity);
const addEntities = (entities, indexes, existingEntities, existingIndexes, entityMeta, meta) => (schema, processedEntity, id) => {
const schemaKey = schema.key;
if (!(schemaKey in entities)) {
entities[schemaKey] = {};
existingEntities[schemaKey] = Object.assign({}, existingEntities[schemaKey]);
entityMeta[schemaKey] = Object.assign({}, entityMeta[schemaKey]);
}
const existingEntity = entities[schemaKey][id];
if (existingEntity) {
entities[schemaKey][id] = schema.merge(existingEntity, processedEntity);
} else {
// TODO(breaking): eventually assume this exists and don't check for conditional. probably early 2022
const entityExpiresAt = schema.expiresAt ? schema.expiresAt(meta, processedEntity) : meta.expiresAt;
const inStoreEntity = existingEntities[schemaKey][id];
// this case we already have this entity in store
if (inStoreEntity) {
var _inStoreMeta$date, _meta$fetchedAt, _inStoreMeta$fetchedA;
const inStoreMeta = entityMeta[schemaKey][id];
entities[schemaKey][id] = schema.mergeWithStore ? schema.mergeWithStore(inStoreMeta, meta, inStoreEntity, processedEntity) : mergeWithStore(schema, inStoreMeta, meta, inStoreEntity, processedEntity);
entityMeta[schemaKey][id] = {
expiresAt: Math.max(entityExpiresAt, inStoreMeta == null ? void 0 : inStoreMeta.expiresAt),
date: Math.max(meta.date, (_inStoreMeta$date = inStoreMeta == null ? void 0 : inStoreMeta.date) != null ? _inStoreMeta$date : 0),
fetchedAt: Math.max((_meta$fetchedAt = meta.fetchedAt) != null ? _meta$fetchedAt : 0, (_inStoreMeta$fetchedA = inStoreMeta == null ? void 0 : inStoreMeta.fetchedAt) != null ? _inStoreMeta$fetchedA : 0)
};
} else {
// TODO: eventually assume this exists and don't check for conditional. probably early 2022
const entityExpiresAt = schema.expiresAt ? schema.expiresAt(meta, processedEntity) : meta.expiresAt;
const inStoreEntity = existingEntities[schemaKey][id];
// this case we already have this entity in store
if (inStoreEntity) {
var _entityMeta$schemaKey, _entityMeta$schemaKey2, _entityMeta$schemaKey3, _meta$fetchedAt, _entityMeta$schemaKey4, _entityMeta$schemaKey5;
const inStoreMeta = entityMeta[schemaKey][id];
const useIncoming =
// we may have in store but not in meta; so this existance check is still important
!inStoreMeta || (
// useIncoming should not be used with legacy optimistic
schema.useIncoming && meta.fetchedAt ? schema.useIncoming(inStoreMeta, meta, inStoreEntity, processedEntity) : entityMeta[schemaKey][id].date <= meta.date);
if (useIncoming) {
if (typeof processedEntity !== typeof inStoreEntity) {
entities[schemaKey][id] = processedEntity;
} else {
entities[schemaKey][id] = schema.merge(inStoreEntity, processedEntity);
}
} else {
entities[schemaKey][id] = inStoreEntity;
}
entityMeta[schemaKey][id] = {
expiresAt: Math.max(entityExpiresAt, (_entityMeta$schemaKey = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey.expiresAt),
date: Math.max(meta.date, (_entityMeta$schemaKey2 = (_entityMeta$schemaKey3 = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey3.date) != null ? _entityMeta$schemaKey2 : 0),
fetchedAt: Math.max((_meta$fetchedAt = meta.fetchedAt) != null ? _meta$fetchedAt : 0, (_entityMeta$schemaKey4 = (_entityMeta$schemaKey5 = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey5.fetchedAt) != null ? _entityMeta$schemaKey4 : 0)
};
} else {
var _meta$fetchedAt2;
entities[schemaKey][id] = processedEntity;
entityMeta[schemaKey][id] = {
expiresAt: entityExpiresAt,
date: meta.date,
fetchedAt: (_meta$fetchedAt2 = meta.fetchedAt) != null ? _meta$fetchedAt2 : meta.date
};
}
var _meta$fetchedAt2;
entities[schemaKey][id] = processedEntity;
entityMeta[schemaKey][id] = {
expiresAt: entityExpiresAt,
date: meta.date,
fetchedAt: (_meta$fetchedAt2 = meta.fetchedAt) != null ? _meta$fetchedAt2 : meta.date
};
}
}
// update index
if (Array.isArray(schema.indexes)) {
const entity = entities[schemaKey][id];
if (!(schemaKey in indexes)) {
indexes[schemaKey] = {};
existingIndexes[schemaKey] = Object.assign({}, existingIndexes[schemaKey]);
// update index
if (Array.isArray(schema.indexes)) {
const entity = entities[schemaKey][id];
if (!(schemaKey in indexes)) {
indexes[schemaKey] = {};
existingIndexes[schemaKey] = Object.assign({}, existingIndexes[schemaKey]);
}
for (const index of schema.indexes) {
if (!(index in indexes[schemaKey])) {
existingIndexes[schemaKey][index] = indexes[schemaKey][index] = {};
}
for (const index of schema.indexes) {
if (!(index in indexes[schemaKey])) {
existingIndexes[schemaKey][index] = indexes[schemaKey][index] = {};
}
const indexMap = indexes[schemaKey][index];
if (existingEntity) {
delete indexMap[existingEntity[index]];
}
// entity already in cache but the index changed
if (existingEntities[schemaKey] && existingEntities[schemaKey][id] && existingEntities[schemaKey][id][index] !== entity[index]) {
indexMap[existingEntities[schemaKey][id][index]] = DELETED;
}
if (index in entity) {
indexMap[entity[index]] = id;
} /* istanbul ignore next */else if (
// eslint-disable-next-line no-undef
process.env.NODE_ENV !== 'production') {
console.warn(`Index not found in entity. Indexes must be top-level members of your entity.
const indexMap = indexes[schemaKey][index];
if (existingEntity) {
delete indexMap[existingEntity[index]];
}
// entity already in cache but the index changed
if (existingEntities[schemaKey] && existingEntities[schemaKey][id] && existingEntities[schemaKey][id][index] !== entity[index]) {
indexMap[existingEntities[schemaKey][id][index]] = DELETED;
}
if (index in entity) {
indexMap[entity[index]] = id;
} /* istanbul ignore next */else if (
// eslint-disable-next-line no-undef
process.env.NODE_ENV !== 'production') {
console.warn(`Index not found in entity. Indexes must be top-level members of your entity.
Index: ${index}
Entity: ${JSON.stringify(entity, undefined, 2)}`);
}
}
}
// set this after index updates so we know what indexes to remove from
existingEntities[schemaKey][id] = entities[schemaKey][id];
}, "RSHyr3aBwsmLX8s7SwDQGEQTEhQ=", false, function () {
return [schema.useIncoming];
});
}
// set this after index updates so we know what indexes to remove from
existingEntities[schemaKey][id] = entities[schemaKey][id];
};
// TODO(breaking): remove this in 2 breaking releases
/** @deprecated use Entity.mergeStore() instead */
function mergeWithStore(schema, existingMeta, incomingMeta, existing, incoming) {
_s();
const useIncoming =
// we may have in store but not in meta; so this existance check is still important
!existingMeta || (
// useIncoming should not be used with legacy optimistic
schema.useIncoming && incomingMeta.fetchedAt ? schema.useIncoming(existingMeta, incomingMeta, existing, incoming) : existingMeta.date <= incomingMeta.date);
if (useIncoming) {
if (typeof incoming !== typeof existing) {
return incoming;
} else {
return schema.merge(existing, incoming);
}
} else {
return existing;
}
}
_s(mergeWithStore, "RSHyr3aBwsmLX8s7SwDQGEQTEhQ=", false, function () {
return [schema.useIncoming];
});
function expectedSchemaType(schema) {

@@ -455,0 +460,0 @@ return ['object', 'function'].includes(typeof schema) ? 'object' : typeof schema;

@@ -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 y=Symbol("draft"),p=(e,t,n,r,o,i,c,u)=>{const a=r(e,t);if("symbol"==typeof a&&a.toString().includes("DELETED"))return[void 0,!0,!0];if("object"!=typeof a||null===a)return[a,!1,!1];const l="string"==typeof e?e:t.pk(s(a)?a.toJS():a);if(void 0===l||""===l)return[a,!1,!1];void 0===o[t.key]&&(o[t.key]=Object.create(null));let f=!0,p=!1;if(o[t.key][l]){if(Object.hasOwn(o[t.key][l],y))return u.i=o[t.key][l].i,[o[t.key][l][y],f,p];c.push(a)}else{const e=c.length;c.push(a);const r=function(e){const t=e.og||e,n=(e,n)=>t(e,n);return n.og=e,n}(n);r.setLocal=n=>o[t.key][l]={[y]:n,i:e};const s=function(e,t,n){e[t.key]||(e[t.key]={});e[t.key][n]||(e[t.key][n]=new d);return e[t.key][n]}(i,t,l);[o[t.key][l],f,p]=t.denormalize(a,r);const h=c.slice(-1===u.i?e:u.i);s.has(h)?o[t.key][l]=s.get(h):s.set(h,o[t.key][l]),u.i===e&&(u.i=-1)}return[o[t.key][l],f,p]},h=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]}},g=(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=h(t),c=[],a={i:-1};function l(t,r){if(!r)return[t,!0,!1];if(null===t)return[t,!0,!1];const f="function"==typeof r.denormalize;return f||"function"!=typeof r?void 0===t?[t,!1,!1]:f||"object"!=typeof r?e(r)?p(t,r,l,s,i,n,c,a):f?r.denormalize(t,l):[t,!0,!1]:(Array.isArray(r)?o:u)(r,t,l):t instanceof r||void 0===t?[t,!0,!1]:[new r(t),!0,!1]}return(e,t)=>{const n=l(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 b=Symbol("ENTITY WAS DELETED"),v=(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,v,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,v,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,y,p,h,g;const n=o[a][u],l=!n||(s.useIncoming&&i.fetchedAt?s.useIncoming(n,i,r,c):o[a][u].date<=i.date);e[a][u]=l?typeof c!=typeof r?c:s.merge(r,c):r,o[a][u]={expiresAt:Math.max(t,null==(f=o[a][u])?void 0:f.expiresAt),date:Math.max(i.date,null!=(d=null==(y=o[a][u])?void 0:y.date)?d:0),fetchedAt:Math.max(null!=(p=i.fetchedAt)?p:0,null!=(h=null==(g=o[a][u])?void 0:g.fetchedAt)?h:0)}}else{var v;e[a][u]=c,o[a][u]={expiresAt:t,date:i.date,fetchedAt:null!=(v=i.fetchedAt)?v: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]]=b),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:v(e,e,void 0,t,l,{}),entityMeta:a}};function O(e,t,n,r={}){if(function(e){return!!e&&"function"==typeof e.infer}(e))return e.infer(t,n,O,r);if("object"==typeof e&&e){return(Array.isArray(e)?i:a)(e,t,n,O,r)}return e}var j={Invalid:1,InvalidIfStale:2,Valid:3};Object.hasOwn=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};export{b as DELETED,j as ExpiryStatus,d as WeakListMap,g as denormalize,O 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 y=Symbol("draft"),p=(e,t,n,r,o,i,c,u)=>{const a=r(e,t);if("symbol"==typeof a&&a.toString().includes("DELETED"))return[void 0,!0,!0];if("object"!=typeof a||null===a)return[a,!1,!1];const l="string"==typeof e?e:t.pk(s(a)?a.toJS():a);if(void 0===l||""===l)return[a,!1,!1];void 0===o[t.key]&&(o[t.key]=Object.create(null));let f=!0,p=!1;if(o[t.key][l]){if(Object.hasOwn(o[t.key][l],y))return u.i=o[t.key][l].i,[o[t.key][l][y],f,p];c.push(a)}else{const e=c.length;c.push(a);const r=function(e){const t=e.og||e,n=(e,n)=>t(e,n);return n.og=e,n}(n);r.setLocal=n=>o[t.key][l]={[y]:n,i:e};const s=function(e,t,n){e[t.key]||(e[t.key]={});e[t.key][n]||(e[t.key][n]=new d);return e[t.key][n]}(i,t,l);[o[t.key][l],f,p]=t.denormalize(a,r);const h=c.slice(-1===u.i?e:u.i);s.has(h)?o[t.key][l]=s.get(h):s.set(h,o[t.key][l]),u.i===e&&(u.i=-1)}return[o[t.key][l],f,p]},h=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]}},g=(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=h(t),c=[],a={i:-1};function l(t,r){if(!r)return[t,!0,!1];if(null===t)return[t,!0,!1];const f="function"==typeof r.denormalize;return f||"function"!=typeof r?void 0===t?[t,!1,!1]:f||"object"!=typeof r?e(r)?p(t,r,l,s,i,n,c,a):f?r.denormalize(t,l):[t,!0,!1]:(Array.isArray(r)?o:u)(r,t,l):t instanceof r||void 0===t?[t,!0,!1]:[new r(t),!0,!1]}return(e,t)=>{const n=l(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 m=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 v=(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,y;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!=(y=null==n?void 0:n.fetchedAt)?y:0)}}else{var p;e[a][u]=c,o[a][u]={expiresAt:t,date:i.date,fetchedAt:null!=(p=i.fetchedAt)?p: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]]=m),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 O(e,t,n,r={}){if(function(e){return!!e&&"function"==typeof e.infer}(e))return e.infer(t,n,O,r);if("object"==typeof e&&e){return(Array.isArray(e)?i:a)(e,t,n,O,r)}return e}var j={Invalid:1,InvalidIfStale:2,Valid:3};Object.hasOwn=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};export{m as DELETED,j as ExpiryStatus,d as WeakListMap,g as denormalize,O as inferResults,e as isEntity,v as normalize};

@@ -385,3 +385,3 @@ 'use strict';

} else {
// TODO: eventually assume this exists and don't check for conditional. probably early 2022
// TODO(breaking): eventually assume this exists and don't check for conditional. probably early 2022
const entityExpiresAt = schema.expiresAt ? schema.expiresAt(meta, processedEntity) : meta.expiresAt;

@@ -391,22 +391,9 @@ const inStoreEntity = existingEntities[schemaKey][id];

if (inStoreEntity) {
var _entityMeta$schemaKey, _entityMeta$schemaKey2, _entityMeta$schemaKey3, _meta$fetchedAt, _entityMeta$schemaKey4, _entityMeta$schemaKey5;
var _inStoreMeta$date, _meta$fetchedAt, _inStoreMeta$fetchedA;
const inStoreMeta = entityMeta[schemaKey][id];
const useIncoming =
// we may have in store but not in meta; so this existance check is still important
!inStoreMeta || (
// useIncoming should not be used with legacy optimistic
schema.useIncoming && meta.fetchedAt ? schema.useIncoming(inStoreMeta, meta, inStoreEntity, processedEntity) : entityMeta[schemaKey][id].date <= meta.date);
if (useIncoming) {
if (typeof processedEntity !== typeof inStoreEntity) {
entities[schemaKey][id] = processedEntity;
} else {
entities[schemaKey][id] = schema.merge(inStoreEntity, processedEntity);
}
} else {
entities[schemaKey][id] = inStoreEntity;
}
entities[schemaKey][id] = schema.mergeWithStore ? schema.mergeWithStore(inStoreMeta, meta, inStoreEntity, processedEntity) : mergeWithStore(schema, inStoreMeta, meta, inStoreEntity, processedEntity);
entityMeta[schemaKey][id] = {
expiresAt: Math.max(entityExpiresAt, (_entityMeta$schemaKey = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey.expiresAt),
date: Math.max(meta.date, (_entityMeta$schemaKey2 = (_entityMeta$schemaKey3 = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey3.date) != null ? _entityMeta$schemaKey2 : 0),
fetchedAt: Math.max((_meta$fetchedAt = meta.fetchedAt) != null ? _meta$fetchedAt : 0, (_entityMeta$schemaKey4 = (_entityMeta$schemaKey5 = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey5.fetchedAt) != null ? _entityMeta$schemaKey4 : 0)
expiresAt: Math.max(entityExpiresAt, inStoreMeta == null ? void 0 : inStoreMeta.expiresAt),
date: Math.max(meta.date, (_inStoreMeta$date = inStoreMeta == null ? void 0 : inStoreMeta.date) != null ? _inStoreMeta$date : 0),
fetchedAt: Math.max((_meta$fetchedAt = meta.fetchedAt) != null ? _meta$fetchedAt : 0, (_inStoreMeta$fetchedA = inStoreMeta == null ? void 0 : inStoreMeta.fetchedAt) != null ? _inStoreMeta$fetchedA : 0)
};

@@ -459,2 +446,21 @@ } else {

};
// TODO(breaking): remove this in 2 breaking releases
/** @deprecated use Entity.mergeStore() instead */
function mergeWithStore(schema, existingMeta, incomingMeta, existing, incoming) {
const useIncoming =
// we may have in store but not in meta; so this existance check is still important
!existingMeta || (
// useIncoming should not be used with legacy optimistic
schema.useIncoming && incomingMeta.fetchedAt ? schema.useIncoming(existingMeta, incomingMeta, existing, incoming) : existingMeta.date <= incomingMeta.date);
if (useIncoming) {
if (typeof incoming !== typeof existing) {
return incoming;
} else {
return schema.merge(existing, incoming);
}
} else {
return existing;
}
}
function expectedSchemaType(schema) {

@@ -461,0 +467,0 @@ return ['object', 'function'].includes(typeof schema) ? 'object' : typeof schema;

@@ -351,2 +351,3 @@ (function (global, factory) {

var _s = $RefreshSig$();
const visit = (value, parent, key, schema, addEntity, visitedEntities) => {

@@ -369,89 +370,93 @@ if (!value || !schema) {

};
const addEntities = (entities, indexes, existingEntities, existingIndexes, entityMeta, meta) => {
var _s = $RefreshSig$();
return _s((schema, processedEntity, id) => {
_s();
const schemaKey = schema.key;
if (!(schemaKey in entities)) {
entities[schemaKey] = {};
existingEntities[schemaKey] = Object.assign({}, existingEntities[schemaKey]);
entityMeta[schemaKey] = Object.assign({}, entityMeta[schemaKey]);
}
const existingEntity = entities[schemaKey][id];
if (existingEntity) {
entities[schemaKey][id] = schema.merge(existingEntity, processedEntity);
const addEntities = (entities, indexes, existingEntities, existingIndexes, entityMeta, meta) => (schema, processedEntity, id) => {
const schemaKey = schema.key;
if (!(schemaKey in entities)) {
entities[schemaKey] = {};
existingEntities[schemaKey] = Object.assign({}, existingEntities[schemaKey]);
entityMeta[schemaKey] = Object.assign({}, entityMeta[schemaKey]);
}
const existingEntity = entities[schemaKey][id];
if (existingEntity) {
entities[schemaKey][id] = schema.merge(existingEntity, processedEntity);
} else {
// TODO(breaking): eventually assume this exists and don't check for conditional. probably early 2022
const entityExpiresAt = schema.expiresAt ? schema.expiresAt(meta, processedEntity) : meta.expiresAt;
const inStoreEntity = existingEntities[schemaKey][id];
// this case we already have this entity in store
if (inStoreEntity) {
var _inStoreMeta$date, _meta$fetchedAt, _inStoreMeta$fetchedA;
const inStoreMeta = entityMeta[schemaKey][id];
entities[schemaKey][id] = schema.mergeWithStore ? schema.mergeWithStore(inStoreMeta, meta, inStoreEntity, processedEntity) : mergeWithStore(schema, inStoreMeta, meta, inStoreEntity, processedEntity);
entityMeta[schemaKey][id] = {
expiresAt: Math.max(entityExpiresAt, inStoreMeta == null ? void 0 : inStoreMeta.expiresAt),
date: Math.max(meta.date, (_inStoreMeta$date = inStoreMeta == null ? void 0 : inStoreMeta.date) != null ? _inStoreMeta$date : 0),
fetchedAt: Math.max((_meta$fetchedAt = meta.fetchedAt) != null ? _meta$fetchedAt : 0, (_inStoreMeta$fetchedA = inStoreMeta == null ? void 0 : inStoreMeta.fetchedAt) != null ? _inStoreMeta$fetchedA : 0)
};
} else {
// TODO: eventually assume this exists and don't check for conditional. probably early 2022
const entityExpiresAt = schema.expiresAt ? schema.expiresAt(meta, processedEntity) : meta.expiresAt;
const inStoreEntity = existingEntities[schemaKey][id];
// this case we already have this entity in store
if (inStoreEntity) {
var _entityMeta$schemaKey, _entityMeta$schemaKey2, _entityMeta$schemaKey3, _meta$fetchedAt, _entityMeta$schemaKey4, _entityMeta$schemaKey5;
const inStoreMeta = entityMeta[schemaKey][id];
const useIncoming =
// we may have in store but not in meta; so this existance check is still important
!inStoreMeta || (
// useIncoming should not be used with legacy optimistic
schema.useIncoming && meta.fetchedAt ? schema.useIncoming(inStoreMeta, meta, inStoreEntity, processedEntity) : entityMeta[schemaKey][id].date <= meta.date);
if (useIncoming) {
if (typeof processedEntity !== typeof inStoreEntity) {
entities[schemaKey][id] = processedEntity;
} else {
entities[schemaKey][id] = schema.merge(inStoreEntity, processedEntity);
}
} else {
entities[schemaKey][id] = inStoreEntity;
}
entityMeta[schemaKey][id] = {
expiresAt: Math.max(entityExpiresAt, (_entityMeta$schemaKey = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey.expiresAt),
date: Math.max(meta.date, (_entityMeta$schemaKey2 = (_entityMeta$schemaKey3 = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey3.date) != null ? _entityMeta$schemaKey2 : 0),
fetchedAt: Math.max((_meta$fetchedAt = meta.fetchedAt) != null ? _meta$fetchedAt : 0, (_entityMeta$schemaKey4 = (_entityMeta$schemaKey5 = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey5.fetchedAt) != null ? _entityMeta$schemaKey4 : 0)
};
} else {
var _meta$fetchedAt2;
entities[schemaKey][id] = processedEntity;
entityMeta[schemaKey][id] = {
expiresAt: entityExpiresAt,
date: meta.date,
fetchedAt: (_meta$fetchedAt2 = meta.fetchedAt) != null ? _meta$fetchedAt2 : meta.date
};
}
var _meta$fetchedAt2;
entities[schemaKey][id] = processedEntity;
entityMeta[schemaKey][id] = {
expiresAt: entityExpiresAt,
date: meta.date,
fetchedAt: (_meta$fetchedAt2 = meta.fetchedAt) != null ? _meta$fetchedAt2 : meta.date
};
}
}
// update index
if (Array.isArray(schema.indexes)) {
const entity = entities[schemaKey][id];
if (!(schemaKey in indexes)) {
indexes[schemaKey] = {};
existingIndexes[schemaKey] = Object.assign({}, existingIndexes[schemaKey]);
// update index
if (Array.isArray(schema.indexes)) {
const entity = entities[schemaKey][id];
if (!(schemaKey in indexes)) {
indexes[schemaKey] = {};
existingIndexes[schemaKey] = Object.assign({}, existingIndexes[schemaKey]);
}
for (const index of schema.indexes) {
if (!(index in indexes[schemaKey])) {
existingIndexes[schemaKey][index] = indexes[schemaKey][index] = {};
}
for (const index of schema.indexes) {
if (!(index in indexes[schemaKey])) {
existingIndexes[schemaKey][index] = indexes[schemaKey][index] = {};
}
const indexMap = indexes[schemaKey][index];
if (existingEntity) {
delete indexMap[existingEntity[index]];
}
// entity already in cache but the index changed
if (existingEntities[schemaKey] && existingEntities[schemaKey][id] && existingEntities[schemaKey][id][index] !== entity[index]) {
indexMap[existingEntities[schemaKey][id][index]] = DELETED;
}
if (index in entity) {
indexMap[entity[index]] = id;
} /* istanbul ignore next */else if (
// eslint-disable-next-line no-undef
process.env.NODE_ENV !== 'production') {
console.warn(`Index not found in entity. Indexes must be top-level members of your entity.
const indexMap = indexes[schemaKey][index];
if (existingEntity) {
delete indexMap[existingEntity[index]];
}
// entity already in cache but the index changed
if (existingEntities[schemaKey] && existingEntities[schemaKey][id] && existingEntities[schemaKey][id][index] !== entity[index]) {
indexMap[existingEntities[schemaKey][id][index]] = DELETED;
}
if (index in entity) {
indexMap[entity[index]] = id;
} /* istanbul ignore next */else if (
// eslint-disable-next-line no-undef
process.env.NODE_ENV !== 'production') {
console.warn(`Index not found in entity. Indexes must be top-level members of your entity.
Index: ${index}
Entity: ${JSON.stringify(entity, undefined, 2)}`);
}
}
}
// set this after index updates so we know what indexes to remove from
existingEntities[schemaKey][id] = entities[schemaKey][id];
}, "RSHyr3aBwsmLX8s7SwDQGEQTEhQ=", false, function () {
return [schema.useIncoming];
});
}
// set this after index updates so we know what indexes to remove from
existingEntities[schemaKey][id] = entities[schemaKey][id];
};
// TODO(breaking): remove this in 2 breaking releases
/** @deprecated use Entity.mergeStore() instead */
function mergeWithStore(schema, existingMeta, incomingMeta, existing, incoming) {
_s();
const useIncoming =
// we may have in store but not in meta; so this existance check is still important
!existingMeta || (
// useIncoming should not be used with legacy optimistic
schema.useIncoming && incomingMeta.fetchedAt ? schema.useIncoming(existingMeta, incomingMeta, existing, incoming) : existingMeta.date <= incomingMeta.date);
if (useIncoming) {
if (typeof incoming !== typeof existing) {
return incoming;
} else {
return schema.merge(existing, incoming);
}
} else {
return existing;
}
}
_s(mergeWithStore, "RSHyr3aBwsmLX8s7SwDQGEQTEhQ=", false, function () {
return [schema.useIncoming];
});
function expectedSchemaType(schema) {

@@ -458,0 +463,0 @@ return ['object', 'function'].includes(typeof schema) ? 'object' : typeof schema;

export {};
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiLi4vc3JjL2ludGVyZmFjZS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBBYnN0cmFjdEluc3RhbmNlVHlwZSwgRGVub3JtYWxpemUsIEVudGl0eU1hcCB9IGZyb20gJy4vdHlwZXMuanMnO1xuXG5leHBvcnQgdHlwZSBTY2hlbWEgPVxuICB8IG51bGxcbiAgfCBzdHJpbmdcbiAgfCB7IFtLOiBzdHJpbmddOiBhbnkgfVxuICB8IFNjaGVtYVtdXG4gIHwgU2NoZW1hU2ltcGxlXG4gIHwgU2VyaWFsaXphYmxlO1xuXG5leHBvcnQgdHlwZSBTZXJpYWxpemFibGU8XG4gIFQgZXh0ZW5kcyB7IHRvSlNPTigpOiBzdHJpbmcgfSA9IHsgdG9KU09OKCk6IHN0cmluZyB9LFxuPiA9IHtcbiAgcHJvdG90eXBlOiBUO1xufTtcblxuZXhwb3J0IGludGVyZmFjZSBTY2hlbWFTaW1wbGU8VCA9IGFueT4ge1xuICBub3JtYWxpemUoXG4gICAgaW5wdXQ6IGFueSxcbiAgICBwYXJlbnQ6IGFueSxcbiAgICBrZXk6IGFueSxcbiAgICB2aXNpdDogKC4uLmFyZ3M6IGFueSkgPT4gYW55LFxuICAgIGFkZEVudGl0eTogKC4uLmFyZ3M6IGFueSkgPT4gYW55LFxuICAgIHZpc2l0ZWRF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lzdGluZ01ldGE6IGFueSxcbiAgICBpbmNvbWluZ01ldGE6IGFueSxcbiAgICBleGlzdGluZzogYW55LFxuICAgIGluY29taW5nOiBhbnksXG4gICk6IGFueTtcbiAgLy8gVE9ETyhicmVha2luZyk6IGRlcHJlY2F0ZSB0aGlzXG4gIHVzZUluY29taW5nPyhcbiAgICBleGlzdGluZ01ldGE6IGFueSxcbiAgICBpbmNvbWluZ01ldGE6IGFueSxcbiAgICBleGlzdGluZzogYW55LFxuICAgIGluY29taW5nOiBhbnksXG4gICk6IGJvb2xlYW47XG4gIGluZGV4ZXM/OiBhbnk7XG4gIHNjaGVtYTogUmVjb3JkPHN0cmluZywgU2NoZW1hPjtcbiAgcHJvdG90eXBlOiBUO1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIFVudmlzaXRGdW5jdGlvbiB7XG4gIChpbnB1dDogYW55LCBzY2hlbWE6IGFueSk6IFthbnksIGJvb2xlYW4sIGJvb2xlYW5dO1xuICBvZz86IFVudmlzaXRGdW5jdGlvbjtcbiAgc2V0TG9jYWw/OiAoZW50aXR5OiBhbnkpID0+IHZvaWQ7XG59XG5cbmV4cG9ydCBpbnRlcmZhY2UgTm9ybWFsaXplZEluZGV4IHtcbiAgcmVhZG9ubHkgW2VudGl0eUtleTogc3RyaW5nXToge1xuICAgIHJlYWRvbmx5IFtpbmRleE5hbWU6IHN0cmluZ106IHsgcmVhZG9ubHkgW2xvb2t1cDogc3RyaW5nXTogc3RyaW5nIH07XG4gIH07XG59XG5cbmV4cG9ydCBpbnRlcmZhY2UgRW50aXR5VGFibGUge1xuICBbZW50aXR5S2V5OiBzdHJpbmddOlxuICAgIHwge1xuICAgICAgICBbcGs6IHN0cmluZ106IHVua25vd247XG4gICAgICB9XG4gICAgfCB1bmRlZmluZWQ7XG59XG4iXSwibWFwcGluZ3MiOiIifQ==

@@ -32,3 +32,3 @@ import { normalize as arrayNormalize } from './schemas/Array.js';

} else {
// TODO: eventually assume this exists and don't check for conditional. probably early 2022
// TODO(breaking): eventually assume this exists and don't check for conditional. probably early 2022
const entityExpiresAt = schema.expiresAt ? schema.expiresAt(meta, processedEntity) : meta.expiresAt;

@@ -38,22 +38,9 @@ const inStoreEntity = existingEntities[schemaKey][id];

if (inStoreEntity) {
var _entityMeta$schemaKey, _entityMeta$schemaKey2, _entityMeta$schemaKey3, _meta$fetchedAt, _entityMeta$schemaKey4, _entityMeta$schemaKey5;
var _inStoreMeta$date, _meta$fetchedAt, _inStoreMeta$fetchedA;
const inStoreMeta = entityMeta[schemaKey][id];
const useIncoming =
// we may have in store but not in meta; so this existance check is still important
!inStoreMeta || (
// useIncoming should not be used with legacy optimistic
schema.useIncoming && meta.fetchedAt ? schema.useIncoming(inStoreMeta, meta, inStoreEntity, processedEntity) : entityMeta[schemaKey][id].date <= meta.date);
if (useIncoming) {
if (typeof processedEntity !== typeof inStoreEntity) {
entities[schemaKey][id] = processedEntity;
} else {
entities[schemaKey][id] = schema.merge(inStoreEntity, processedEntity);
}
} else {
entities[schemaKey][id] = inStoreEntity;
}
entities[schemaKey][id] = schema.mergeWithStore ? schema.mergeWithStore(inStoreMeta, meta, inStoreEntity, processedEntity) : mergeWithStore(schema, inStoreMeta, meta, inStoreEntity, processedEntity);
entityMeta[schemaKey][id] = {
expiresAt: Math.max(entityExpiresAt, (_entityMeta$schemaKey = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey.expiresAt),
date: Math.max(meta.date, (_entityMeta$schemaKey2 = (_entityMeta$schemaKey3 = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey3.date) != null ? _entityMeta$schemaKey2 : 0),
fetchedAt: Math.max((_meta$fetchedAt = meta.fetchedAt) != null ? _meta$fetchedAt : 0, (_entityMeta$schemaKey4 = (_entityMeta$schemaKey5 = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey5.fetchedAt) != null ? _entityMeta$schemaKey4 : 0)
expiresAt: Math.max(entityExpiresAt, inStoreMeta == null ? void 0 : inStoreMeta.expiresAt),
date: Math.max(meta.date, (_inStoreMeta$date = inStoreMeta == null ? void 0 : inStoreMeta.date) != null ? _inStoreMeta$date : 0),
fetchedAt: Math.max((_meta$fetchedAt = meta.fetchedAt) != null ? _meta$fetchedAt : 0, (_inStoreMeta$fetchedA = inStoreMeta == null ? void 0 : inStoreMeta.fetchedAt) != null ? _inStoreMeta$fetchedA : 0)
};

@@ -104,2 +91,21 @@ } else {

};
// TODO(breaking): remove this in 2 breaking releases
/** @deprecated use Entity.mergeStore() instead */
function mergeWithStore(schema, existingMeta, incomingMeta, existing, incoming) {
const useIncoming =
// we may have in store but not in meta; so this existance check is still important
!existingMeta || (
// useIncoming should not be used with legacy optimistic
schema.useIncoming && incomingMeta.fetchedAt ? schema.useIncoming(existingMeta, incomingMeta, existing, incoming) : existingMeta.date <= incomingMeta.date);
if (useIncoming) {
if (typeof incoming !== typeof existing) {
return incoming;
} else {
return schema.merge(existing, incoming);
}
} else {
return existing;
}
}
function expectedSchemaType(schema) {

@@ -169,2 +175,2 @@ return ['object', 'function'].includes(typeof schema) ? 'object' : typeof schema;

};
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJub3JtYWxpemUiLCJhcnJheU5vcm1hbGl6ZSIsIm9iamVjdE5vcm1hbGl6ZSIsIkRFTEVURUQiLCJ2aXNpdCIsInZhbHVlIiwicGFyZW50Iiwia2V5Iiwic2NoZW1hIiwiYWRkRW50aXR5IiwidmlzaXRlZEVudGl0aWVzIiwibWV0aG9kIiwiQXJyYXkiLCJpc0FycmF5IiwiYWRkRW50aXRpZXMiLCJlbnRpdGllcyIsImluZGV4ZXMiLCJleGlzdGluZ0VudGl0aWVzIiwiZXhpc3RpbmdJbmRleGVzIiwiZW50aXR5TWV0YSIsIm1ldGEiLCJwcm9jZXNzZWRFbnRpdHkiLCJpZCIsInNjaGVtYUtleSIsImV4aXN0aW5nRW50aXR5IiwibWVyZ2UiLCJlbnRpdH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5jb21pbmcoXG4gICAgICAgICAgICAgICAgaW5TdG9yZU1ldGEsXG4gICAgICAgICAgICAgICAgbWV0YSxcbiAgICAgICAgICAgICAgICBpblN0b3JlRW50aXR5LFxuICAgICAgICAgICAgICAgIHByb2Nlc3NlZEVudGl0eSxcbiAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgOiBlbnRpdHlNZXRhW3NjaGVtYUtleV1baWRdLmRhdGUgPD0gbWV0YS5kYXRlKTtcbiAgICAgICAgaWYgKHVzZUluY29taW5nKSB7XG4gICAgICAgICAgaWYgKHR5cGVvZiBwcm9jZXNzZWRFbnRpdHkgIT09IHR5cGVvZiBpblN0b3JlRW50aXR5KSB7XG4gICAgICAgICAgICBlbnRpdGllc1tzY2hlbWFLZXldW2lkXSA9IHByb2Nlc3NlZEVudGl0eTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZW50aXRpZXNbc2NoZW1hS2V5XVtpZF0gPSBzY2hlbWEubWVyZ2UoXG4gICAgICAgICAgICAgIGluU3RvcmVFbnRpdHksXG4gICAgICAgICAgICAgIHByb2Nlc3NlZEVudGl0eSxcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGVudGl0aWVzW3NjaGVtYUtleV1baWRdID0gaW5TdG9yZUVudGl0eTtcbiAgICAgICAgfVxuXG4gICAgICAgIGVudGl0eU1ldGFbc2NoZW1hS2V5XVtpZF0gPSB7XG4gICAgICAgICAgZXhwaXJlc0F0OiBNYXRoLm1heChcbiAgICAgICAgICAgIGVudGl0eUV4cGlyZXNBdCxcbiAgICAgICAgICAgIGVudGl0eU1ldGFbc2NoZW1hS2V5XVtpZF0/LmV4cGlyZXNBdCxcbiAgICAgICAgICApLFxuICAgICAgICAgIGRhdGU6IE1hdGgubWF4KG1ldGEuZGF0ZSwgZW50aXR5TWV0YVtzY2hlbWFLZXldW2lkXT8uZGF0ZSA/PyAwKSxcbiAgICAgICAgICBm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ICAgICAgY29uc3QgaW5kZXhNYXAgPSBpbmRleGVzW3NjaGVtYUtleV1baW5kZXhdO1xuICAgICAgICBpZiAoZXhpc3RpbmdFbnRpdHkpIHtcbiAgICAgICAgICBkZWxldGUgaW5kZXhNYXBbZXhpc3RpbmdFbnRpdHlbaW5kZXhdXTtcbiAgICAgICAgfVxuICAgICAgICAvLyBlbnRpdHkgYWxyZWFkeSBpbiBjYWNoZSBidXQgdGhlIGluZGV4IGNoYW5nZWRcbiAgICAgICAgaWYgKFxuICAgICAgICAgIGV4aXN0aW5nRW50aXRpZXNbc2NoZW1hS2V5XSAmJlxuICAgICAgICAgIGV4aXN0aW5nRW50aXRpZXNbc2NoZW1hS2V5XVtpZF0gJiZcbiAgICAgICAgICBleGlzdGluZ0VudGl0aWVzW3NjaGVtYUtleV1baWRdW2luZGV4XSAhPT0gZW50aXR5W2luZGV4XVxuICAgICAgICApIHtcbiAgICAgICAgICBpbmRleE1hcFtleGlzdGluZ0VudGl0aWVzW3NjaGVtYUtleV1baWRdW2luZGV4XV0gPSBERUxFVEVEO1xuICAgICAgICB9XG4gICAgICAgIGlmIChpbmRleCBpbiBlbnRpdHkpIHtcbiAgICAgICAgICBpbmRleE1hcFtlbnRpdHlbaW5kZXhdXSA9IGlkO1xuICAgICAgICB9IC8qIGlzdGFuYnVsIGlnbm9yZSBuZXh0ICovIGVsc2UgaWYgKFxuICAgICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby11bmRlZlxuICAgICAgICAgIHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbidcbiAgICAgICAgKSB7XG4gICAgICAgICAgY29uc29sZS53YXJuKGBJbmRleCBub3QgZm91bmQgaW4gZW50aXR5LiBJbmRleGVzIG11c3QgYmUgdG9wLWxldmVsIG1lbWJlcnMgb2YgeW91ciBlbnRpdHkuXG5JbmRleDogJHtpbmRleH1cbkVudGl0eTogJHtKU09OLnN0cmluZ2lmeShlbnRpdHksI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gZW50aXR5ID0gZW50aXRpZXNbc2NoZW1hS2V5XVtpZF07XG4gICAgICBpZiAoIShzY2hlbWFLZXkgaW4gaW5kZXhlcykpIHtcbiAgICAgICAgaW5kZXhlc1tzY2hlbWFLZXldID0ge307XG4gICAgICAgIGV4aXN0aW5nSW5kZXhlc1tzY2hlbWFLZXldID0geyAuLi5leGlzdGluZ0luZGV4ZXNbc2NoZW1hS2V5XSB9O1xuICAgICAgfVxuICAgICAgZm9yIChjb25zdCBpbmRleCBvZiBzY2hlbWEuaW5kZXhlcykge1xuICAgICAgICBpZiAoIShpbmRleCBpbiBpbmRleGVzW3NjaGVtYUtleV0pKSB7XG4gICAgICAgICAgZXhpc3RpbmdJbmRleGVzW3NjaGVtYUtleV1baW5kZXhdID0gaW5kZXhlc1tzY2hlbWFLZXldW2luZGV4XSA9IHt9O1xuICAgICAgICB9XG4gICAgICAgIGNvbnN0IGluZGV4TWFwID0gaW5kZXhlc1tzY2hlbWFLZXldW2luZGV4XTtcbiAgICAgICAgaWYgKGV4aXN0aW5nRW50aXR5KSB7XG4gICAgICAgICAgZGVsZXRlIGluZGV4TWFwW2V4aXN0aW5nRW50aXR5W2luZGV4XV07XG4gICAgICAgIH1cbiAgICAgICAgLy8gZW50aXR5IGFscmVhZHkgaW4gY2FjaGUgYnV0IHRoZSBpbmRleCBjaGFuZ2VkXG4gICAgICAgIGlmIChcbiAgICAgICAgICBleGlzdGluZ0VudGl0aWVzW3NjaGVtYUtleV0gJiZcbiAgICAgICAgICBleGlzdGluZ0VudGl0aWVzW3NjaGVtYUtleV1baWRdICYmXG4gICAgICAgICAgZXhpc3RpbmdFbnRpdGllc1tzY2hlbWFLZXldW2lkXVtpbmRleF0gIT09IGVudGl0eVtpbmRleF1cbiAgICAgICAgKSB7XG4gICAgICAgICAgaW5kZXhNYXBbZXhpc3RpbmdFbnRpdGllc1tzY2hlbWFLZXldW2lkXVtpbmRleF1dID0gREVMRVRFRDtcbiAgICAgICAgfVxuICAgICAgICBpZ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0FBRTtFQUNqRCxNQUFNN0MsU0FBUyxHQUFHSyxXQUFXLENBQzNCbUQsV0FBVyxFQUNYQyxVQUFVLEVBQ1ZuRCxRQUFRLEVBQ1JDLE9BQU8sRUFDUEcsVUFBVSxFQUNWQyxJQUFJLENBQ0w7RUFDRCxNQUFNVixlQUFlLEdBQUcsQ0FBQyxDQUFDO0VBRTFCLE1BQU1nRCxNQUFNLEdBQUd0RCxLQUFLLENBQ2xCaUQsS0FBSyxFQUNMQSxLQUFLLEVBQ0xSLFNBQVMsRUFDVHJDLE1BQU0sRUFDTkMsU0FBUyxFQUNUQyxlQUFlLENBQ2hCO0VBQ0QsT0FBTztJQUFFSyxRQUFRO0lBQUVDLE9BQU87SUFBRTBDLE1BQU07SUFBRXZDO0VBQVcsQ0FBQztBQUNsRCxDQUFDIn0=

@@ -25,2 +25,3 @@ export type Schema = null | string | {

expiresAt?(meta: any, input: any): number;
mergeWithStore?(existingMeta: any, incomingMeta: any, existing: any, incoming: any): any;
useIncoming?(existingMeta: any, incomingMeta: any, existing: any, incoming: any): boolean;

@@ -27,0 +28,0 @@ indexes?: any;

export {};
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiLi4vc3JjL2ludGVyZmFjZS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBBYnN0cmFjdEluc3RhbmNlVHlwZSwgRGVub3JtYWxpemUsIEVudGl0eU1hcCB9IGZyb20gJy4vdHlwZXMuanMnO1xuXG5leHBvcnQgdHlwZSBTY2hlbWEgPVxuICB8IG51bGxcbiAgfCBzdHJpbmdcbiAgfCB7IFtLOiBzdHJpbmddOiBhbnkgfVxuICB8IFNjaGVtYVtdXG4gIHwgU2NoZW1hU2ltcGxlXG4gIHwgU2VyaWFsaXphYmxlO1xuXG5leHBvcnQgdHlwZSBTZXJpYWxpemFibGU8XG4gIFQgZXh0ZW5kcyB7IHRvSlNPTig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cbiAgcmVhZG9ubHkgW2VudGl0eUtleTogc3RyaW5nXToge1xuICAgIHJlYWRvbmx5IFtpbmRleE5hbWU6IHN0cmluZ106IHsgcmVhZG9ubHkgW2xvb2t1cDogc3RyaW5nXTogc3RyaW5nIH07XG4gIH07XG59XG5cbmV4cG9ydCBpbnRlcmZhY2UgRW50aXR5VGFibGUge1xuICBbZW50aXR5S2V5OiBzdHJpbmddOlxuICAgIHwge1xuICAgICAgICBbcGs6IHN0cmluZ106IHVua25vd247XG4gICAgICB9XG4gICAgfCB1bmRlZmluZWQ7XG59XG4iXSwibWFwcGluZ3MiOiIifQ==
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiLi4vc3JjL2ludGVyZmFjZS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBBYnN0cmFjdEluc3RhbmNlVHlwZSwgRGVub3JtYWxpemUsIEVudGl0eU1hcCB9IGZyb20gJy4vdHlwZXMuanMnO1xuXG5leHBvcnQgdHlwZSBTY2hlbWEgPVxuICB8IG51bGxcbiAgfCBzdHJpbmdcbiAgfCB7IFtLOiBzdHJpbmddOiBhbnkgfVxuICB8IFNjaGVtYVtdXG4gIHwgU2NoZW1hU2ltcGxlXG4gIHwgU2VyaWFsaXphYmxlO1xuXG5leHBvcnQgdHlwZSBTZXJpYWxpemFibGU8XG4gIFQgZXh0ZW5kcyB7IHRvSlNPTigpOiBzdHJpbmcgfSA9IHsgdG9KU09OKCk6IHN0cmluZyB9LFxuPiA9IHtcbiAgcHJvdG90eXBlOiBUO1xufTtcblxuZXhwb3J0IGludGVyZmFjZSBTY2hlbWFTaW1wbGU8VCA9IGFueT4ge1xuICBub3JtYWxpemUoXG4gICAgaW5wdXQ6IGFueSxcbiAgICBwYXJlbnQ6IGFueSxcbiAgICBrZXk6IGFueSxcbiAgICB2aXNpdDogKC4uLmFyZ3M6IGFueSkgPT4gYW55LFxuIC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6IHN0cmluZ106IHsgcmVhZG9ubHkgW2xvb2t1cDogc3RyaW5nXTogc3RyaW5nIH07XG4gIH07XG59XG5cbmV4cG9ydCBpbnRlcmZhY2UgRW50aXR5VGFibGUge1xuICBbZW50aXR5S2V5OiBzdHJpbmddOlxuICAgIHwge1xuICAgICAgICBbcGs6IHN0cmluZ106IHVua25vd247XG4gICAgICB9XG4gICAgfCB1bmRlZmluZWQ7XG59XG4iXSwibWFwcGluZ3MiOiIifQ==

@@ -36,3 +36,3 @@ import { normalize as arrayNormalize } from './schemas/Array.js';

} else {
// TODO: eventually assume this exists and don't check for conditional. probably early 2022
// TODO(breaking): eventually assume this exists and don't check for conditional. probably early 2022
const entityExpiresAt = schema.expiresAt ? schema.expiresAt(meta, processedEntity) : meta.expiresAt;

@@ -42,22 +42,9 @@ const inStoreEntity = existingEntities[schemaKey][id];

if (inStoreEntity) {
var _entityMeta$schemaKey, _entityMeta$schemaKey2, _entityMeta$schemaKey3, _meta$fetchedAt, _entityMeta$schemaKey4, _entityMeta$schemaKey5;
var _inStoreMeta$date, _meta$fetchedAt, _inStoreMeta$fetchedA;
const inStoreMeta = entityMeta[schemaKey][id];
const useIncoming =
// we may have in store but not in meta; so this existance check is still important
!inStoreMeta || (
// useIncoming should not be used with legacy optimistic
schema.useIncoming && meta.fetchedAt ? schema.useIncoming(inStoreMeta, meta, inStoreEntity, processedEntity) : entityMeta[schemaKey][id].date <= meta.date);
if (useIncoming) {
if (typeof processedEntity !== typeof inStoreEntity) {
entities[schemaKey][id] = processedEntity;
} else {
entities[schemaKey][id] = schema.merge(inStoreEntity, processedEntity);
}
} else {
entities[schemaKey][id] = inStoreEntity;
}
entities[schemaKey][id] = schema.mergeWithStore ? schema.mergeWithStore(inStoreMeta, meta, inStoreEntity, processedEntity) : mergeWithStore(schema, inStoreMeta, meta, inStoreEntity, processedEntity);
entityMeta[schemaKey][id] = {
expiresAt: Math.max(entityExpiresAt, (_entityMeta$schemaKey = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey.expiresAt),
date: Math.max(meta.date, (_entityMeta$schemaKey2 = (_entityMeta$schemaKey3 = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey3.date) != null ? _entityMeta$schemaKey2 : 0),
fetchedAt: Math.max((_meta$fetchedAt = meta.fetchedAt) != null ? _meta$fetchedAt : 0, (_entityMeta$schemaKey4 = (_entityMeta$schemaKey5 = entityMeta[schemaKey][id]) == null ? void 0 : _entityMeta$schemaKey5.fetchedAt) != null ? _entityMeta$schemaKey4 : 0)
expiresAt: Math.max(entityExpiresAt, inStoreMeta == null ? void 0 : inStoreMeta.expiresAt),
date: Math.max(meta.date, (_inStoreMeta$date = inStoreMeta == null ? void 0 : inStoreMeta.date) != null ? _inStoreMeta$date : 0),
fetchedAt: Math.max((_meta$fetchedAt = meta.fetchedAt) != null ? _meta$fetchedAt : 0, (_inStoreMeta$fetchedA = inStoreMeta == null ? void 0 : inStoreMeta.fetchedAt) != null ? _inStoreMeta$fetchedA : 0)
};

@@ -110,2 +97,21 @@ } else {

};
// TODO(breaking): remove this in 2 breaking releases
/** @deprecated use Entity.mergeStore() instead */
function mergeWithStore(schema, existingMeta, incomingMeta, existing, incoming) {
const useIncoming =
// we may have in store but not in meta; so this existance check is still important
!existingMeta || (
// useIncoming should not be used with legacy optimistic
schema.useIncoming && incomingMeta.fetchedAt ? schema.useIncoming(existingMeta, incomingMeta, existing, incoming) : existingMeta.date <= incomingMeta.date);
if (useIncoming) {
if (typeof incoming !== typeof existing) {
return incoming;
} else {
return schema.merge(existing, incoming);
}
} else {
return existing;
}
}
function expectedSchemaType(schema) {

@@ -181,2 +187,2 @@ return ['object', 'function'].includes(typeof schema) ? 'object' : typeof schema;

};
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJub3JtYWxpemUiLCJhcnJheU5vcm1hbGl6ZSIsIm9iamVjdE5vcm1hbGl6ZSIsIkRFTEVURUQiL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iAgICAgICAgICAvLyB3ZSBtYXkgaGF2ZSBpbiBzdG9yZSBidXQgbm90IGluIG1ldGE7IHNvIHRoaXMgZXhpc3RhbmNlIGNoZWNrIGlzIHN0aWxsIGltcG9ydGFudFxuICAgICAgICAgICFpblN0b3JlTWV0YSB8fFxuICAgICAgICAgIC8vIHVzZUluY29taW5nIHNob3VsZCBub3QgYmUgdXNlZCB3aXRoIGxlZ2FjeSBvcHRpbWlzdGljXG4gICAgICAgICAgKHNjaGVtYS51c2VJbmNvbWluZyAmJiBtZXRhLmZldGNoZWRBdFxuICAgICAgICAgICAgPyBzY2hlbWEudXNlSW5jb21pbmcoXG4gICAgICAgICAgICAgICAgaW5TdG9yZU1ldGEsXG4gICAgICAgICAgICAgICAgbWV0YSxcbiAgICAgICAgICAgICAgICBpblN0b3JlRW50aXR5LFxuICAgICAgICAgICAgICAgIHByb2Nlc3NlZEVudGl0eSxcbiAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgOiBlbnRpdHlNZXRhW3NjaGVtYUtleV1baWRdLmRhdGUgPD0gbWV0YS5kYXRlKTtcbiAgICAgICAgaWYgKHVzZUluY29taW5nKSB7XG4gICAgICAgICAgaWYgKHR5cGVvZiBwcm9jZXNzZWRFbnRpdHkgIT09IHR5cGVvZiBpblN0b3JlRW50aXR5KSB7XG4gICAgICAgICAgICBlbnRpdGllc1tzY2hlbWFLZXldW2lkXSA9IHByb2Nlc3NlZEVudGl0eTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZW50aXRpZXNbc2NoZW1hS2V5XVtpZF0gPSBzY2hlbWEubWVyZ2UoXG4gICAgICAgICAgICAgIGluU3RvcmVFbnRpdHksXG4gICAgICAgICAgICAgIHByb2Nlc3NlZEVudGl0eSxcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGVudGl0aWVzW3NjaGVtYUtleV1baWRdID0gaW5TdG9yZUVudGl0eTtcbiAg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EsS0FBTSxHQUFFLENBQ25CO01BQ0g7SUFDRixDQUFDLE1BQU07TUFDTCxNQUFNLElBQUlXLEtBQUssQ0FDWiw2REFBNERMLFVBQVcsYUFDdEVOLEtBQUssS0FBSyxJQUFJLEdBQUcsTUFBTSxHQUFHLE9BQU9BLEtBQ2xDLElBQUcsQ0FDTDtJQUNIO0VBQ0Y7RUFFQSxNQUFNWSxXQUFjLEdBQUcsQ0FBQyxDQUFRO0VBQ2hDLE1BQU1DLFVBQTJCLEdBQUcsQ0FBQyxDQUFRO0VBQzdDLE1BQU1uRCxRQUFXLEdBQUc7SUFBRSxHQUFHRTtFQUFpQixDQUFRO0VBQ2xELE1BQU1ELE9BQXdCLEdBQUc7SUFBRSxHQUFHRTtFQUFnQixDQUFDO0VBQ3ZELE1BQU1DLFVBQWUsR0FBRztJQUFFLEdBQUdtQztFQUFtQixDQUFDO0VBQ2pELE1BQU03QyxTQUFTLEdBQUdLLFdBQVcsQ0FDM0JtRCxXQUFXLEVBQ1hDLFVBQVUsRUFDVm5ELFFBQVEsRUFDUkMsT0FBTyxFQUNQRyxVQUFVLEVBQ1ZDLElBQUksQ0FDTDtFQUNELE1BQU1WLGVBQWUsR0FBRyxDQUFDLENBQUM7RUFFMUIsTUFBTWdELE1BQU0sR0FBR3RELEtBQUssQ0FDbEJpRCxLQUFLLEVBQ0xBLEtBQUssRUFDTFIsU0FBUyxFQUNUckMsTUFBTSxFQUNOQyxTQUFTLEVBQ1RDLGVBQWUsQ0FDaEI7RUFDRCxPQUFPO0lBQUVLLFFBQVE7SUFBRUMsT0FBTztJQUFFMEMsTUFBTTtJQUFFdkM7RUFBVyxDQUFDO0FBQ2xELENBQUMifQ==
{
"name": "@rest-hooks/normalizr",
"version": "9.3.7",
"version": "9.4.0",
"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": "86c630b4b313679c7a441cc7fa060dfb9005d1da"
"gitHead": "8b95633f971eb65723424cf4986b1f5e6325df73"
}

@@ -33,2 +33,3 @@ export type Schema = null | string | {

expiresAt?(meta: any, input: any): number;
mergeWithStore?(existingMeta: any, incomingMeta: any, existing: any, incoming: any): any;
useIncoming?(existingMeta: any, incomingMeta: any, existing: any, incoming: any): boolean;

@@ -35,0 +36,0 @@ indexes?: any;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc