UNPKG

ember-source

Version:

A JavaScript framework for creating ambitious web applications

30 lines (27 loc) 1.42 kB
import '../../../@ember/object/index.js'; import '../../../@ember/debug/index.js'; import EmberRouter from '../../../@ember/routing/router.js'; import { isDevelopingApp } from '@embroider/macros'; import { assert } from '../../../@ember/debug/lib/assert.js'; import { g as get } from '../../../shared-chunks/observers-DhgQ6ba5.js'; import '../../../@ember/-internals/meta/lib/meta.js'; import '../../../shared-chunks/mandatory-setter-DLKyVs4Q.js'; import '../../../@glimmer/destroyable/index.js'; import '../../../@glimmer/validator/index.js'; import '../../../shared-chunks/debug-to-string-BsFOvUtQ.js'; import '../../../@glimmer/global-context/index.js'; import '../../../shared-chunks/reference-B6HMX4y0.js'; import '../../../shared-chunks/capabilities-DHiXCCuB.js'; import '../../../shared-chunks/env-DEd6hPbj.js'; /** @module ember */ function currentURL(app) { (isDevelopingApp() && !(app.__container__) && assert('[BUG] app.__container__ is not set', app.__container__)); let router = app.__container__.lookup('router:main'); (isDevelopingApp() && !(router instanceof EmberRouter) && assert('[BUG] router:main is not a Router', router instanceof EmberRouter)); let location = get(router, 'location'); (isDevelopingApp() && !(typeof location !== 'string') && assert('[BUG] location is still a string', typeof location !== 'string')); return location.getURL(); } export { currentURL as default };