Socket
Socket
Sign inDemoInstall

@coderich/graphql-shape

Package Overview
Dependencies
7
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.2.0 to 2.2.1

README.md

2

package.json
{
"name": "@coderich/graphql-shape",
"main": "src/GraphQLShape.js",
"version": "2.2.0",
"version": "2.2.1",
"publishConfig": {

@@ -6,0 +6,0 @@ "access": "public"

@@ -51,5 +51,5 @@ const get = require('lodash.get');

exports.pairs = Util.pairs;
exports.pushIt = Util.push;
exports.flatten = Util.flatten;
exports.unflatten = Util.unflatten;
exports.default = (v, ...args) => Util.ensureArray(v).concat(args.flat()).find(el => el != null);

@@ -56,0 +56,0 @@ // Pick keys (with optional rename)

@@ -120,3 +120,3 @@ const Util = require('@coderich/util');

// We assign data here because it's possible to modify the root/data itself (key: '')
// We assign data here because it's possible to modify the root/data itself (via key: '')
data = Util.pathmap(key, data, (value, info) => {

@@ -183,3 +183,3 @@ const vars = [value];

return data; // For convenience (and testing)
return data;
}

@@ -197,13 +197,21 @@

args = GraphQLShape.#resolveVariableArgs(vars, args.flat());
const firstUserArg = args.shift();
// Core functions have a special syntax
if (core[fn]) {
const method = args.shift();
if (method === 'new') return new core[fn](value, ...args);
if (method === null) return core[fn](value, ...args);
return core[fn][method](value, ...args);
if (firstUserArg === 'new') return new core[fn](value, ...args);
if (firstUserArg === null) return core[fn](value, ...args);
return core[fn][firstUserArg](value, ...args);
}
if (functions[fn]) return functions[fn](value, ...args);
if (value?.[fn]) return value[fn](...args);
if (functions[fn]) {
if (firstUserArg === null) return functions[fn](value, ...args);
return functions[fn](value, firstUserArg, ...args);
}
if (typeof value?.[fn] === 'function') {
if (firstUserArg === null) return value[fn](...args);
return value[fn](firstUserArg, ...args);
}
return value;

@@ -210,0 +218,0 @@ }

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc