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

apollo-cache-router

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apollo-cache-router - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

17

lib/bundle.umd.js

@@ -20,2 +20,13 @@ (function (global, factory) {

var apollo_cache_1 = require("apollo-cache");
var deepMerge = function (target, source) {
for (var _i = 0, _a = Object.keys(source); _i < _a.length; _i++) {
var key = _a[_i];
if (!!target[key] && typeof target[key] === 'object') {
deepMerge(target[key], source[key]);
}
else {
target[key] = source[key];
}
}
};
var OverrideCache = (function (_super) {

@@ -119,3 +130,5 @@ __extends(OverrideCache, _super);

for (var idx = 0; idx < this.caches.length; idx++) {
state['cache' + idx] = this.caches[idx].extract(optimistic);
var cacheKey = '__cache' + idx;
state[cacheKey] = this.caches[idx].extract(optimistic);
deepMerge(state, state[cacheKey]);
}

@@ -126,3 +139,3 @@ return state;

for (var idx = 0; idx < this.caches.length; idx++) {
this.caches[idx].restore(serializedState['cache' + idx]);
this.caches[idx].restore(serializedState['__cache' + idx]);
}

@@ -129,0 +142,0 @@ return this;

@@ -14,2 +14,13 @@ "use strict";

var apollo_cache_1 = require("apollo-cache");
var deepMerge = function (target, source) {
for (var _i = 0, _a = Object.keys(source); _i < _a.length; _i++) {
var key = _a[_i];
if (!!target[key] && typeof target[key] === 'object') {
deepMerge(target[key], source[key]);
}
else {
target[key] = source[key];
}
}
};
var OverrideCache = (function (_super) {

@@ -113,3 +124,5 @@ __extends(OverrideCache, _super);

for (var idx = 0; idx < this.caches.length; idx++) {
state['cache' + idx] = this.caches[idx].extract(optimistic);
var cacheKey = '__cache' + idx;
state[cacheKey] = this.caches[idx].extract(optimistic);
deepMerge(state, state[cacheKey]);
}

@@ -120,3 +133,3 @@ return state;

for (var idx = 0; idx < this.caches.length; idx++) {
this.caches[idx].restore(serializedState['cache' + idx]);
this.caches[idx].restore(serializedState['__cache' + idx]);
}

@@ -123,0 +136,0 @@ return this;

2

package.json
{
"name": "apollo-cache-router",
"version": "1.1.1",
"version": "1.1.2",
"description": "Apollo Cache Router",

@@ -5,0 +5,0 @@ "main": "./lib/bundle.umd.js",

import { ApolloCache, Cache, Transaction } from 'apollo-cache';
import { DocumentNode } from 'graphql';
const deepMerge = (target: any, source: any) => {
for (const key of Object.keys(source)) {
if (!!target[key] && typeof target[key] === 'object') {
deepMerge(target[key], source[key]);
} else {
target[key] = source[key];
}
}
};
export interface OverrideOptions<TCache> {

@@ -140,3 +150,5 @@ read?: <T>(query: Cache.ReadOptions) => T;

for (let idx = 0; idx < this.caches.length; idx++) {
state['cache' + idx] = this.caches[idx].extract(optimistic);
const cacheKey = '__cache' + idx;
state[cacheKey] = this.caches[idx].extract(optimistic);
deepMerge(state, state[cacheKey]);
}

@@ -148,3 +160,3 @@ return state;

for (let idx = 0; idx < this.caches.length; idx++) {
this.caches[idx].restore(serializedState['cache' + idx]);
this.caches[idx].restore(serializedState['__cache' + idx]);
}

@@ -151,0 +163,0 @@ return this;

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