@mmstack/resource 20.3.0 → 20.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -445,7 +445,7 @@ function provideQueryCache(opt) {
445
445
  deserialize,
446
446
  }
447
447
  : undefined;
448
- let db = opt?.persist === false
448
+ const db = opt?.persist === false
449
449
  ? undefined
450
450
  : createSingleStoreDB('mmstack-query-cache-db', (version) => `query-store_v${version}`, opt?.version).then((db) => {
451
451
  return {
@@ -945,7 +945,12 @@ function createDedupeRequestsInterceptor(allowed = ['GET', 'DELETE', 'HEAD', 'OP
945
945
  * isPlainObject(new Date()) // => false
946
946
  */
947
947
  function isPlainObject(value) {
948
- return (typeof value === 'object' && value !== null && value.constructor === Object);
948
+ if (value === null || typeof value !== 'object')
949
+ return false;
950
+ const proto = Object.getPrototypeOf(value);
951
+ if (proto === null)
952
+ return false; // remove Object.create(null);
953
+ return proto === Object.prototype;
949
954
  }
950
955
  /**
951
956
  * Internal helper to generate a stable JSON string from an array.
@@ -1266,10 +1271,10 @@ function retryOnError(res, opt) {
1266
1271
 
1267
1272
  class ResourceSensors {
1268
1273
  networkStatus = sensor('networkStatus');
1269
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: ResourceSensors, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1270
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: ResourceSensors, providedIn: 'root' });
1274
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: ResourceSensors, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1275
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: ResourceSensors, providedIn: 'root' });
1271
1276
  }
1272
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: ResourceSensors, decorators: [{
1277
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: ResourceSensors, decorators: [{
1273
1278
  type: Injectable,
1274
1279
  args: [{
1275
1280
  providedIn: 'root',
@@ -1383,7 +1388,6 @@ function queryResource(request, options) {
1383
1388
  : stableRequest;
1384
1389
  let resource = toResourceObject(httpResource(cachedRequest, {
1385
1390
  ...options,
1386
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1387
1391
  parse: options?.parse, // Not my favorite thing to do, but here it is completely safe.
1388
1392
  }));
1389
1393
  resource = catchValueError(resource, options?.defaultValue);