New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@nerdwallet/apollo-cache-policies

Package Overview
Dependencies
Maintainers
8
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nerdwallet/apollo-cache-policies - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

4

CHANGELOG.md

@@ -0,1 +1,5 @@

2.2.0 (Dan Reynolds)
* Revert lodash-es change and use module imports instead
2.1.0 (Dan Reynolds)

@@ -2,0 +6,0 @@

7

dist/audit/AuditLog.js
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const lodash_es_1 = require("lodash-es");
const filter_1 = __importDefault(require("lodash/filter"));
class AuditLog {

@@ -19,3 +22,3 @@ constructor() {

getLog(filter) {
return lodash_es_1.filter(this._log, filter);
return filter_1.default(this._log, filter);
}

@@ -22,0 +25,0 @@ printLog(filter) {

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CacheResultProcessor = exports.ReadResultStatus = void 0;
const core_1 = require("@apollo/client/core");
const lodash_es_1 = require("lodash-es");
const isPlainObject_1 = __importDefault(require("lodash/isPlainObject"));
const isArray_1 = __importDefault(require("lodash/isArray"));
const utilities_1 = require("@apollo/client/utilities");

@@ -40,6 +44,6 @@ const helpers_1 = require("../helpers");

const { cache, invalidationPolicyManager, entityTypeMap } = this.config;
const result = lodash_es_1.isUndefined(fieldNameOrIndex)
const result = fieldNameOrIndex == undefined
? parentResult
: parentResult[fieldNameOrIndex];
if (lodash_es_1.isPlainObject(result)) {
if (isPlainObject_1.default(result)) {
const { __typename } = result;

@@ -61,3 +65,3 @@ const aggregateResultComplete = Object.keys(result).reduce((_acc, fieldName) => this.processReadSubResult(result, fieldName) ===

if (evicted) {
if (lodash_es_1.isPlainObject(parentResult) && fieldNameOrIndex) {
if (isPlainObject_1.default(parentResult) && fieldNameOrIndex) {
delete parentResult[fieldNameOrIndex];

@@ -73,3 +77,3 @@ }

}
else if (lodash_es_1.isArray(result)) {
else if (isArray_1.default(result)) {
let aggregateSubResultStatus = ReadResultStatus.Complete;

@@ -96,3 +100,3 @@ const subResultStatuses = result.map((_subResult, index) => {

const { rootId: dataId = "ROOT_QUERY" } = options;
if (lodash_es_1.isPlainObject(result)) {
if (isPlainObject_1.default(result)) {
if (helpers_1.isQuery(dataId)) {

@@ -160,3 +164,3 @@ const { variables } = options;

const { cache, invalidationPolicyManager, entityTypeMap } = this.config;
if (lodash_es_1.isPlainObject(result)) {
if (isPlainObject_1.default(result)) {
const { __typename } = result;

@@ -181,3 +185,3 @@ Object.keys(result).forEach((resultField) => this.processWriteSubResult(result[resultField]));

}
else if (lodash_es_1.isArray(result)) {
else if (isArray_1.default(result)) {
result.forEach((resultListItem) => this.processWriteSubResult(resultListItem));

@@ -190,6 +194,6 @@ }

const { entityTypeMap, cache, invalidationPolicyManager } = this.config;
if (lodash_es_1.isPlainObject(result)) {
if (isPlainObject_1.default(result)) {
this.processWriteSubResult(result);
}
if (dataId && helpers_1.isQuery(dataId) && lodash_es_1.isPlainObject(result)) {
if (dataId && helpers_1.isQuery(dataId) && isPlainObject_1.default(result)) {
this.getFieldsForQuery(options).forEach((field) => {

@@ -196,0 +200,0 @@ var _a;

@@ -18,3 +18,6 @@ "use strict";

const core_1 = require("@apollo/client/core");
const lodash_es_1 = require("lodash-es");
const compact_1 = __importDefault(require("lodash/compact"));
const every_1 = __importDefault(require("lodash/every"));
const pick_1 = __importDefault(require("lodash/pick"));
const isFunction_1 = __importDefault(require("lodash/isFunction"));
const InvalidationPolicyManager_1 = __importDefault(require("../policies/InvalidationPolicyManager"));

@@ -367,3 +370,3 @@ const entity_store_1 = require("../entity-store");

// minimize payload size only inject the entitiesById object into the extracted cache
extractedCache.invalidation = lodash_es_1.pick(this.entityTypeMap.extract(), "entitiesById");
extractedCache.invalidation = pick_1.default(this.entityTypeMap.extract(), "entitiesById");
}

@@ -383,3 +386,3 @@ return extractedCache;

const matchingFragments = matchingRefs.map(ref => this.readFragment(Object.assign(Object.assign({}, restOptions), { fragment, id: ref.__ref })));
return lodash_es_1.compact(matchingFragments);
return compact_1.default(matchingFragments);
}

@@ -399,3 +402,3 @@ // Supports reading a collection of references by type from the cache and filtering them by the given fields. Returns a

return entityReferences.filter(ref => {
if (lodash_es_1.isFunction(filter)) {
if (isFunction_1.default(filter)) {
return filter(ref, this.readField.bind(this));

@@ -409,3 +412,3 @@ }

});
return lodash_es_1.every(entityFilterResults, Boolean);
return every_1.default(entityFilterResults, Boolean);
});

@@ -412,0 +415,0 @@ }

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const lodash_es_1 = require("lodash-es");
const set_1 = __importDefault(require("lodash/set"));
const helpers_1 = require("../helpers");

@@ -145,3 +148,3 @@ /**

}
lodash_es_1.set(this.entitiesByType, [typename, entityId], newEntity);
set_1.default(this.entitiesByType, [typename, entityId], newEntity);
this.entitiesById[entityId] = newEntity;

@@ -148,0 +151,0 @@ }

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateFragmentFieldName = exports.fieldNameFromStoreName = exports.TypeOrFieldNameRegExp = exports.maybeDeepClone = exports.makeEntityId = exports.isQuery = void 0;
const lodash_es_1 = require("lodash-es");
const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
const compact_1 = __importDefault(require("lodash/compact"));
const isPlainObject_1 = __importDefault(require("lodash/isPlainObject"));
const uuid_1 = require("uuid");

@@ -19,3 +24,3 @@ function isQuery(dataId) {

if (isQuery(dataId)) {
return lodash_es_1.compact([dataId, fieldName]).join(".");
return compact_1.default([dataId, fieldName]).join(".");
}

@@ -28,3 +33,3 @@ return dataId;

// https://github.com/apollographql/apollo-client/blob/master/src/utilities/common/maybeDeepFreeze.ts#L20:L20
const maybeDeepClone = (obj) => lodash_es_1.isPlainObject(obj) && Object.isFrozen(obj) ? lodash_es_1.cloneDeep(obj) : obj;
const maybeDeepClone = (obj) => isPlainObject_1.default(obj) && Object.isFrozen(obj) ? cloneDeep_1.default(obj) : obj;
exports.maybeDeepClone = maybeDeepClone;

@@ -31,0 +36,0 @@ exports.TypeOrFieldNameRegExp = /^[_a-z][_0-9a-z]*/i;

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.useOnce = void 0;
const react_1 = require("react");
const lodash_es_1 = require("lodash-es");
const isFunction_1 = __importDefault(require("lodash/isFunction"));
function useOnce(value) {

@@ -10,3 +13,3 @@ const valueRef = react_1.useRef();

if (!hasCachedValueRef.current) {
if (lodash_es_1.isFunction(value)) {
if (isFunction_1.default(value)) {
valueRef.current = value();

@@ -13,0 +16,0 @@ }

@@ -13,4 +13,7 @@ "use strict";

};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const lodash_es_1 = require("lodash-es");
const isNumber_1 = __importDefault(require("lodash/isNumber"));
const types_1 = require("./types");

@@ -149,3 +152,3 @@ const helpers_1 = require("../helpers");

const timeToLive = ((_a = this.getPolicy(typename)) === null || _a === void 0 ? void 0 : _a.timeToLive) || policies.timeToLive;
if (lodash_es_1.isNumber(entityCacheTime) &&
if (isNumber_1.default(entityCacheTime) &&
timeToLive &&

@@ -152,0 +155,0 @@ Date.now() > entityCacheTime + timeToLive) {

{
"name": "@nerdwallet/apollo-cache-policies",
"version": "2.1.0",
"version": "2.2.0",
"description": "An extension to the InMemoryCache from Apollo that adds additional cache policies.",

@@ -37,3 +37,3 @@ "main": "dist/index.js",

"graphql": "^15.5.0",
"lodash-es": "^4.17.21",
"lodash": "^4.17.21",
"typescript": "^4.3.2",

@@ -40,0 +40,0 @@ "uuid": "^7.0.3",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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