🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@vue-macros/common

Package Overview
Dependencies
Maintainers
1
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vue-macros/common - npm Package Compare versions

Comparing version
3.1.2
to
3.1.3
+1
-1
dist/index.d.ts

@@ -23,3 +23,3 @@ import { CodeTransform, MagicString, MagicStringAST } from "magic-string-ast";

declare const HELPER_PREFIX = "__MACROS_";
declare function importHelperFn(s: MagicString, offset: number, imported: string, local?: string, from?: string): string;
declare function importHelperFn(s: MagicString, offset: number, imported: string, local?: string, from?: string, prefix?: string): string;
//#endregion

@@ -26,0 +26,0 @@ //#region src/constants.d.ts

@@ -67,10 +67,10 @@ import { babelParse, getLang, isFunctionType, isLiteralType, resolveObjectKey, resolveString } from "ast-kit";

const HELPER_PREFIX = "__MACROS_";
function importHelperFn(s, offset, imported, local = imported, from = "vue") {
const cacheKey = `${from}@${imported}`;
function importHelperFn(s, offset, imported, local = imported, from = "vue", prefix = HELPER_PREFIX) {
const cacheKey = `${from}@${imported}@${prefix}@${local}`;
if (!importedMap.get(s)?.has(cacheKey)) {
s.appendLeft(offset, `\nimport ${imported === "default" ? HELPER_PREFIX + local : `{ ${imported} as ${HELPER_PREFIX + local} }`} from ${JSON.stringify(from)};`);
s.appendLeft(offset, `\nimport ${imported === "default" ? prefix + local : `{ ${imported} as ${prefix + local} }`} from ${JSON.stringify(from)};`);
if (importedMap.has(s)) importedMap.get(s).add(cacheKey);
else importedMap.set(s, new Set([cacheKey]));
}
return `${HELPER_PREFIX}${local}`;
return `${prefix}${local}`;
}

@@ -77,0 +77,0 @@

{
"name": "@vue-macros/common",
"version": "3.1.2",
"version": "3.1.3",
"description": "common feature from Vue Macros.",

@@ -5,0 +5,0 @@ "type": "module",