@salesforce/core
Advanced tools
Comparing version 7.3.11 to 7.3.12
import { AnyJson } from '@salesforce/ts-types'; | ||
type callback = (data: any) => Promise<void>; | ||
export type callback = (data: any) => Promise<void>; | ||
type ListenerMap = Map<string, callback>; | ||
export type UniqueListenerMap = Map<string, ListenerMap>; | ||
/** | ||
@@ -95,2 +97,3 @@ * An asynchronous event listener and emitter that follows the singleton pattern. The singleton pattern allows lifecycle | ||
} | ||
export declare const cloneUniqueListeners: (uniqueListeners: UniqueListenerMap) => UniqueListenerMap; | ||
export {}; |
@@ -32,3 +32,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Lifecycle = void 0; | ||
exports.cloneUniqueListeners = exports.Lifecycle = void 0; | ||
const semver_1 = require("semver"); | ||
@@ -106,4 +106,4 @@ // needed for TS to not put everything inside /lib/src | ||
// use the newer version and transfer any listeners from the old version | ||
// object spread keeps them from being references | ||
global.salesforceCoreLifecycle = new Lifecycle({ ...oldInstance.listeners }, oldInstance.uniqueListeners); | ||
// object spread and the clone fn keep them from being references | ||
global.salesforceCoreLifecycle = new Lifecycle({ ...oldInstance.listeners }, (0, exports.cloneUniqueListeners)(oldInstance.uniqueListeners)); | ||
// clean up any listeners on the old version | ||
@@ -237,2 +237,5 @@ Object.keys(oldInstance.listeners).map((eventName) => { | ||
exports.Lifecycle = Lifecycle; | ||
const cloneListeners = (listeners) => new Map(Array.from(listeners.entries())); | ||
const cloneUniqueListeners = (uniqueListeners) => new Map(Array.from(uniqueListeners.entries()).map(([key, value]) => [key, cloneListeners(value)])); | ||
exports.cloneUniqueListeners = cloneUniqueListeners; | ||
//# sourceMappingURL=lifecycleEvents.js.map |
{ | ||
"name": "@salesforce/core", | ||
"version": "7.3.11", | ||
"version": "7.3.12", | ||
"description": "Core libraries to interact with SFDX projects, orgs, and APIs.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index", |
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
1035731
22070