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

@ts-gql/babel-plugin

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ts-gql/babel-plugin - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

14

dist/babel-plugin.cjs.dev.js

@@ -5,7 +5,9 @@ 'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var nodePath = _interopDefault(require('path'));
var nodePath = require('path');
var helperModuleImports = require('@babel/helper-module-imports');
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
var nodePath__default = /*#__PURE__*/_interopDefault(nodePath);
function plugin() {

@@ -16,10 +18,8 @@ return {

let expressionPath = asExpressionPath.get("expression");
if (expressionPath.node.type === "TaggedTemplateExpression" && expressionPath.node.tag.type === "Identifier" && expressionPath.node.tag.name === "gql" && asExpressionPath.node.type === "TSAsExpression" && asExpressionPath.node.typeAnnotation.type === "TSImportType") {
expressionPath.replaceWith(helperModuleImports.addNamed(expressionPath, "document", asExpressionPath.node.typeAnnotation.argument.value, {
nameHint: nodePath.basename(asExpressionPath.node.typeAnnotation.argument.value)
nameHint: nodePath__default["default"].basename(asExpressionPath.node.typeAnnotation.argument.value)
}));
}
}
}

@@ -29,2 +29,2 @@ };

exports.default = plugin;
exports["default"] = plugin;

@@ -1,13 +0,12 @@

"use strict";
'use strict';
function _interopDefault(ex) {
return ex && "object" == typeof ex && "default" in ex ? ex.default : ex;
}
Object.defineProperty(exports, '__esModule', { value: true });
Object.defineProperty(exports, "__esModule", {
value: !0
});
var nodePath = require('path');
var helperModuleImports = require('@babel/helper-module-imports');
var nodePath = _interopDefault(require("path")), helperModuleImports = require("@babel/helper-module-imports");
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
var nodePath__default = /*#__PURE__*/_interopDefault(nodePath);
function plugin() {

@@ -18,5 +17,7 @@ return {

let expressionPath = asExpressionPath.get("expression");
"TaggedTemplateExpression" === expressionPath.node.type && "Identifier" === expressionPath.node.tag.type && "gql" === expressionPath.node.tag.name && "TSAsExpression" === asExpressionPath.node.type && "TSImportType" === asExpressionPath.node.typeAnnotation.type && expressionPath.replaceWith(helperModuleImports.addNamed(expressionPath, "document", asExpressionPath.node.typeAnnotation.argument.value, {
nameHint: nodePath.basename(asExpressionPath.node.typeAnnotation.argument.value)
}));
if (expressionPath.node.type === "TaggedTemplateExpression" && expressionPath.node.tag.type === "Identifier" && expressionPath.node.tag.name === "gql" && asExpressionPath.node.type === "TSAsExpression" && asExpressionPath.node.typeAnnotation.type === "TSImportType") {
expressionPath.replaceWith(helperModuleImports.addNamed(expressionPath, "document", asExpressionPath.node.typeAnnotation.argument.value, {
nameHint: nodePath__default["default"].basename(asExpressionPath.node.typeAnnotation.argument.value)
}));
}
}

@@ -27,2 +28,2 @@ }

exports.default = plugin;
exports["default"] = plugin;

@@ -9,3 +9,2 @@ import nodePath from 'path';

let expressionPath = asExpressionPath.get("expression");
if (expressionPath.node.type === "TaggedTemplateExpression" && expressionPath.node.tag.type === "Identifier" && expressionPath.node.tag.name === "gql" && asExpressionPath.node.type === "TSAsExpression" && asExpressionPath.node.typeAnnotation.type === "TSImportType") {

@@ -17,3 +16,2 @@ expressionPath.replaceWith(addNamed(expressionPath, "document", asExpressionPath.node.typeAnnotation.argument.value, {

}
}

@@ -23,2 +21,2 @@ };

export default plugin;
export { plugin as default };
{
"name": "@ts-gql/babel-plugin",
"version": "0.1.0",
"main": "dist/babel-plugin.cjs.js",
"module": "dist/babel-plugin.esm.js",
"files": [
"dist",
"!**/*.d.ts"
],
"license": "MIT",
"dependencies": {
"@babel/helper-module-imports": "^7.8.3",
"@babel/runtime": "^7.9.2"
},
"devDependencies": {
"@types/babel__core": "^7.1.7"
},
"repository": "https://github.com/Thinkmill/ts-gql/tree/master/packages/babel-plugin"
}
"name": "@ts-gql/babel-plugin",
"version": "0.1.1",
"main": "dist/babel-plugin.cjs.js",
"module": "dist/babel-plugin.esm.js",
"exports": {
".": {
"module": "./dist/babel-plugin.esm.js",
"default": "./dist/babel-plugin.cjs.js"
},
"./package.json": "./package.json"
},
"files": [
"dist",
"!**/*.d.ts"
],
"license": "MIT",
"dependencies": {
"@babel/helper-module-imports": "^7.8.3",
"@babel/runtime": "^7.9.2"
},
"devDependencies": {
"@types/babel__core": "^7.1.9"
},
"repository": "https://github.com/Thinkmill/ts-gql/tree/main/packages/babel-plugin"
}

Sorry, the diff of this file is not supported yet

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