Socket
Socket
Sign inDemoInstall

htmljs-parser

Package Overview
Dependencies
Maintainers
5
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

htmljs-parser - npm Package Compare versions

Comparing version 2.4.0 to 2.5.0

23

notify-util.js

@@ -285,2 +285,25 @@ exports.createNotifiers = function(parser, listeners) {

notifyString(string) {
if (hasError) {
return;
}
var eventFunc = listeners.onString;
if (eventFunc) {
var stringEvent = {
type: 'string',
value: string.value,
pos: string.pos,
endPos: string.endPos,
stringParts: string.stringParts,
isStringLiteral: string.isStringLiteral
};
eventFunc.call(parser, stringEvent, parser);
return stringEvent.value;
}
return string.value;
},
notifyFinish() {

@@ -287,0 +310,0 @@ if (listeners.onfinish) {

2

package.json

@@ -41,3 +41,3 @@ {

},
"version": "2.4.0"
"version": "2.5.0"
}

@@ -78,2 +78,10 @@ htmljs-parser

onString: function(event) {
// Text within ""
var value = event.value; // String
var stringParts = event.stringParts; // Array
var isStringLiteral = event.isStringLiteral // Boolean
var pos = event.pos; // Integer
},
onCDATA: function(event) {

@@ -80,0 +88,0 @@ // <![CDATA[<value>]]>

@@ -89,12 +89,3 @@ var path = require('path');

var expectedObject = JSON.parse(expected);
try {
assert.deepEqual(
actual,
expectedObject);
} catch(e) {
// console.error('Unexpected output for "' + name + '":\nEXPECTED (' + expectedPath + '):\n---------\n' + expectedJSON +
// '\n---------\nACTUAL (' + actualPath + '):\n---------\n' + actualJSON + '\n---------');
throw new Error('Unexpected output for "' + name + '"');
}
assert.deepEqual(actual, expectedObject);
} else {

@@ -105,3 +96,3 @@ if (actual !== expected) {

} else {
throw new Error('Unexpected output for "' + name + '"');
assert.deepEqual(actual, expected);
}

@@ -108,0 +99,0 @@ }

@@ -188,2 +188,8 @@ 'use strict';

onString: (event) => {
if (!event.isStringLiteral) {
event.value = '$placeholderString(' + event.value + ')';
}
},
onPlaceholder: (event) => {

@@ -190,0 +196,0 @@ var escape = event.escape;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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