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

pug-linker

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pug-linker - npm Package Compare versions

Comparing version 2.0.3 to 3.0.0

24

index.js

@@ -16,6 +16,6 @@ 'use strict';

var hasExtends = ast.nodes[0].type === 'Extends';
checkExtendPosition(ast, hasExtends);
if (hasExtends) {
extendsNode = ast.nodes.shift();
}
checkExtendPosition(ast, hasExtends);
}

@@ -59,2 +59,3 @@ ast = applyIncludes(ast);

parent.nodes = mixins.concat(parent.nodes);
parent.hasExtends = true;
return parent;

@@ -81,5 +82,4 @@ }

flattenParentBlocks(parentBlock.parents, accumulator);
} else {
accumulator.push(parentBlock);
}
accumulator.push(parentBlock);
});

@@ -129,6 +129,20 @@ return accumulator;

if (node.type === 'Include') {
replace(applyYield(link(node.file.ast), node.block));
var childAST = link(node.file.ast);
if (childAST.hasExtends) {
childAST = removeBlocks(childAST);
}
replace(applyYield(childAST, node.block));
}
});
}
function removeBlocks(ast) {
return walk(ast, function (node, replace) {
if (node.type === 'NamedBlock') {
replace({
type: 'Block',
nodes: node.nodes
});
}
});
}

@@ -171,3 +185,3 @@ function applyYield(ast, block) {

} else {
error('EXTENDS_NOT_FIRST', 'Declaration of template inheritance ("extends") should be the first thing in the file.', node);
error('EXTENDS_NOT_FIRST', 'Declaration of template inheritance ("extends") should be the first thing in the file. There can only be one extends statement per file.', node);
}

@@ -174,0 +188,0 @@ }

{
"name": "pug-linker",
"version": "2.0.3",
"version": "3.0.0",
"description": "Link multiple pug ASTs together using include/extends",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is not supported yet

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