mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-24 17:35:16 +00:00
1 line
9.1 KiB
JSON
1 line
9.1 KiB
JSON
|
{"ast":null,"code":"var isMergeableObject = function isMergeableObject(value) {\n return isNonNullObject(value) && !isSpecial(value);\n};\n\nfunction isNonNullObject(value) {\n return !!value && typeof value === 'object';\n}\n\nfunction isSpecial(value) {\n var stringValue = Object.prototype.toString.call(value);\n return stringValue === '[object RegExp]' || stringValue === '[object Date]' || isReactElement(value);\n} // see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\n\n\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n return value.$$typeof === REACT_ELEMENT_TYPE;\n}\n\nfunction emptyTarget(val) {\n return Array.isArray(val) ? [] : {};\n}\n\nfunction cloneUnlessOtherwiseSpecified(value, options) {\n return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;\n}\n\nfunction defaultArrayMerge(target, source, options) {\n return target.concat(source).map(function (element) {\n return cloneUnlessOtherwiseSpecified(element, options);\n });\n}\n\nfunction mergeObject(target, source, options) {\n var destination = {};\n\n if (options.isMergeableObject(target)) {\n Object.keys(target).forEach(function (key) {\n destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n });\n }\n\n Object.keys(source).forEach(function (key) {\n if (!options.isMergeableObject(source[key]) || !target[key]) {\n destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n } else {\n destination[key] = deepmerge(target[key], source[key], options);\n }\n });\n return destination;\n}\n\nfunction deepmerge(target, source, options) {\n options = options || {};\n options.arrayMerge = options.arrayMerge || defaultArrayMerge;\n options.isMergeableObject = options.isMergeableObject || isMergeableObject;\n var sourceIsArray = Array.isArray(source);\n var targetIsArray = Array.isArray(target);\n var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n if (!sourceAndTargetTypesMatch) {\n return cloneUnlessOtherwiseSpecified(source, options);\n } else if (sourceIsArray) {\n return options.arrayMerge(target, source, options);\n } else {\n return mergeObject(target, source, options);\n }\n}\n\ndeepmerge.all = function deepmergeAll(array, options) {\n if (!Array.isArray(array)) {\n throw new Error('first argument should be an array');\n }\n\n return array.reduce(function (prev, next) {\n return deepmerge(prev, next, options);\n }, {});\n};\n\nvar deepmerge_1 = deepmerge;\nexport default deepmerge_1;","map":{"version":3,"sources":["/app/node_modules/deepmerge/dist/es.js"],"names":["isMergeableObject","value","isNonNullObject","isSpecial","stringValue","Object","prototype","toString","call","isReactElement","canUseSymbol","Symbol","for","REACT_ELEMENT_TYPE","$$typeof","emptyTarget","val","Array","isArray","cloneUnlessOtherwiseSpecified","options","clone","deepmerge","defaultArrayMerge","target","source","concat","map","element","mergeObject","destination","keys","forEach","key","arrayMerge","sourceIsArray","targetIsArray","sourceAndTargetTypesMatch","all","deepmergeAll","array","Error","reduce","prev","next","deepmerge_1"],"mappings":"AAAA,IAAIA,iBAAiB,GAAG,SAASA,iBAAT,CAA2BC,KAA3B,EAAkC;AACzD,SAAOC,eAAe,CAACD,KAAD,CAAf,IACH,CAACE,SAAS,CAACF,KAAD,CADd;AAEA,CAHD;;AAKA,SAASC,eAAT,CAAyBD,KAAzB,EAAgC;AAC/B,SAAO,CAAC,CAACA,KAAF,IAAW,OAAOA,KAAP,KAAiB,QAAnC;AACA;;AAED,SAASE,SAAT,CAAmBF,KAAnB,EAA0B;AACzB,MAAIG,WAAW,GAAGC,MAAM,CAACC,SAAP,CAAiBC,QAAjB,CAA0BC,IAA1B,CAA+BP,KAA/B,CAAlB;AAEA,SAAOG,WAAW,KAAK,iBAAhB,IACHA,WAAW,KAAK,eADb,IAEHK,cAAc,CAACR,KAAD,CAFlB;AAGA,C,CAED;;;AACA,IAAIS,YAAY,GAAG,OAAOC,MAAP,KAAkB,UAAlB,IAAgCA,MAAM,CAACC,GAA1D;AACA,IAAIC,kBAAkB,GAAGH,YAAY,GAAGC,MAAM,CAACC,GAAP,CAAW,eAAX,CAAH,GAAiC,MAAtE;;AAEA,SAASH,cAAT,CAAwBR,KAAxB,EAA+B;AAC9B,SAAOA,KAAK,CAACa,QAAN,K
|