@medusajs/utils
Advanced tools
Comparing version 0.0.1 to 0.0.2-next-20230322093850
@@ -6,9 +6,9 @@ "use strict"; | ||
return function (target, propertyKey, parameterIndex) { | ||
if (!target.MedusaContext_) { | ||
target.MedusaContext_ = {}; | ||
if (!target.MedusaContextIndex_) { | ||
target.MedusaContextIndex_ = {}; | ||
} | ||
if (propertyKey in target.MedusaContext_) { | ||
if (propertyKey in target.MedusaContextIndex_) { | ||
throw new Error(`Only one MedusaContext is allowed on method "${String(propertyKey)}".`); | ||
} | ||
target.MedusaContext_[propertyKey] = parameterIndex; | ||
target.MedusaContextIndex_[propertyKey] = parameterIndex; | ||
}; | ||
@@ -15,0 +15,0 @@ } |
@@ -6,7 +6,7 @@ "use strict"; | ||
return function (target, propertyKey, descriptor) { | ||
if (!target.MedusaContext_) { | ||
if (!target.MedusaContextIndex_) { | ||
throw new Error(`To apply @InjectEntityManager you have to flag a parameter using @MedusaContext`); | ||
} | ||
const originalMethod = descriptor.value; | ||
const argIndex = target.MedusaContext_[propertyKey]; | ||
const argIndex = target.MedusaContextIndex_[propertyKey]; | ||
descriptor.value = async function (...args) { | ||
@@ -13,0 +13,0 @@ const context = args[argIndex] ?? {}; |
@@ -0,1 +1,3 @@ | ||
export * from "./bundles"; | ||
export * from "./decorators"; | ||
export * from "./event-bus"; |
@@ -17,3 +17,5 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./bundles"), exports); | ||
__exportStar(require("./decorators"), exports); | ||
__exportStar(require("./event-bus"), exports); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@medusajs/utils", | ||
"version": "0.0.1", | ||
"version": "0.0.2-next-20230322093850", | ||
"description": "Medusa utilities functions shared by Medusa core and Modules", | ||
@@ -20,3 +20,3 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@medusajs/types": "*", | ||
"@medusajs/types": "0.0.2-next-20230322093850", | ||
"cross-env": "^5.2.1", | ||
@@ -29,3 +29,3 @@ "jest": "^25.5.4", | ||
"peerDependencies": { | ||
"@medusajs/types": "^0.0.1" | ||
"@medusajs/types": "0.0.2-next-20230322093850" | ||
}, | ||
@@ -35,4 +35,5 @@ "scripts": { | ||
"build": "tsc --build", | ||
"watch": "tsc --build --watch", | ||
"test": "jest --passWithNoTests src" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16063
28
229