Socket
Socket
Sign inDemoInstall

babel-gql

Package Overview
Dependencies
2
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.6-dev.865ed2b46 to 0.1.6-dev.9415a6426

4

dist/node/query-manager.d.ts

@@ -22,2 +22,6 @@ import { FragmentDefinitionNode, OperationDefinitionNode } from "graphql";

apply(compiler: any): void;
getGraphQLFilePath(query: {
queryName: string;
fullQueryId: string;
}): string;
handleDone(): Promise<void>;

@@ -24,0 +28,0 @@ }

25

dist/node/query-manager.js

@@ -12,2 +12,5 @@ "use strict";

const shared_1 = require("./shared");
async function isFile(path) {
return fs_1.promises.stat(path).then((s) => s.isFile(), () => false);
}
exports.BABEL_GQL_GLOBAL = global;

@@ -77,2 +80,5 @@ function debug(...args) {

}
getGraphQLFilePath(query) {
return path_1.default.join(this.target, `${query.queryName}-${query.fullQueryId}.graphql`);
}
async handleDone() {

@@ -86,10 +92,13 @@ if (!QueryManager.hasRegisterdGlobal()) {

const dirtyQueries = qm.popDirtyQueries();
debug(`Found ${dirtyQueries.length}/${allQueries.length} dirty queries`);
if (dirtyQueries.length === 0) {
return;
}
const newQueries = dirtyQueries.slice(0, 0); // get empty array with the same type
await Promise.all(dirtyQueries.map(async (query) => {
const path = this.getGraphQLFilePath(query);
if (!(await isFile(path))) {
newQueries.push(query);
}
}));
if (this.active) {
await Promise.all(dirtyQueries.map(async (query) => {
const path = path_1.default.join(this.target, `${query.queryName}-${query.fullQueryId}.graphql`);
console.log("[babel-gql] Writing ", path);
debug(`[babel-gql] Found ${newQueries.length}/${allQueries.length} new queries`);
await Promise.all(newQueries.map(async (query) => {
const path = this.getGraphQLFilePath(query);
await fs_1.promises.writeFile(path, query.fullQuery);

@@ -99,3 +108,3 @@ }));

if (this.onDone) {
await this.onDone(qm, dirtyQueries.length);
await this.onDone(qm, newQueries.length);
}

@@ -102,0 +111,0 @@ }

{
"name": "babel-gql",
"version": "0.1.6-dev.865ed2b46",
"version": "0.1.6-dev.9415a6426",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/node/index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc