Socket
Socket
Sign inDemoInstall

pug-strip-comments

Package Overview
Dependencies
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pug-strip-comments - npm Package Compare versions

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"
}
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