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

@vue/language-plugin-pug

Package Overview
Dependencies
Maintainers
1
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vue/language-plugin-pug - npm Package Compare versions

Comparing version 2.0.29 to 2.1.0

40

index.js

@@ -26,16 +26,28 @@ "use strict";

function createProxyObject(target) {
const proxys = new WeakMap();
return new Proxy(target, {
get(target, prop) {
get(target, prop, receiver) {
if (prop === 'getClassOffset') {
// div.foo#baz.bar
// ^^^ ^^^
// class=" foo bar"
// ^^^ ^^^
// NOTE: we need to expose source offset getter
return function (startOffset) {
return getOffset(target.offset + startOffset);
};
}
if (prop === 'offset') {
const htmlOffset = target.offset;
const nums = [];
for (const mapped of map.toSourceLocation(htmlOffset)) {
nums.push(mapped[0]);
return getOffset(target.offset);
}
const value = Reflect.get(target, prop, receiver);
if (typeof value === 'object' && value !== null) {
let proxyed = proxys.get(value);
if (proxyed) {
return proxyed;
}
return Math.max(-1, ...nums);
proxyed = createProxyObject(value);
proxys.set(value, proxyed);
return proxyed;
}
const value = target[prop];
if (typeof value === 'object') {
return createProxyObject(target[prop]);
}
return value;

@@ -45,2 +57,10 @@ }

}
function getOffset(offset) {
const htmlOffset = offset;
const nums = [];
for (const mapped of map.toSourceLocation(htmlOffset)) {
nums.push(mapped[0]);
}
return Math.max(-1, ...nums);
}
}

@@ -47,0 +67,0 @@ }

{
"name": "@vue/language-plugin-pug",
"version": "2.0.29",
"version": "2.1.0",
"license": "MIT",

@@ -16,9 +16,9 @@ "files": [

"@types/node": "latest",
"@vue/language-core": "2.0.29"
"@vue/language-core": "2.1.0"
},
"dependencies": {
"@volar/source-map": "~2.4.0-alpha.18",
"volar-service-pug": "0.0.59"
"@volar/source-map": "~2.4.1",
"volar-service-pug": "0.0.62"
},
"gitHead": "49ad9563e6f2677595878a000179dfea83fb910c"
"gitHead": "510063740b90b64caedaee1f0bde70974613a92c"
}
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