MCPcopy Create free account
hub / github.com/6dylan6/jdm / haskey

Method haskey

function/common.js:146–165  ·  view source on GitHub ↗
(data, key, value)

Source from the content-addressed store, hash-verified

144 return CryptoJS.MD5(encryptString).toString()
145 }
146 haskey(data, key, value) {
147 value = typeof value !== 'undefined' ? value : '';
148 var spl = key.split('.');
149 for (var i of spl) {
150 i = !isNaN(i) ? parseInt(i) : i;
151 try {
152 data = data[i];
153 } catch (error) {
154 return '';
155 }
156 }
157 if (data == undefined) {
158 return ''
159 }
160 if (value !== '') {
161 return data === value ? true : false;
162 } else {
163 return data
164 }
165 }
166 match(pattern, string) {
167 pattern = (pattern instanceof Array) ? pattern : [pattern];
168 for (let pat of pattern) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected