@puppedo/core
Version:
PuppeDo is a runner for tests E2E in YAML style. With power of Playwright or Puppeteer.
20 lines (14 loc) • 438 B
text/typescript
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck
// https://gist.github.com/ilfroloff/76fa55d041b6a1cd2dbe
const singleton = Symbol('singleton');
export default class Singleton {
constructor() {
const Class = new.target; // or this.constructor
if (!Class[singleton]) {
Class[singleton] = this;
}
// eslint-disable-next-line no-constructor-return
return Class[singleton];
}
}