2023-10-03 11:14:36 +08:00
|
|
|
export default function _defineEnumerableProperties(obj, descs) {
|
|
|
|
for (var key in descs) {
|
|
|
|
var desc = descs[key];
|
|
|
|
desc.configurable = desc.enumerable = true;
|
|
|
|
if ("value" in desc) desc.writable = true;
|
|
|
|
Object.defineProperty(obj, key, desc);
|
|
|
|
}
|
|
|
|
if (Object.getOwnPropertySymbols) {
|
|
|
|
var objectSymbols = Object.getOwnPropertySymbols(descs);
|
|
|
|
for (var i = 0; i < objectSymbols.length; i++) {
|
|
|
|
var sym = objectSymbols[i];
|
|
|
|
var desc = descs[sym];
|
|
|
|
desc.configurable = desc.enumerable = true;
|
|
|
|
if ("value" in desc) desc.writable = true;
|
|
|
|
Object.defineProperty(obj, sym, desc);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return obj;
|
2023-09-25 15:58:56 +08:00
|
|
|
}
|