pug-load
Advanced tools
Comparing version 1.0.3 to 2.0.0
19
index.js
@@ -30,3 +30,8 @@ 'use strict'; | ||
if (node.type === 'Extends' || node.type === 'Include') { | ||
file.ast = load.string(str, path, options); | ||
var childOptions = {}; | ||
Object.keys(options).forEach(function (key) { | ||
childOptions[key] = options[key]; | ||
}) | ||
childOptions.filename = path; | ||
file.ast = load.string(str, childOptions); | ||
} | ||
@@ -38,6 +43,7 @@ } | ||
load.string = function loadString(str, filename, options) { | ||
load.string = function loadString(src, options) { | ||
load.validateOptions(options); | ||
var tokens = options.lex(str, filename); | ||
var ast = options.parse(tokens, filename); | ||
options.src = src; | ||
var tokens = options.lex(src, options); | ||
var ast = options.parse(tokens, options); | ||
return load(ast, options); | ||
@@ -47,4 +53,5 @@ }; | ||
load.validateOptions(options); | ||
var str = (options.read || load.read)(filename, options); | ||
return load.string(str, filename, options); | ||
options.filename = filename; | ||
var str = (options.read || load.read)(filename); | ||
return load.string(str, options); | ||
} | ||
@@ -51,0 +58,0 @@ |
{ | ||
"name": "pug-load", | ||
"version": "1.0.3", | ||
"version": "2.0.0", | ||
"description": "The pug loader is responsible for loading the depenendencies of a given pug file.", | ||
@@ -12,4 +12,4 @@ "keywords": [ | ||
"devDependencies": { | ||
"pug-lexer": "^1.0.0", | ||
"pug-parser": "^1.0.0" | ||
"pug-lexer": "^2.0.0", | ||
"pug-parser": "^2.0.0" | ||
}, | ||
@@ -25,2 +25,2 @@ "scripts": { | ||
"license": "MIT" | ||
} | ||
} |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
12164
12
199
1