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

graphql-tag

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-tag - npm Package Compare versions

Comparing version 0.1.13 to 0.1.14

36

index.js

@@ -5,2 +5,36 @@ var parse = require('./parser').parse;

function stripLoc(doc) {
var docType = Object.prototype.toString.call(doc);
if (docType === '[object Array]') {
return doc.map(stripLoc);
}
if (docType !== '[object Object]') {
throw new Error('Unexpected input.');
}
if (doc.loc) {
delete doc.loc;
}
var keys = Object.keys(doc);
var key;
var value;
var valueType;
for (key in keys) {
if (keys.hasOwnProperty(key)) {
value = doc[keys[key]];
valueType = Object.prototype.toString.call(value);
if (valueType === '[object Object]' || valueType === '[object Array]') {
doc[keys[key]] = stripLoc(value);
}
}
}
return doc;
}
function parseDocument(doc) {

@@ -17,2 +51,4 @@ if (cache[doc]) {

parsed = stripLoc(parsed);
cache[doc] = parsed;

@@ -19,0 +55,0 @@

5

package.json
{
"name": "graphql-tag",
"version": "0.1.13",
"version": "0.1.14",
"description": "A JavaScript template literal tag that parses GraphQL queries",

@@ -8,3 +8,3 @@ "main": "index.js",

"compile": "webpack",
"test": "mocha --require babel-register"
"test": "mocha"
},

@@ -27,3 +27,2 @@ "repository": {

"graphql": "^0.6.0",
"lodash": "^4.13.1",
"mocha": "^2.5.3",

@@ -30,0 +29,0 @@ "webpack": "^1.13.1"

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