JKBMRYUQYNJYLBUC6HR2IUAXEQFRZHQ2T4ZAC2EVOHT4SWWL73SQC
ZG6COYLJOFNRVDA6L7AHQR5SIVR373PQDQYISHCTV3YZZAAPOFAQC
TQ57VE45BHV7MOZ6GKTYZEAMAOTXLPQ3ROCWJ2FUCITQWOYVMUIAC
27ELNQF5ACGIS3FZ5ITFD4D4NYMLZ2IJ4WDP7QVTMXLBBFIKICFAC
WTINQMZSNRT5MSAXLMMZVM6OU6TMD4AP4OEUYAXZUFNY5IWFLZSQC
ZGS4FTTFBXTF2SHYTPAJJBWEUVWVYXPSJVEFI5NYJWTW273B4NHAC
WPMKCTWMATYM6IPD5KXMO3OEFUM3J2FYL2FMBPMJNXN4ADTHI56AC
DHO4JCJIELKX4R42XXAMAHVQTTE6OWULLP2QF4BXO3UWC5UTMSMAC
GZRMSSTEWT3T2JERC7WCVT727X237UA6MXWVT6OSV5D5BRD4UOGQC
GJGKS2YPL6XOT4CLQ2NVHUU2W7MDHYE2XC77WWRGPBCPSTWZ5GIAC
return `${monthName} ${d.getDate()}, ${('00' + d.getHours()).substr(-2)}:${(
'00' + d.getMinutes()
).substr(-2)}:${('00' + d.getSeconds()).substr(-2)}`;
return `${monthName} ${d.getDate()}, ${("00" + d.getHours()).substr(-2)}:${(
"00" + d.getMinutes()
).substr(-2)}:${("00" + d.getSeconds()).substr(-2)}`;
export type Const<T> = T extends Function ? T : {
readonly [P in keyof T]: T[P] extends { [k: string]: any } ? Const<T[P]> : T[P];
}
export type Const<T> = T extends Function
? T
: {
readonly [P in keyof T]: T[P] extends { [k: string]: any }
? Const<T[P]>
: T[P];
};
throw new Error("Error, called more than twice with same id: " + k + " , callback the first time was : " + assertOnlyCalledOnceData[k]);
throw new Error(
"Error, called more than twice with same id: " +
k +
" , callback the first time was : " +
assertOnlyCalledOnceData[k]
);
export function LazyProxy<
T extends { [key: string]: any } | { [i: number]: any }
>(factory: () => T): Const<T> {
return (new Proxy(new Lazy(factory), {
get: (target, property, receiver) => {
if (property === "toJSON") {
return () => {
if (target.wasConstructed()) {
return target.get();
} else {
return "[Object Lazy]";
}
};
}
const targetValue = target.get();
return Reflect.get(targetValue, property);
},
ownKeys: (target) => {
const targetValue = target.get();
return Reflect.ownKeys(targetValue);
},
getOwnPropertyDescriptor: (target, property) => {
/**
* https://stackoverflow.com/questions/40352613/why-does-object-keys-and-object-getownpropertynames-produce-different-output
*/
return Object.getOwnPropertyDescriptor(target.get(), property);
},
has: (target, property) => {
// This is called when iterating over array i.e. array.forEach()
return property in target.get()
}
}) as unknown) as Const<T>;
}
let reds = [color1 & 0xFF0000, color2 & 0xFF0000];
let blues = [color1 & 0x0000FF, color2 & 0x0000FF];
let greens = [color1 & 0x00FF00, color2 & 0x00FF00];
let out = Math.round(reds[0] / (0x010000) * reds[1] / (0xFFFFFF)) * 0x010000;
out += Math.round(greens[0] / 0x000100 * greens[1] / 0x00FF00) * 0x000100;
out += Math.round(blues[0] * blues[1] / 0x0000FF);
let reds = [color1 & 0xff0000, color2 & 0xff0000];
let blues = [color1 & 0x0000ff, color2 & 0x0000ff];
let greens = [color1 & 0x00ff00, color2 & 0x00ff00];
let out = Math.round(((reds[0] / 0x010000) * reds[1]) / 0xffffff) * 0x010000;
out += Math.round(((greens[0] / 0x000100) * greens[1]) / 0x00ff00) * 0x000100;
out += Math.round((blues[0] * blues[1]) / 0x0000ff);