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

Function cloneShallowElement

frontend/public/swagger-ui-bundle.js:42697–42715  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

42695 const { key: o, value: i } = s
42696 return new Su.KeyValuePair(o, i)
42697 },
42698 cloneShallowElement = (s) => {
42699 const o = new s.constructor()
42700 if (
42701 ((o.element = s.element),
42702 hasElementSourceMap(s) && assignSourceMap(o, s),
42703 s.meta.length > 0 && (o._meta = cloneDeep(s.meta)),
42704 s.attributes.length > 0 && (o._attributes = cloneDeep(s.attributes)),
42705 Cu(s.content))
42706 ) {
42707 const i = s.content
42708 o.content = cloneShallowElement(i)
42709 } else
42710 Array.isArray(s.content)
42711 ? (o.content = [...s.content])
42712 : s.content instanceof Su.KeyValuePair
42713 ? (o.content = cloneShallowKeyValuePair(s.content))
42714 : (o.content = s.content)
42715 return o
42716 },
42717 cloneShallow = (s) => {
42718 if (s instanceof Su.KeyValuePair) return cloneShallowKeyValuePair(s)

Callers 1

cloneShallowFunction · 0.85

Calls 6

hasElementSourceMapFunction · 0.85
assignSourceMapFunction · 0.85
cloneDeepFunction · 0.85
cloneShallowKeyValuePairFunction · 0.85
CuFunction · 0.50
isArrayMethod · 0.45

Tested by

no test coverage detected