Socket
Socket
Sign inDemoInstall

@graphql-tools/mock

Package Overview
Dependencies
Maintainers
3
Versions
1135
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-tools/mock - npm Package Compare versions

Comparing version 9.0.3 to 9.0.4-rc-20240723101709-7374a9d9c11352b0604840741d382f77ba09b510

2

cjs/MockList.js

@@ -22,2 +22,4 @@ "use strict";

class MockList {
len;
wrappedFunction;
/**

@@ -24,0 +26,0 @@ * @param length Either the exact length of items to return or an inclusive

9

cjs/MockStore.js

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

class MockStore {
schema;
mocks;
typePolicies;
store = {};
constructor({ schema, mocks, typePolicies, }) {
this.store = {};
this.schema = schema;

@@ -116,7 +119,7 @@ this.mocks = { ...exports.defaultMocks, ...mocks };

const entity = this.store[key];
return Object.values(entity).filter(predicate);
return entity ? Object.values(entity).filter(predicate) : [];
}
find(key, predicate) {
const entity = this.store[key];
return Object.values(entity).find(predicate);
return entity ? Object.values(entity).find(predicate) : undefined;
}

@@ -123,0 +126,0 @@ getImpl(args) {

@@ -18,2 +18,4 @@ /**

export class MockList {
len;
wrappedFunction;
/**

@@ -20,0 +22,0 @@ * @param length Either the exact length of items to return or an inclusive

@@ -15,4 +15,7 @@ import stringify from 'fast-json-stable-stringify';

export class MockStore {
schema;
mocks;
typePolicies;
store = {};
constructor({ schema, mocks, typePolicies, }) {
this.store = {};
this.schema = schema;

@@ -112,7 +115,7 @@ this.mocks = { ...defaultMocks, ...mocks };

const entity = this.store[key];
return Object.values(entity).filter(predicate);
return entity ? Object.values(entity).filter(predicate) : [];
}
find(key, predicate) {
const entity = this.store[key];
return Object.values(entity).find(predicate);
return entity ? Object.values(entity).find(predicate) : undefined;
}

@@ -119,0 +122,0 @@ getImpl(args) {

{
"name": "@graphql-tools/mock",
"version": "9.0.3",
"version": "9.0.4-rc-20240723101709-7374a9d9c11352b0604840741d382f77ba09b510",
"description": "A set of utils for faster development of GraphQL tools",

@@ -5,0 +5,0 @@ "sideEffects": false,

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