Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fimbul/ve

Package Overview
Dependencies
Maintainers
2
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fimbul/ve - npm Package Compare versions

Comparing version 0.11.0 to 0.12.0-dev.20180622

6

package.json
{
"name": "@fimbul/ve",
"version": "0.11.0",
"version": "0.12.0-dev.20180622",
"description": "Vue processor for wotan",

@@ -31,4 +31,4 @@ "main": "src/index",

"dependencies": {
"@fimbul/ymir": "^0.11.0",
"parse5": "^4.0.0",
"@fimbul/ymir": "0.11.0",
"parse5-sax-parser": "^5.0.0",
"tslib": "^1.8.1",

@@ -35,0 +35,0 @@ "void-elements": "^3.1.0"

@@ -5,3 +5,3 @@ "use strict";

const path = require("path");
const parse5 = require("parse5/lib");
const SAXParser = require("parse5-sax-parser");
const voidElements = require("void-elements");

@@ -17,15 +17,15 @@ class Processor extends ymir_1.AbstractProcessor {

if (path.extname(this.sourceFileName) === '.vue') {
const parser = new parse5.SAXParser({ locationInfo: true });
const parser = new SAXParser({ sourceCodeLocationInfo: true });
let depth = 0;
parser.on('startTag', (tagName, _attr, selfClosing, location) => {
if (selfClosing || voidElements[tagName])
parser.on('startTag', (startTag) => {
if (startTag.selfClosing || voidElements[startTag.tagName])
return;
++depth;
if (depth === 1 && tagName === 'script')
this.range.start = location.endOffset;
if (depth === 1 && startTag.tagName === 'script')
this.range.start = startTag.sourceCodeLocation.endOffset;
});
parser.on('endTag', (tagName, location) => {
parser.on('endTag', (endTag) => {
--depth;
if (depth === 0 && tagName === 'script')
this.range.end = location.startOffset;
if (depth === 0 && endTag.tagName === 'script')
this.range.end = endTag.sourceCodeLocation.startOffset;
});

@@ -43,10 +43,10 @@ parser.write(this.source);

let suffix = '';
const parser = new parse5.SAXParser();
const parser = new SAXParser();
let depth = 0;
parser.on('startTag', (tagName, attr, selfClosing) => {
if (selfClosing || voidElements[tagName])
parser.on('startTag', (startTag) => {
if (startTag.selfClosing || voidElements[startTag.tagName])
return;
++depth;
if (depth === 1 && tagName === 'script') {
const lang = attr.find(isLangAttr);
if (depth === 1 && startTag.tagName === 'script') {
const lang = startTag.attrs.find((attr) => attr.name === 'lang');
suffix = lang === undefined ? '.js' : `.${lang.value}`;

@@ -107,5 +107,2 @@ }

exports.Processor = Processor;
function isLangAttr(attr) {
return attr.name === 'lang';
}
//# sourceMappingURL=index.js.map

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