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

@dww/gatsby-remark-graphql

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dww/gatsby-remark-graphql - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

40

index.js
const RemarkPlugin = require('@dww/remark-plugin-graphql');
module.exports = ({markdownAST}, opts) => {
const transformer = RemarkPlugin(opts);
return transformer(markdownAST);
// From https://github.com/jxson/front-matter/blob/master/index.js
var optionalByteOrderMark = '\\ufeff?';
var platform = typeof process !== 'undefined' ? process.platform : '';
var pattern = '^(' +
optionalByteOrderMark +
'(= yaml =|---)' +
'$([\\s\\S]*?)' +
'^(?:\\2|\\.\\.\\.)\\s*' +
'$' +
(platform === 'win32' ? '\\r?' : '') +
'(?:\\n)?)';
// NOTE: If this pattern uses the 'g' flag the `regex` variable definition will
// need to be moved down into the functions that use it.
var frontmatterRegex = new RegExp(pattern, 'm');
function markdownOffset({markdownAST, markdownNode}) {
const match = frontmatterRegex.exec(markdownNode.rawBody || '');
if (!match) {
return 0;
}
const lines = match[match.length - 1].split(/\r\n|[\n\r]/g);
return lines.length;
}
module.exports = (
{markdownAST, markdownNode, reporter, ...gatsbyOpts},
opts,
) => {
const transformer = RemarkPlugin({
...opts,
markdownOffset: markdownOffset({markdownAST, markdownNode}),
});
try {
return transformer(markdownAST);
} catch (e) {
reporter.error(e);
}
};

4

package.json
{
"name": "@dww/gatsby-remark-graphql",
"version": "1.0.1",
"version": "1.0.2",
"description": "",

@@ -12,4 +12,4 @@ "main": "index.js",

"dependencies": {
"@dww/remark-plugin-graphql": "1.0.1"
"@dww/remark-plugin-graphql": "1.0.2"
}
}
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