Socket
Socket
Sign inDemoInstall

pug-walk

Package Overview
Dependencies
Maintainers
3
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pug-walk - npm Package Compare versions

Comparing version 1.1.8 to 2.0.0-canary-1

20

index.js

@@ -10,13 +10,16 @@ 'use strict';

options = options || {includeDependencies: false};
var parents = options.parents = options.parents || [];
var parents = (options.parents = options.parents || []);
var replace = function replace(replacement) {
if (Array.isArray(replacement) && !replace.arrayAllowed) {
throw new Error('replace() can only be called with an array if the last parent is a Block or NamedBlock');
throw new Error(
'replace() can only be called with an array if the last parent is a Block or NamedBlock'
);
}
ast = replacement;
};
replace.arrayAllowed = parents[0] && (
/^(Named)?Block$/.test(parents[0].type) ||
parents[0].type === 'RawInclude' && ast.type === 'IncludeFilter');
replace.arrayAllowed =
parents[0] &&
(/^(Named)?Block$/.test(parents[0].type) ||
(parents[0].type === 'RawInclude' && ast.type === 'IncludeFilter'));

@@ -60,2 +63,7 @@ if (before) {

break;
case 'EachOf':
if (ast.block) {
ast.block = walkAST(ast.block, before, after, options);
}
break;
case 'Conditional':

@@ -105,3 +113,3 @@ if (ast.consequent) {

function walkAndMergeNodes(nodes) {
return nodes.reduce(function (nodes, node) {
return nodes.reduce(function(nodes, node) {
var result = walkAST(node, before, after, options);

@@ -108,0 +116,0 @@ if (Array.isArray(result)) {

{
"name": "pug-walk",
"version": "1.1.8",
"version": "2.0.0-canary-1",
"description": "Walk and transform a pug AST",

@@ -9,4 +9,4 @@ "keywords": [

"devDependencies": {
"pug-lexer": "^4.1.0",
"pug-parser": "^5.0.1"
"pug-lexer": "5.0.0-canary-1",
"pug-parser": "6.0.0-canary-1"
},

@@ -21,4 +21,3 @@ "files": [

"author": "ForbesLindesay",
"license": "MIT",
"gitHead": "1bdf628a70fda7a0d840c52f3abce54b1c6b0130"
"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