UNPKG

@salesforce/source-deploy-retrieve

Version:

JavaScript library to run Salesforce metadata deploys and retrieves

46 lines (45 loc) 1.83 kB
/** * This is an extension of the Map class that can match keys whether they are encoded or decoded. * Decoding the key can solve some edge cases in component fullNames such as Layouts and Profiles. * See: https://github.com/forcedotcom/cli/issues/1683 * * Examples: * * Given a map with entries: * ```javascript * 'layout#Layout__Broker__c-v1.1 Broker Layout' : {...} * 'layout#Layout__Broker__c-v9%2E2 Broker Layout' : {...} * ``` * * `decodeableMap.has('layout#Layout__Broker__c-v1%2E1 Broker Layout')` --> returns `true` * `decodeableMap.has('layout#Layout__Broker__c-v9.2 Broker Layout')` --> returns `true` * * DO NOT PASS VALUES to the Constructor. Instantiate the class and use the methods. */ export declare class DecodeableMap<K extends string, V> extends Map<string, V> { private internalkeysMap; private internalLogger; private get keysMap(); private get logger(); /** * boolean indicating whether an element with the specified key (matching decoded) exists or not. */ has(key: K): boolean; /** * Returns a specified element from the Map object. If the value that is associated to * the provided key (matching decoded) is an object, then you will get a reference to * that object and any change made to that object will effectively modify it inside the Map. */ get(key: K): V | undefined; /** * Adds a new element with a specified key and value to the Map. If an element with the * same key (encoded or decoded) already exists, the element will be updated. */ set(key: K, value: V): this; /** * true if an element in the Map existed (matching encoded or decoded key) and has been * removed, or false if the element does not exist. */ delete(key: K): boolean; private getExistingKey; }