MCPcopy Create free account
hub / github.com/dataease/SQLBot / _generate

Function _generate

frontend/public/swagger-ui-bundle.js:38857–38916  ·  view source on GitHub ↗
(s, o, i, a, u)

Source from the content-addressed store, hash-verified

38855 var a = s.patches
38856 return (a.length > 0 && ((s.patches = []), s.callback && s.callback(a)), a)
38857 }
38858 function _generate(s, o, i, a, u) {
38859 if (o !== s) {
38860 'function' == typeof o.toJSON && (o = o.toJSON())
38861 for (
38862 var _ = _objectKeys(o), w = _objectKeys(s), x = !1, C = w.length - 1;
38863 C >= 0;
38864 C--
38865 ) {
38866 var j = s[(B = w[C])]
38867 if (
38868 !module_helpers_hasOwnProperty(o, B) ||
38869 (void 0 === o[B] && void 0 !== j && !1 === Array.isArray(o))
38870 )
38871 Array.isArray(s) === Array.isArray(o)
38872 ? (u &&
38873 i.push({
38874 op: 'test',
38875 path: a + '/' + escapePathComponent(B),
38876 value: _deepClone(j),
38877 }),
38878 i.push({ op: 'remove', path: a + '/' + escapePathComponent(B) }),
38879 (x = !0))
38880 : (u && i.push({ op: 'test', path: a, value: s }),
38881 i.push({ op: 'replace', path: a, value: o }),
38882 !0)
38883 else {
38884 var L = o[B]
38885 'object' == typeof j &&
38886 null != j &&
38887 'object' == typeof L &&
38888 null != L &&
38889 Array.isArray(j) === Array.isArray(L)
38890 ? _generate(j, L, i, a + '/' + escapePathComponent(B), u)
38891 : j !== L &&
38892 (u &&
38893 i.push({
38894 op: 'test',
38895 path: a + '/' + escapePathComponent(B),
38896 value: _deepClone(j),
38897 }),
38898 i.push({
38899 op: 'replace',
38900 path: a + '/' + escapePathComponent(B),
38901 value: _deepClone(L),
38902 }))
38903 }
38904 }
38905 if (x || _.length != w.length)
38906 for (C = 0; C < _.length; C++) {
38907 var B
38908 module_helpers_hasOwnProperty(s, (B = _[C])) ||
38909 void 0 === o[B] ||
38910 i.push({
38911 op: 'add',
38912 path: a + '/' + escapePathComponent(B),
38913 value: _deepClone(o[B]),
38914 })

Callers 2

generateFunction · 0.85
compareFunction · 0.85

Calls 7

_objectKeysFunction · 0.85
escapePathComponentFunction · 0.85
_deepCloneFunction · 0.85
toJSONMethod · 0.80
isArrayMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected