MCPcopy Create free account
hub / github.com/circircir-circle/human_exist_device / makeMap

Method makeMap

mini_program/common/Tools.js:279–286  ·  view source on GitHub ↗

* 字符串转对象 * @param {String} str 'key1,key2,...' * @return {Object} in the form of {key1:true, key2:true, ...}

(str)

Source from the content-addressed store, hash-verified

277 * @return {Object} in the form of {key1:true, key2:true, ...}
278 */
279 makeMap(str) {
280 let obj = {},
281 items = str.split(',')
282 for (let i = 0; i < items.length; i++) {
283 obj[items[i]] = !0
284 }
285 return obj
286 }
287
288 /**
289 * 判断数组中是否含有指定元素

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected