Socket
Socket
Sign inDemoInstall

@vue/compiler-sfc

Package Overview
Dependencies
Maintainers
1
Versions
274
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vue/compiler-sfc - npm Package Compare versions

Comparing version 3.0.0-alpha.7 to 3.0.0-alpha.8

46

dist/compiler-sfc.cjs.js

@@ -9,2 +9,3 @@ 'use strict';

var LRUCache = _interopDefault(require('lru-cache'));
var shared = require('@vue/shared');
var compilerCore = require('@vue/compiler-core');

@@ -17,41 +18,2 @@ var url = require('url');

const range = 2;
function generateCodeFrame(source, start = 0, end = source.length) {
const lines = source.split(/\r?\n/);
let count = 0;
const res = [];
for (let i = 0; i < lines.length; i++) {
count += lines[i].length + 1;
if (count >= start) {
for (let j = i - range; j <= i + range || end > count; j++) {
if (j < 0 || j >= lines.length)
continue;
const line = j + 1;
res.push(`${line}${' '.repeat(3 - String(line).length)}| ${lines[j]}`);
const lineLength = lines[j].length;
if (j === i) {
// push underline
const pad = start - (count - lineLength) + 1;
const length = Math.max(1, end > count ? lineLength - pad : end - start);
res.push(` | ` + ' '.repeat(pad) + '^'.repeat(length));
}
else if (j > i) {
if (end > count) {
const length = Math.max(Math.min(end - count, lineLength), 1);
res.push(` | ` + '^'.repeat(length));
}
count += lineLength + 1;
}
}
break;
}
}
return res.join('\n');
}
const EMPTY_OBJ = Object.freeze({})
;
const isString = (val) => typeof val === 'string';
const isObject = (val) => val !== null && typeof val === 'object';
const SFC_CACHE_MAX_SIZE = 500;

@@ -142,3 +104,3 @@ const sourceToSFC = new LRUCache(SFC_CACHE_MAX_SIZE);

function warnDuplicateBlock(source, filename, node) {
const codeFrame = generateCodeFrame(source, node.loc.start.offset, node.loc.end.offset);
const codeFrame = shared.generateCodeFrame(source, node.loc.start.offset, node.loc.end.offset);
const location = `${filename}:${node.loc.start.line}:${node.loc.start.column}`;

@@ -262,3 +224,3 @@ console.warn(`Single file component can contain only one ${node.tag} element (${location}):\n\n${codeFrame}`);

// @see https://nodejs.org/api/url.html#url_url_parse_urlstring_parsequerystring_slashesdenotehost
return url.parse(isString(urlString) ? urlString : '');
return url.parse(shared.isString(urlString) ? urlString : '');
}

@@ -457,3 +419,3 @@

let nodeTransforms = [];
if (isObject(transformAssetUrls)) {
if (shared.isObject(transformAssetUrls)) {
nodeTransforms = [

@@ -460,0 +422,0 @@ createAssetUrlTransformWithOptions(transformAssetUrls),

15

package.json
{
"name": "@vue/compiler-sfc",
"version": "3.0.0-alpha.7",
"version": "3.0.0-alpha.8",
"description": "@vue/compiler-sfc",

@@ -18,3 +18,3 @@ "main": "dist/compiler-sfc.cjs.js",

"type": "git",
"url": "git+https://github.com/vuejs/vue.git"
"url": "git+https://github.com/vuejs/vue-next.git"
},

@@ -27,11 +27,12 @@ "keywords": [

"bugs": {
"url": "https://github.com/vuejs/vue/issues"
"url": "https://github.com/vuejs/vue-next/issues"
},
"homepage": "https://github.com/vuejs/vue/tree/dev/packages/compiler-sfc#readme",
"homepage": "https://github.com/vuejs/vue-next/tree/master/packages/compiler-sfc#readme",
"peerDependencies": {
"vue": "3.0.0-alpha.7"
"vue": "3.0.0-alpha.8"
},
"dependencies": {
"@vue/compiler-core": "3.0.0-alpha.7",
"@vue/compiler-dom": "3.0.0-alpha.7",
"@vue/shared": "3.0.0-alpha.8",
"@vue/compiler-core": "3.0.0-alpha.8",
"@vue/compiler-dom": "3.0.0-alpha.8",
"consolidate": "^0.15.1",

@@ -38,0 +39,0 @@ "hash-sum": "^2.0.0",

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