Socket
Socket
Sign inDemoInstall

@riotjs/parser

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@riotjs/parser - npm Package Compare versions

Comparing version 4.1.2 to 4.2.0

3

CHANGELOG.md
# Changes for riot-parser
### v4.1.2
- Update generated bundle fixing discrepancy between source files and bundled output
### v4.1.1

@@ -4,0 +7,0 @@ - Fix end value of the root node

24

index.js

@@ -1248,9 +1248,17 @@ 'use strict';

const pos = start + 2; // skip '<!'
const str = data.substr(pos, 2) === '--' ? '-->' : '>';
const isLongComment = data.substr(pos, 2) === '--';
const str = isLongComment ? '-->' : '>';
const end = data.indexOf(str, pos);
if (end < 0) {
panic(data, unclosedComment, start);
}
pushComment(state, start, end + str.length);
pushComment(
state,
start,
end + str.length,
data.substring(start, end + str.length)
);
return TEXT

@@ -1265,10 +1273,16 @@ }

* @param {number} end - Ending position (last char of the tag)
* @param {string} text - Comment content
* @returns {undefined} void function
* @private
*/
function pushComment(state, start, end) {
flush(state);
function pushComment(state, start, end, text) {
state.pos = end;
if (state.options.comments === true) {
state.last = { type: COMMENT, start, end };
flush(state);
state.last = {
type: COMMENT,
start,
end,
text
};
}

@@ -1275,0 +1289,0 @@ }

{
"name": "@riotjs/parser",
"version": "4.1.2",
"version": "4.2.0",
"description": "The parser for Riot tags",

@@ -5,0 +5,0 @@ "main": "./index.js",

@@ -18,9 +18,17 @@ import {COMMENT, TEXT} from '../node-types'

const pos = start + 2 // skip '<!'
const str = data.substr(pos, 2) === '--' ? '-->' : '>'
const isLongComment = data.substr(pos, 2) === '--'
const str = isLongComment ? '-->' : '>'
const end = data.indexOf(str, pos)
if (end < 0) {
panic(data, unclosedComment, start)
}
pushComment(state, start, end + str.length)
pushComment(
state,
start,
end + str.length,
data.substring(start, end + str.length)
)
return TEXT

@@ -35,11 +43,17 @@ }

* @param {number} end - Ending position (last char of the tag)
* @param {string} text - Comment content
* @returns {undefined} void function
* @private
*/
export function pushComment(state, start, end) {
flush(state)
export function pushComment(state, start, end, text) {
state.pos = end
if (state.options.comments === true) {
state.last = { type: COMMENT, start, end }
flush(state)
state.last = {
type: COMMENT,
start,
end,
text
}
}
}
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