UNPKG

@aurelia/platform-browser

Version:

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/) [![CircleCI](https://circleci.com/

28 lines (24 loc) 1.01 kB
import { Platform as e } from "@aurelia/platform"; class BrowserPlatform extends e { static getOrCreate(e, t = {}) { let r = BrowserPlatform.t.get(e); if (r === void 0) { BrowserPlatform.t.set(e, r = new BrowserPlatform(e, t)); } return r; } static set(e, t) { BrowserPlatform.t.set(e, t); } constructor(e, t = {}) { super(e, t); const notImplemented = e => () => { throw new Error(`The PLATFORM did not receive a valid reference to the global function '${e}'.`); }; ("Node Element HTMLElement CustomEvent CSSStyleSheet ShadowRoot MutationObserver " + "window document customElements").split(" ").forEach(r => this[r] = r in t ? t[r] : e[r]); "fetch requestAnimationFrame cancelAnimationFrame".split(" ").forEach(r => this[r] = r in t ? t[r] : e[r]?.bind(e) ?? notImplemented(r)); } } BrowserPlatform.t = new WeakMap; export { BrowserPlatform }; //# sourceMappingURL=index.mjs.map