Socket
Socket
Sign inDemoInstall

pug-strip-comments

Package Overview
Dependencies
Maintainers
2
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 0.0.1 to 1.0.1

5

CHANGELOG.md

@@ -5,2 +5,7 @@ # Change Log

## 1.0.1 - 2016-08-10
### Changed
- Project name is changed to Pug
- Otherwise unchanged from 1.0.0
## 1.0.0 - 2015-08-10

@@ -7,0 +12,0 @@ ### Added

4

index.js
'use strict';
var jadeError = require('pug-error');
var error = require('pug-error');

@@ -9,3 +9,3 @@ module.exports = stripComments;

var msg = '`' + type + '` encountered when ' + occasion;
throw jadeError('UNEXPECTED_TOKEN', msg, { filename: filename, line: line });
throw error('UNEXPECTED_TOKEN', msg, { filename: filename, line: line });
}

@@ -12,0 +12,0 @@

{
"name": "pug-strip-comments",
"version": "0.0.1",
"description": "Strip comments from a Jade token stream (from the lexer)",
"version": "1.0.1",
"description": "Strip comments from a Pug token stream (from the lexer)",
"keywords": [
"jade",
"pug"
],
"dependencies": {
"pug-error": "^0.0.0"
"pug-error": "^1.0.0"
},

@@ -23,3 +22,3 @@ "devDependencies": {

"type": "git",
"url": "https://github.com/jadejs/jade-strip-comments.git"
"url": "https://github.com/pugjs/pug-strip-comments.git"
},

@@ -26,0 +25,0 @@ "author": "Timothy Gu <timothygu99@gmail.com>",

@@ -1,12 +0,12 @@

# jade-strip-comments
# pug-strip-comments
Strips comments from Jade token stream
Strips comments from Pug token stream
[![Build Status](https://img.shields.io/travis/jadejs/jade-strip-comments/master.svg)](https://travis-ci.org/jadejs/jade-strip-comments)
[![Dependency Status](https://img.shields.io/gemnasium/jadejs/jade-strip-comments.svg)](https://gemnasium.com/jadejs/jade-strip-comments)
[![NPM version](https://img.shields.io/npm/v/jade-strip-comments.svg)](https://www.npmjs.org/package/jade-strip-comments)
[![Build Status](https://img.shields.io/travis/pugjs/pug-strip-comments/master.svg)](https://travis-ci.org/pugjs/pug-strip-comments)
[![Dependency Status](https://img.shields.io/david/pugjs/pug-strip-comments.svg)](https://david-dm.org/pugjs/pug-strip-comments)
[![NPM version](https://img.shields.io/npm/v/pug-strip-comments.svg)](https://www.npmjs.org/package/pug-strip-comments)
## Installation
npm install jade-strip-comments
npm install pug-strip-comments

@@ -16,4 +16,4 @@ ## Usage

```js
var lex = require('jade-lexer');
var stripComments = require('jade-strip-comments');
var lex = require('pug-lexer');
var stripComments = require('pug-strip-comments');

@@ -27,3 +27,3 @@ var tokens = lex('//- unbuffered\n// buffered');

// Only strip unbuffered comments (default)
stripComments(tokens, { filename: 'jade' });
stripComments(tokens, { filename: 'pug' });
// [ { type: 'newline', line: 2 },

@@ -34,3 +34,3 @@ // { type: 'comment', line: 2, val: ' buffered', buffer: true },

// Only strip buffered comments (when you want to play a joke on your coworkers)
stripComments(tokens, { filename: 'jade', stripUnbuffered: false, stripBuffered: true });
stripComments(tokens, { filename: 'pug', stripUnbuffered: false, stripBuffered: true });
// [ { type: 'comment', line: 1, val: ' unbuffered', buffer: false },

@@ -40,4 +40,4 @@ // { type: 'newline', line: 2 },

// Strip both (if you want Jade VERY clean)
stripComments(tokens, { filename: 'jade', stripBuffered: true });
// Strip both (if you want Pug VERY clean)
stripComments(tokens, { filename: 'pug', stripBuffered: true });
// [ { type: 'newline', line: 2 },

@@ -44,0 +44,0 @@ // { type: 'eos', line: 2 } ]

@@ -8,3 +8,3 @@ {"type":"comment","line":1,"val":"","buffer":false}

{"type":"newline","line":4}
{"type":"comment","line":4,"val":" test/cases/comments.source.jade","buffer":false}
{"type":"comment","line":4,"val":" test/cases/comments.source.pug","buffer":false}
{"type":"text","line":5,"val":""}

@@ -14,3 +14,3 @@ {"type":"newline","line":6}

{"type":"start-pipeless-text","line":6}
{"type":"text","line":7,"val":"test/cases/comments.source.jade"}
{"type":"text","line":7,"val":"test/cases/comments.source.pug"}
{"type":"newline","line":8}

@@ -17,0 +17,0 @@ {"type":"text","line":8,"val":"when"}

@@ -8,3 +8,3 @@ {"type":"comment","line":1,"val":"","buffer":false}

{"type":"newline","line":4}
{"type":"comment","line":4,"val":" test/cases/comments.source.jade","buffer":false}
{"type":"comment","line":4,"val":" test/cases/comments.source.pug","buffer":false}
{"type":"text","line":5,"val":""}

@@ -14,3 +14,3 @@ {"type":"newline","line":6}

{"type":"start-pipeless-text","line":6}
{"type":"text","line":7,"val":"test/cases/comments.source.jade"}
{"type":"text","line":7,"val":"test/cases/comments.source.pug"}
{"type":"newline","line":8}

@@ -17,0 +17,0 @@ {"type":"text","line":8,"val":"when"}

{
"msg": "`comment` encountered when already in a comment",
"code": "JADE:UNEXPECTED_TOKEN",
"code": "PUG:UNEXPECTED_TOKEN",
"line": 2
}
{
"msg": "`end-pipeless-text` encountered when not in pipeless text mode",
"code": "JADE:UNEXPECTED_TOKEN",
"code": "PUG:UNEXPECTED_TOKEN",
"line": 4
}
{
"msg": "`start-pipeless-text` encountered when already in pipeless text mode",
"code": "JADE:UNEXPECTED_TOKEN",
"code": "PUG:UNEXPECTED_TOKEN",
"line": 3
}

@@ -49,3 +49,3 @@ 'use strict';

} catch (ex) {
if (!ex || !ex.code || !ex.code.indexOf('JADE:') === 0) throw ex;
if (!ex || !ex.code || !ex.code.indexOf('PUG:') === 0) throw ex;
actual = {

@@ -52,0 +52,0 @@ msg: ex.msg,

@@ -63,3 +63,3 @@ 'use strict';

} catch (ex) {
if (!ex || !ex.code || !ex.code.indexOf('JADE:') === 0) throw ex;
if (!ex || !ex.code || !ex.code.indexOf('PUG:') === 0) throw ex;
actual = {

@@ -66,0 +66,0 @@ msg: ex.msg,

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