Skip to content

Instantly share code, notes, and snippets.

@Pogix3m
Pogix3m / Array.extension.ts
Last active December 3, 2020 06:05
Group Array By Id in TypeScript
/* tslint:disable */
export {};
type TGroup<T> = {Id: any; Values: T[]};
declare global {
interface Array<T> {
groupBy(aKey: string): TGroup<T>[];
}
}
@Pogix3m
Pogix3m / BigInt.extention.ts
Created April 20, 2020 15:18
Serialize BigInt in TypeScript
/* tslint:disable: interface-name */
export {};
declare global {
interface BigInt {
toJSON(): string;
}
}
BigInt.prototype.toJSON = function(): string {