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

@graphql-markdown/utils

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-markdown/utils - npm Package Compare versions

Comparing version 1.5.0 to 1.5.1

10

package.json

@@ -8,3 +8,3 @@ {

},
"version": "1.5.0",
"version": "1.5.1",
"license": "MIT",

@@ -29,4 +29,10 @@ "main": "src/index.js",

"peerDependencies": {
"graphql": "^14.0 || ^15.0 || ^16.0"
"graphql": "^14.0 || ^15.0 || ^16.0",
"prettier": "^2.8 || ^3.0"
},
"peerDependenciesMeta": {
"prettier": {
"optional": true
}
},
"directories": {

@@ -33,0 +39,0 @@ "test": "tests"

@@ -22,3 +22,6 @@ const { promises: fs } = require("fs");

async function saveFile(filePath, data) {
async function saveFile(filePath, data, prettify = undefined) {
if (typeof prettify === "function") {
data = await prettify(data);
}
await ensureDir(dirname(filePath));

@@ -25,0 +28,0 @@ await fs.writeFile(filePath, data, "utf8");

12

src/prettier.js

@@ -5,6 +5,6 @@ /* istanbul ignore file */

function prettify(content, parser) {
async function prettify(content, parser) {
try {
const { format } = require("prettier");
return format(content, { parser });
return await format(content, { parser });
} catch (error) {

@@ -15,10 +15,10 @@ logger.warn("Prettier is not found");

function prettifyMarkdown(content) {
return prettify(content, "markdown");
async function prettifyMarkdown(content) {
return await prettify(content, "markdown");
}
function prettifyJavascript(content) {
return prettify(content, "babel");
async function prettifyJavascript(content) {
return await prettify(content, "babel");
}
module.exports = { prettifyMarkdown, prettifyJavascript };
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