Socket
Socket
Sign inDemoInstall

pug-code-gen

Package Overview
Dependencies
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pug-code-gen - npm Package Compare versions

Comparing version 3.0.2 to 3.0.3-canary-14

22

index.js

@@ -42,2 +42,6 @@ 'use strict';

function isIdentifier(name) {
return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(name);
}
/**

@@ -66,2 +70,19 @@ * Initialize `Compiler` with the given `node`.

}
if (this.options.templateName && !isIdentifier(this.options.templateName)) {
throw new Error(
'The templateName parameter must be a valid JavaScript identifier if specified.'
);
}
if (
this.doctype &&
(this.doctype.includes('<') || this.doctype.includes('>'))
) {
throw new Error('Doctype can not contain "<" or ">"');
}
if (this.options.globals && !this.options.globals.every(isIdentifier)) {
throw new Error(
'The globals option must be an array of valid JavaScript identifiers if specified.'
);
}
this.debug = false !== options.compileDebug;

@@ -172,2 +193,3 @@ this.indents = 0;

}
return (

@@ -174,0 +196,0 @@ buildRuntime(this.runtimeFunctionsUsed) +

8

package.json
{
"name": "pug-code-gen",
"version": "3.0.2",
"version": "3.0.3-canary-14",
"description": "Default code-generator for pug. It generates HTML via a JavaScript template function.",

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

"js-stringify": "^1.0.2",
"pug-attrs": "^3.0.0",
"pug-error": "^2.0.0",
"pug-runtime": "^3.0.0",
"pug-attrs": "3.0.0",
"pug-error": "2.1.0-canary-14",
"pug-runtime": "3.0.1",
"void-elements": "^3.1.0",

@@ -17,0 +17,0 @@ "with": "^7.0.0"

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