pug-strip-comments
Advanced tools
Comparing version 1.0.4 to 2.0.0-canary-1
29
index.js
@@ -7,8 +7,8 @@ 'use strict'; | ||
function unexpectedToken (type, occasion, filename, line) { | ||
function unexpectedToken(type, occasion, filename, line) { | ||
var msg = '`' + type + '` encountered when ' + occasion; | ||
throw error('UNEXPECTED_TOKEN', msg, { filename: filename, line: line }); | ||
throw error('UNEXPECTED_TOKEN', msg, {filename: filename, line: line}); | ||
} | ||
function stripComments (input, options) { | ||
function stripComments(input, options) { | ||
options = options || {}; | ||
@@ -18,4 +18,4 @@ | ||
var stripUnbuffered = options.stripUnbuffered !== false; | ||
var stripBuffered = options.stripBuffered === true; | ||
var filename = options.filename; | ||
var stripBuffered = options.stripBuffered === true; | ||
var filename = options.filename; | ||
@@ -30,3 +30,3 @@ var out = []; | ||
return input.filter(function (tok) { | ||
return input.filter(function(tok) { | ||
switch (tok.type) { | ||
@@ -36,3 +36,6 @@ case 'comment': | ||
unexpectedToken( | ||
'comment', 'already in a comment', filename, tok.line | ||
'comment', | ||
'already in a comment', | ||
filename, | ||
tok.line | ||
); | ||
@@ -47,4 +50,6 @@ } else { | ||
unexpectedToken( | ||
'start-pipeless-text', 'already in pipeless text mode', | ||
filename, tok.line | ||
'start-pipeless-text', | ||
'already in pipeless text mode', | ||
filename, | ||
tok.line | ||
); | ||
@@ -58,4 +63,6 @@ } | ||
unexpectedToken( | ||
'end-pipeless-text', 'not in pipeless text mode', | ||
filename, tok.line | ||
'end-pipeless-text', | ||
'not in pipeless text mode', | ||
filename, | ||
tok.line | ||
); | ||
@@ -62,0 +69,0 @@ } |
{ | ||
"name": "pug-strip-comments", | ||
"version": "1.0.4", | ||
"version": "2.0.0-canary-1", | ||
"description": "Strip comments from a Pug token stream (from the lexer)", | ||
@@ -9,6 +9,6 @@ "keywords": [ | ||
"dependencies": { | ||
"pug-error": "^1.3.3" | ||
"pug-error": "2.0.0-canary-1" | ||
}, | ||
"devDependencies": { | ||
"line-json": "^1.0.0" | ||
"line-json": "^2.0.0" | ||
}, | ||
@@ -23,4 +23,3 @@ "files": [ | ||
"author": "Timothy Gu <timothygu99@gmail.com>", | ||
"license": "MIT", | ||
"gitHead": "1bdf628a70fda7a0d840c52f3abce54b1c6b0130" | ||
"license": "MIT" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5963
70
2
1
+ Addedpug-error@2.0.0-canary-1(transitive)
- Removedpug-error@1.3.3(transitive)
Updatedpug-error@2.0.0-canary-1