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/

30 lines (25 loc) 1.04 kB
"use strict"; var e = require("@aurelia/platform"); class BrowserPlatform extends e.Platform { static getOrCreate(e, r = {}) { let t = BrowserPlatform.t.get(e); if (t === void 0) { BrowserPlatform.t.set(e, t = new BrowserPlatform(e, r)); } return t; } static set(e, r) { BrowserPlatform.t.set(e, r); } constructor(e, r = {}) { super(e, r); 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(t => this[t] = t in r ? r[t] : e[t]); "fetch requestAnimationFrame cancelAnimationFrame".split(" ").forEach(t => this[t] = t in r ? r[t] : e[t]?.bind(e) ?? notImplemented(t)); } } BrowserPlatform.t = new WeakMap; exports.BrowserPlatform = BrowserPlatform; //# sourceMappingURL=index.cjs.map