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

@zkochan/unified

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zkochan/unified - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

29

index.js

@@ -30,2 +30,3 @@ /**

.use(function (ctx) {
if (ctx.tree) return;
return ctx.context.parse(ctx.file, ctx.settings)

@@ -166,2 +167,8 @@ .then(tree => { ctx.tree = tree });

function createParser (value, settings) {
var file = new VFile(value);
var CustomParser = (this && this.Parser) || Parser;
return new CustomParser(file, settings, instance(this))
}
/**

@@ -181,4 +188,3 @@ * Parse a file.

var file = new VFile(value);
var CustomParser = (this && this.Parser) || Parser;
var nodePromise = new CustomParser(file, settings, instance(this)).parse();
var nodePromise = this.createParser(file, settings).parse();

@@ -247,15 +253,19 @@ return nodePromise.then(node => {

var self = instance(this);
var file = new VFile(value);
var opts = {
'context': self,
'settings': settings || {}
}
if (typeof value === 'string' || value instanceof VFile) {
opts.file = new VFile(value);
} else {
opts.tree = value;
}
var result = null;
return new Promise((resolve, reject) => {
pipeline.run({
'context': self,
'file': file,
'settings': settings || {}
}, function (err, res) {
pipeline.run(opts, function (err, res) {
if (err) return reject(err)
resolve({
file,
file: opts.file,
result: res && res.result

@@ -279,2 +289,3 @@ })

Processor.data = proto.data = data || null;
Processor.createParser = proto.createParser = createParser

@@ -281,0 +292,0 @@ return Processor;

{
"name": "@zkochan/unified",
"version": "0.1.0",
"version": "0.2.0",
"description": "Text processing framework: Parse / Transform / Compile",

@@ -5,0 +5,0 @@ "license": "MIT",

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