Pinned Loading
-
Make a class Singleton using decorat...
Make a class Singleton using decorator (via Proxy). Enable decorators by setting "experimentalDecorators": true in your tsconfig.json. 1import { describe, expect, it } from "bun:test"
2import { Singleton } from "./singleton"
34describe("@Singleton", () => {
5it("makes class singleton", () => {
-
Relative time ago
Relative time ago 12function timeAgo(time: number, now = Date.now()) {
3const is = (interval: number, cycle: number) =>
4cycle >= interval ? Math.round(cycle / interval) : 0
5
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.