MCPcopy Create free account
hub / github.com/breck7/scroll / _fnMap

Function _fnMap

external/.datatables.js:5844–5864  ·  view source on GitHub ↗

* See if a property is defined on one object, if so assign it to the other object * @param {object} ret target object * @param {object} src source object * @param {string} name property * @param {string} [mappedName] name to map too - optional, name used if not given * @memberof DataT

(ret, src, name, mappedName)

Source from the content-addressed store, hash-verified

5842 * @memberof DataTable#oApi
5843 */
5844 function _fnMap(ret, src, name, mappedName) {
5845 if (Array.isArray(name)) {
5846 $.each(name, function (i, val) {
5847 if (Array.isArray(val)) {
5848 _fnMap(ret, src, val[0], val[1])
5849 } else {
5850 _fnMap(ret, src, val)
5851 }
5852 })
5853
5854 return
5855 }
5856
5857 if (mappedName === undefined) {
5858 mappedName = name
5859 }
5860
5861 if (src[name] !== undefined) {
5862 ret[mappedName] = src[name]
5863 }
5864 }
5865
5866 /**
5867 * Extend objects - very similar to jQuery.extend, but deep copy objects, and

Callers 2

DataTableFunction · 0.85
_fnColumnOptionsFunction · 0.85

Calls 1

eachMethod · 0.80

Tested by

no test coverage detected