Every line of 'map key value in javascript' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
60 function fillKeys(map, keys, value) { 61 var i = keys.length; 62 while (i--) { 63 map[keys[i]] = value; 64 } 65 return map; 66 }
10 function mapGet(key) { 11 return key == '__proto__' ? undefined : this.__data__[key]; 12 }
21 function getMapKeyByValue (value: SqlTypes, map: typeof VisualTypeSqlTypeSetting | typeof ModelTypeSqlTypeSetting) { 22 let result 23 Object.entries(map).some(([key, values]) => { 24 if (values.includes(value)) { 25 result = key 26 return true 27 } 28 }) 29 return result 30 }
57 function _mapKey(keyMapping, keyName, toMap){ 58 var currentMapping = keyMapping[keyName]; 59 //if no states are mapped to this key yet then map the toMap to the key 60 if (undefined === currentMapping){ 61 keyMapping[keyName] = toMap; 62 //otherwise if there is a toMap mapped then turn the mapping into an array 63 // including the already mapped toMap and the new toMap 64 }else if (typeof currentMapping === "string"){ 65 keyMapping[keyName] = [currentMapping, toMap]; 66 //otherwise we have multiple states mapped already, just add another one onto the array 67 }else{ 68 keyMapping[keyName][currentMapping.length] = toMap; 69 } 70 }
23 transform(value: any): any { 24 const keys = []; 25 const valueKeys = Object.keys(value); 26 for (const key of valueKeys) { 27 keys.push({ key, value: value[key] }); 28 } 29 return keys; 30 }
170 function toValue(key) { 171 return this[key] 172 }
47 function setDataByMap (v, k) { 48 setElementData(DATA_CACHE_PUBLIC, elem, k, v); 49 }