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

@graphql-toolkit/graphql-tag-pluck

Package Overview
Dependencies
Maintainers
3
Versions
593
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-toolkit/graphql-tag-pluck - npm Package Compare versions

Comparing version 0.7.5-alpha-0271fe0.5 to 0.7.5-alpha-068a9db.12

13

index.cjs.js

@@ -388,3 +388,3 @@ 'use strict';

const gqlExtensions = ['.graphqls', '.graphql', '.gqls', '.gql'];
const jsExtensions = ['.js', '.jsx', '.ts', '.tsx', '.flow', '.flow.js', '.flow.jsx'];
const jsExtensions = ['.js', '.jsx', '.ts', '.tsx', '.flow', '.flow.js', '.flow.jsx', '.vue'];
const supportedExtensions = [...gqlExtensions, ...jsExtensions];

@@ -394,2 +394,8 @@ supportedExtensions.toString = function toString() {

};
function pluckVueFileScript(fileData) {
const compiler = require('vue-template-compiler');
const parsed = compiler.parseComponent(fileData);
const script = parsed.script ? parsed.script.content : '';
return script;
}
const gqlPluckFromFile = async (filePath, options = {}) => {

@@ -411,3 +417,6 @@ if (typeof filePath != 'string') {

options = { ...options, fileExt };
const code = fs.readFileSync(filePath, { encoding: 'utf8' });
let code = fs.readFileSync(filePath, { encoding: 'utf8' });
if (fileExt === '.vue') {
code = pluckVueFileScript(code);
}
return gqlPluckFromCodeString(code, options);

@@ -414,0 +423,0 @@ };

@@ -363,3 +363,3 @@ import { parse } from '@babel/parser';

const gqlExtensions = ['.graphqls', '.graphql', '.gqls', '.gql'];
const jsExtensions = ['.js', '.jsx', '.ts', '.tsx', '.flow', '.flow.js', '.flow.jsx'];
const jsExtensions = ['.js', '.jsx', '.ts', '.tsx', '.flow', '.flow.js', '.flow.jsx', '.vue'];
const supportedExtensions = [...gqlExtensions, ...jsExtensions];

@@ -369,2 +369,8 @@ supportedExtensions.toString = function toString() {

};
function pluckVueFileScript(fileData) {
const compiler = require('vue-template-compiler');
const parsed = compiler.parseComponent(fileData);
const script = parsed.script ? parsed.script.content : '';
return script;
}
const gqlPluckFromFile = async (filePath, options = {}) => {

@@ -386,3 +392,6 @@ if (typeof filePath != 'string') {

options = { ...options, fileExt };
const code = readFileSync(filePath, { encoding: 'utf8' });
let code = readFileSync(filePath, { encoding: 'utf8' });
if (fileExt === '.vue') {
code = pluckVueFileScript(code);
}
return gqlPluckFromCodeString(code, options);

@@ -389,0 +398,0 @@ };

5

package.json
{
"name": "@graphql-toolkit/graphql-tag-pluck",
"version": "0.7.5-alpha-0271fe0.5+0271fe0",
"version": "0.7.5-alpha-068a9db.12+068a9db",
"description": "Pluck graphql-tag template literals",

@@ -18,3 +18,6 @@ "peerDependencies": {

},
"optionalDependencies": {
"vue-template-compiler": "^2.6.10"
},
"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