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

babel-plugin-inline-import-graphql-ast

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-inline-import-graphql-ast - npm Package Compare versions

Comparing version 2.0.3-beta.1 to 2.0.3-beta.2

15

build/index.js

@@ -15,2 +15,6 @@ Object.defineProperty(exports, "__esModule", {

var _babelTemplate = require('babel-template');
var _babelTemplate2 = _interopRequireDefault(_babelTemplate);
var _babylon = require('babylon');

@@ -53,9 +57,12 @@

query.makeSourceEnumerable();
curPath.replaceWithMultiple(buildInlineVariableAST(query.ast));
curPath.replaceWith(buildInlineVariableAST(query.ast));
}
function buildInlineVariableAST(graphqlAST) {
var inlineVarName = curPath.node.specifiers[0].local.name;
var inlineVarStatement = 'const ' + inlineVarName + ' = ' + JSON.stringify(graphqlAST) + ';' + _os.EOL;
return (0, _babylon.parse)(inlineVarStatement).program.body;
var buildAST = (0, _babelTemplate2.default)('\n const QUERY_NAME = GQL_AST;\n ');
return buildAST({
QUERY_NAME: t.identifier(curPath.node.specifiers[0].local.name),
GQL_AST: (0, _babylon.parseExpression)(JSON.stringify(graphqlAST))
});
}

@@ -62,0 +69,0 @@ }

{
"name": "babel-plugin-inline-import-graphql-ast",
"version": "2.0.3-beta.1",
"version": "2.0.3-beta.2",
"description": "Babel plugin to make raw files importable",

@@ -5,0 +5,0 @@ "author": "Alexander Roberts <detrohutt@gmail.com>",

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