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.4 to 0.7.5-alpha-022945b.8

31

index.cjs.js

@@ -7,2 +7,21 @@ 'use strict';

function _interopNamespace(e) {
if (e && e.__esModule) { return e; } else {
var n = {};
if (e) {
Object.keys(e).forEach(function (k) {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () {
return e[k];
}
});
});
}
n['default'] = e;
return n;
}
}
const parser = require('@babel/parser');

@@ -108,3 +127,3 @@ const t = require('@babel/types');

const parseCode = (code, config) => {
const parseCode = async (code, config) => {
// The 'typescript' plug-in has few bugs... It's just better to use the native one

@@ -115,3 +134,3 @@ // even though it affects performance

try {
ts = require('typescript');
ts = await new Promise(function (resolve) { resolve(_interopNamespace(require('typescript'))); });
}

@@ -137,3 +156,3 @@ catch (e) {

// React.Components which are provided with null or undefined e.g. <Foo<undefined />>
jsx: config.plugins.includes('jsx') && 'react',
jsx: config.plugins.includes('jsx') && ts.JsxEmit.React,
},

@@ -378,3 +397,3 @@ }).outputText;

};
const gqlPluckFromFile = (filePath, options = {}) => {
const gqlPluckFromFile = async (filePath, options = {}) => {
if (typeof filePath != 'string') {

@@ -398,3 +417,3 @@ throw TypeError('Provided file path must be a string');

};
const gqlPluckFromCodeString = (code, options = {}) => {
const gqlPluckFromCodeString = async (code, options = {}) => {
if (typeof code != 'string') {

@@ -415,3 +434,3 @@ throw TypeError('Provided code must be a string');

const out = { returnValue: null };
const ast = parseCode(code, generateConfig(code, options));
const ast = await parseCode(code, generateConfig(code, options));
const visitor = createVisitor(ast['code'], out, options);

@@ -418,0 +437,0 @@ traverse(ast, visitor);

8

index.d.ts

@@ -10,8 +10,8 @@ export interface GraphQLTagPluckOptions {

}
export declare const gqlPluckFromFile: (filePath: string, options?: GraphQLTagPluckOptions) => string;
export declare const gqlPluckFromCodeString: (code: string, options?: GraphQLTagPluckOptions) => string;
export declare const gqlPluckFromFile: (filePath: string, options?: GraphQLTagPluckOptions) => Promise<string>;
export declare const gqlPluckFromCodeString: (code: string, options?: GraphQLTagPluckOptions) => Promise<string>;
declare const _default: {
fromFile: (filePath: string, options?: GraphQLTagPluckOptions) => string;
fromCodeString: (code: string, options?: GraphQLTagPluckOptions) => string;
fromFile: (filePath: string, options?: GraphQLTagPluckOptions) => Promise<string>;
fromCodeString: (code: string, options?: GraphQLTagPluckOptions) => Promise<string>;
};
export default _default;

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

const parseCode = (code, config) => {
const parseCode = async (code, config) => {
// The 'typescript' plug-in has few bugs... It's just better to use the native one

@@ -108,3 +108,3 @@ // even though it affects performance

try {
ts = require('typescript');
ts = await import('typescript');
}

@@ -130,3 +130,3 @@ catch (e) {

// React.Components which are provided with null or undefined e.g. <Foo<undefined />>
jsx: config.plugins.includes('jsx') && 'react',
jsx: config.plugins.includes('jsx') && ts.JsxEmit.React,
},

@@ -371,3 +371,3 @@ }).outputText;

};
const gqlPluckFromFile = (filePath, options = {}) => {
const gqlPluckFromFile = async (filePath, options = {}) => {
if (typeof filePath != 'string') {

@@ -391,3 +391,3 @@ throw TypeError('Provided file path must be a string');

};
const gqlPluckFromCodeString = (code, options = {}) => {
const gqlPluckFromCodeString = async (code, options = {}) => {
if (typeof code != 'string') {

@@ -408,3 +408,3 @@ throw TypeError('Provided code must be a string');

const out = { returnValue: null };
const ast = parseCode(code, generateConfig(code, options));
const ast = await parseCode(code, generateConfig(code, options));
const visitor = createVisitor(ast['code'], out, options);

@@ -411,0 +411,0 @@ traverse(ast, visitor);

import { ParserOptions } from '@babel/parser';
export declare const parseCode: (code: string, config: ParserOptions) => import("@babel/types").File;
export declare const parseCode: (code: string, config: ParserOptions) => Promise<import("@babel/types").File>;
{
"name": "@graphql-toolkit/graphql-tag-pluck",
"version": "0.7.4",
"version": "0.7.5-alpha-022945b.8+022945b",
"description": "Pluck graphql-tag template literals",

@@ -14,3 +14,3 @@ "peerDependencies": {

"dependencies": {
"@babel/parser": "7.7.4",
"@babel/parser": "7.7.5",
"@babel/traverse": "7.7.4",

@@ -17,0 +17,0 @@ "@babel/types": "7.7.4"

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