MCPcopy Index your code
hub / github.com/dataease/SQLBot / hasOrAdd

Function hasOrAdd

frontend/public/swagger-ui-bundle.js:48360–48398  ·  view source on GitHub ↗
(s, o, i)

Source from the content-addressed store, hash-verified

48358 return i
48359 })
48360 const uv = lv
48361 function hasOrAdd(s, o, i) {
48362 var a,
48363 u = typeof s
48364 switch (u) {
48365 case 'string':
48366 case 'number':
48367 return 0 === s && 1 / s == -1 / 0
48368 ? !!i._items['-0'] || (o && (i._items['-0'] = !0), !1)
48369 : null !== i._nativeSet
48370 ? o
48371 ? ((a = i._nativeSet.size), i._nativeSet.add(s), i._nativeSet.size === a)
48372 : i._nativeSet.has(s)
48373 : u in i._items
48374 ? s in i._items[u] || (o && (i._items[u][s] = !0), !1)
48375 : (o && ((i._items[u] = {}), (i._items[u][s] = !0)), !1)
48376 case 'boolean':
48377 if (u in i._items) {
48378 var _ = s ? 1 : 0
48379 return !!i._items[u][_] || (o && (i._items[u][_] = !0), !1)
48380 }
48381 return (o && (i._items[u] = s ? [!1, !0] : [!0, !1]), !1)
48382 case 'function':
48383 return null !== i._nativeSet
48384 ? o
48385 ? ((a = i._nativeSet.size), i._nativeSet.add(s), i._nativeSet.size === a)
48386 : i._nativeSet.has(s)
48387 : u in i._items
48388 ? !!_includes(s, i._items[u]) || (o && i._items[u].push(s), !1)
48389 : (o && (i._items[u] = [s]), !1)
48390 case 'undefined':
48391 return !!i._items[u] || (o && (i._items[u] = !0), !1)
48392 case 'object':
48393 if (null === s) return !!i._items.null || (o && (i._items.null = !0), !1)
48394 default:
48395 return (u = Object.prototype.toString.call(s)) in i._items
48396 ? !!_includes(s, i._items[u]) || (o && i._items[u].push(s), !1)
48397 : (o && (i._items[u] = [s]), !1)
48398 }
48399 }
48400 const pv = (function () {
48401 function _Set() {

Callers 1

Calls 4

_includesFunction · 0.85
addMethod · 0.65
hasMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected