Telegram Web K with changes to work inside I2P
https://web.telegram.i2p/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
461 B
13 lines
461 B
2 years ago
|
export default function defineNotNumerableProperties<T extends any>(obj: T, names: (keyof T)[]) {
|
||
|
//const perf = performance.now();
|
||
|
const props = {writable: true, configurable: true};
|
||
|
const out: {[name in keyof T]?: typeof props} = {};
|
||
|
names.forEach(name => {
|
||
|
if(!obj.hasOwnProperty(name)) {
|
||
|
out[name] = props;
|
||
|
}
|
||
|
});
|
||
|
Object.defineProperties(obj, out);
|
||
|
//console.log('defineNotNumerableProperties time:', performance.now() - perf);
|
||
|
}
|