@mdui/jq
Version:
拥有和 jQuery 相似 API 的轻量级 JavaScript 工具库
13 lines (12 loc) • 357 B
JavaScript
import { $ } from '../$.js';
import { extend } from '../functions/extend.js';
import { eachObject } from '../shared/helper.js';
$.extend = function (target, ...objectN) {
if (!objectN.length) {
eachObject(target, (prop, value) => {
this[prop] = value;
});
return this;
}
return extend(target, ...objectN);
};