@angular/router 8.2.0 → 8.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/router-testing.umd.js +151 -1
- package/bundles/router-testing.umd.js.map +1 -1
- package/bundles/router-testing.umd.min.js +1 -1
- package/bundles/router-testing.umd.min.js.map +1 -1
- package/bundles/router-upgrade.umd.js +1 -1
- package/bundles/router-upgrade.umd.min.js +1 -1
- package/bundles/router-upgrade.umd.min.js.map +1 -1
- package/bundles/router.umd.js +114 -5
- package/bundles/router.umd.js.map +1 -1
- package/bundles/router.umd.min.js +4 -3
- package/bundles/router.umd.min.js.map +1 -1
- package/esm2015/router.externs.js +2 -2
- package/esm2015/src/config.js +2 -2
- package/esm2015/src/events.js +5 -2
- package/esm2015/src/router.js +2 -2
- package/esm2015/src/version.js +1 -1
- package/esm5/src/config.js +1 -1
- package/esm5/src/events.js +5 -2
- package/esm5/src/router.js +2 -2
- package/esm5/src/version.js +1 -1
- package/fesm2015/router.js +1907 -37
- package/fesm2015/router.js.map +1 -1
- package/fesm2015/testing.js +14 -1
- package/fesm2015/testing.js.map +1 -1
- package/fesm2015/upgrade.js +1 -1
- package/fesm5/router.js +18 -7
- package/fesm5/router.js.map +1 -1
- package/fesm5/testing.js +1 -1
- package/fesm5/upgrade.js +1 -1
- package/package.json +4 -4
- package/router.d.ts +7 -4
- package/router.metadata.json +1 -1
- package/testing/testing.d.ts +1 -1
- package/testing.d.ts +1 -1
- package/upgrade/upgrade.d.ts +1 -1
- package/upgrade.d.ts +1 -1
package/fesm2015/testing.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v8.2.
|
|
2
|
+
* @license Angular v8.2.4
|
|
3
3
|
* (c) 2010-2019 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -91,6 +91,19 @@ SpyNgModuleFactoryLoader.decorators = [
|
|
|
91
91
|
SpyNgModuleFactoryLoader.ctorParameters = () => [
|
|
92
92
|
{ type: Compiler }
|
|
93
93
|
];
|
|
94
|
+
if (false) {
|
|
95
|
+
/**
|
|
96
|
+
* \@docsNotRequired
|
|
97
|
+
* @type {?}
|
|
98
|
+
* @private
|
|
99
|
+
*/
|
|
100
|
+
SpyNgModuleFactoryLoader.prototype._stubbedModules;
|
|
101
|
+
/**
|
|
102
|
+
* @type {?}
|
|
103
|
+
* @private
|
|
104
|
+
*/
|
|
105
|
+
SpyNgModuleFactoryLoader.prototype.compiler;
|
|
106
|
+
}
|
|
94
107
|
/**
|
|
95
108
|
* @param {?} opts
|
|
96
109
|
* @return {?}
|
package/fesm2015/testing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.js","sources":["../testing/src/router_testing_module.ts","../testing/testing.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Location, LocationStrategy} from '@angular/common';\nimport {MockLocationStrategy, SpyLocation} from '@angular/common/testing';\nimport {Compiler, Injectable, Injector, ModuleWithProviders, NgModule, NgModuleFactory, NgModuleFactoryLoader, Optional} from '@angular/core';\nimport {ChildrenOutletContexts, ExtraOptions, NoPreloading, PreloadingStrategy, ROUTER_CONFIGURATION, ROUTES, Route, Router, RouterModule, Routes, UrlHandlingStrategy, UrlSerializer, provideRoutes, ɵROUTER_PROVIDERS as ROUTER_PROVIDERS, ɵflatten as flatten} from '@angular/router';\n\n\n\n/**\n * @description\n *\n * Allows to simulate the loading of ng modules in tests.\n *\n * ```\n * const loader = TestBed.get(NgModuleFactoryLoader);\n *\n * @Component({template: 'lazy-loaded'})\n * class LazyLoadedComponent {}\n * @NgModule({\n * declarations: [LazyLoadedComponent],\n * imports: [RouterModule.forChild([{path: 'loaded', component: LazyLoadedComponent}])]\n * })\n *\n * class LoadedModule {}\n *\n * // sets up stubbedModules\n * loader.stubbedModules = {lazyModule: LoadedModule};\n *\n * router.resetConfig([\n * {path: 'lazy', loadChildren: 'lazyModule'},\n * ]);\n *\n * router.navigateByUrl('/lazy/loaded');\n * ```\n *\n * @publicApi\n */\n@Injectable()\nexport class SpyNgModuleFactoryLoader implements NgModuleFactoryLoader {\n /**\n * @docsNotRequired\n */\n private _stubbedModules: {[path: string]: Promise<NgModuleFactory<any>>} = {};\n\n /**\n * @docsNotRequired\n */\n set stubbedModules(modules: {[path: string]: any}) {\n const res: {[path: string]: any} = {};\n for (const t of Object.keys(modules)) {\n res[t] = this.compiler.compileModuleAsync(modules[t]);\n }\n this._stubbedModules = res;\n }\n\n /**\n * @docsNotRequired\n */\n get stubbedModules(): {[path: string]: any} { return this._stubbedModules; }\n\n constructor(private compiler: Compiler) {}\n\n load(path: string): Promise<NgModuleFactory<any>> {\n if (this._stubbedModules[path]) {\n return this._stubbedModules[path];\n } else {\n return <any>Promise.reject(new Error(`Cannot find module ${path}`));\n }\n }\n}\n\nfunction isUrlHandlingStrategy(opts: ExtraOptions | UrlHandlingStrategy):\n opts is UrlHandlingStrategy {\n // This property check is needed because UrlHandlingStrategy is an interface and doesn't exist at\n // runtime.\n return 'shouldProcessUrl' in opts;\n}\n\n/**\n * Router setup factory function used for testing.\n *\n * @publicApi\n */\nexport function setupTestingRouter(\n urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts, location: Location,\n loader: NgModuleFactoryLoader, compiler: Compiler, injector: Injector, routes: Route[][],\n opts?: ExtraOptions, urlHandlingStrategy?: UrlHandlingStrategy): Router;\n\n/**\n * Router setup factory function used for testing.\n *\n * @deprecated As of v5.2. The 2nd-to-last argument should be `ExtraOptions`, not\n * `UrlHandlingStrategy`\n * @publicApi\n */\nexport function setupTestingRouter(\n urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts, location: Location,\n loader: NgModuleFactoryLoader, compiler: Compiler, injector: Injector, routes: Route[][],\n urlHandlingStrategy?: UrlHandlingStrategy): Router;\n\n/**\n * Router setup factory function used for testing.\n *\n * @publicApi\n */\nexport function setupTestingRouter(\n urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts, location: Location,\n loader: NgModuleFactoryLoader, compiler: Compiler, injector: Injector, routes: Route[][],\n opts?: ExtraOptions | UrlHandlingStrategy, urlHandlingStrategy?: UrlHandlingStrategy) {\n const router = new Router(\n null !, urlSerializer, contexts, location, injector, loader, compiler, flatten(routes));\n if (opts) {\n // Handle deprecated argument ordering.\n if (isUrlHandlingStrategy(opts)) {\n router.urlHandlingStrategy = opts;\n } else {\n // Handle ExtraOptions\n\n if (opts.malformedUriErrorHandler) {\n router.malformedUriErrorHandler = opts.malformedUriErrorHandler;\n }\n\n if (opts.paramsInheritanceStrategy) {\n router.paramsInheritanceStrategy = opts.paramsInheritanceStrategy;\n }\n }\n }\n\n if (urlHandlingStrategy) {\n router.urlHandlingStrategy = urlHandlingStrategy;\n }\n return router;\n}\n\n/**\n * @description\n *\n * Sets up the router to be used for testing.\n *\n * The modules sets up the router to be used for testing.\n * It provides spy implementations of `Location`, `LocationStrategy`, and {@link\n * NgModuleFactoryLoader}.\n *\n * @usageNotes\n * ### Example\n *\n * ```\n * beforeEach(() => {\n * TestBed.configureTestModule({\n * imports: [\n * RouterTestingModule.withRoutes(\n * [{path: '', component: BlankCmp}, {path: 'simple', component: SimpleCmp}]\n * )\n * ]\n * });\n * });\n * ```\n *\n * @publicApi\n */\n@NgModule({\n exports: [RouterModule],\n providers: [\n ROUTER_PROVIDERS, {provide: Location, useClass: SpyLocation},\n {provide: LocationStrategy, useClass: MockLocationStrategy},\n {provide: NgModuleFactoryLoader, useClass: SpyNgModuleFactoryLoader}, {\n provide: Router,\n useFactory: setupTestingRouter,\n deps: [\n UrlSerializer, ChildrenOutletContexts, Location, NgModuleFactoryLoader, Compiler, Injector,\n ROUTES, ROUTER_CONFIGURATION, [UrlHandlingStrategy, new Optional()]\n ]\n },\n {provide: PreloadingStrategy, useExisting: NoPreloading}, provideRoutes([])\n ]\n})\nexport class RouterTestingModule {\n static withRoutes(routes: Routes, config?: ExtraOptions):\n ModuleWithProviders<RouterTestingModule> {\n return {\n ngModule: RouterTestingModule,\n providers: [\n provideRoutes(routes),\n {provide: ROUTER_CONFIGURATION, useValue: config ? config : {}},\n ]\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["flatten","ROUTER_PROVIDERS"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,MAAa,wBAAwB;;;;IAsBnC,YAAoB,QAAkB;QAAlB,aAAQ,GAAR,QAAQ,CAAU;;;;QAlB9B,oBAAe,GAAoD,EAAE,CAAC;KAkBpC;;;;;;IAb1C,IAAI,cAAc,CAAC,OAA8B;;cACzC,GAAG,GAA0B,EAAE;QACrC,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;YACpC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;SACvD;QACD,IAAI,CAAC,eAAe,GAAG,GAAG,CAAC;KAC5B;;;;;IAKD,IAAI,cAAc,KAA4B,OAAO,IAAI,CAAC,eAAe,CAAC,EAAE;;;;;IAI5E,IAAI,CAAC,IAAY;QACf,IAAI,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE;YAC9B,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;SACnC;aAAM;YACL,0BAAY,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,sBAAsB,IAAI,EAAE,CAAC,CAAC,GAAC;SACrE;KACF;;;YA/BF,UAAU;;;;YAlCH,QAAQ;;;;;;
|
|
1
|
+
{"version":3,"file":"testing.js","sources":["../testing/src/router_testing_module.ts","../testing/testing.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Location, LocationStrategy} from '@angular/common';\nimport {MockLocationStrategy, SpyLocation} from '@angular/common/testing';\nimport {Compiler, Injectable, Injector, ModuleWithProviders, NgModule, NgModuleFactory, NgModuleFactoryLoader, Optional} from '@angular/core';\nimport {ChildrenOutletContexts, ExtraOptions, NoPreloading, PreloadingStrategy, ROUTER_CONFIGURATION, ROUTES, Route, Router, RouterModule, Routes, UrlHandlingStrategy, UrlSerializer, provideRoutes, ɵROUTER_PROVIDERS as ROUTER_PROVIDERS, ɵflatten as flatten} from '@angular/router';\n\n\n\n/**\n * @description\n *\n * Allows to simulate the loading of ng modules in tests.\n *\n * ```\n * const loader = TestBed.get(NgModuleFactoryLoader);\n *\n * @Component({template: 'lazy-loaded'})\n * class LazyLoadedComponent {}\n * @NgModule({\n * declarations: [LazyLoadedComponent],\n * imports: [RouterModule.forChild([{path: 'loaded', component: LazyLoadedComponent}])]\n * })\n *\n * class LoadedModule {}\n *\n * // sets up stubbedModules\n * loader.stubbedModules = {lazyModule: LoadedModule};\n *\n * router.resetConfig([\n * {path: 'lazy', loadChildren: 'lazyModule'},\n * ]);\n *\n * router.navigateByUrl('/lazy/loaded');\n * ```\n *\n * @publicApi\n */\n@Injectable()\nexport class SpyNgModuleFactoryLoader implements NgModuleFactoryLoader {\n /**\n * @docsNotRequired\n */\n private _stubbedModules: {[path: string]: Promise<NgModuleFactory<any>>} = {};\n\n /**\n * @docsNotRequired\n */\n set stubbedModules(modules: {[path: string]: any}) {\n const res: {[path: string]: any} = {};\n for (const t of Object.keys(modules)) {\n res[t] = this.compiler.compileModuleAsync(modules[t]);\n }\n this._stubbedModules = res;\n }\n\n /**\n * @docsNotRequired\n */\n get stubbedModules(): {[path: string]: any} { return this._stubbedModules; }\n\n constructor(private compiler: Compiler) {}\n\n load(path: string): Promise<NgModuleFactory<any>> {\n if (this._stubbedModules[path]) {\n return this._stubbedModules[path];\n } else {\n return <any>Promise.reject(new Error(`Cannot find module ${path}`));\n }\n }\n}\n\nfunction isUrlHandlingStrategy(opts: ExtraOptions | UrlHandlingStrategy):\n opts is UrlHandlingStrategy {\n // This property check is needed because UrlHandlingStrategy is an interface and doesn't exist at\n // runtime.\n return 'shouldProcessUrl' in opts;\n}\n\n/**\n * Router setup factory function used for testing.\n *\n * @publicApi\n */\nexport function setupTestingRouter(\n urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts, location: Location,\n loader: NgModuleFactoryLoader, compiler: Compiler, injector: Injector, routes: Route[][],\n opts?: ExtraOptions, urlHandlingStrategy?: UrlHandlingStrategy): Router;\n\n/**\n * Router setup factory function used for testing.\n *\n * @deprecated As of v5.2. The 2nd-to-last argument should be `ExtraOptions`, not\n * `UrlHandlingStrategy`\n * @publicApi\n */\nexport function setupTestingRouter(\n urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts, location: Location,\n loader: NgModuleFactoryLoader, compiler: Compiler, injector: Injector, routes: Route[][],\n urlHandlingStrategy?: UrlHandlingStrategy): Router;\n\n/**\n * Router setup factory function used for testing.\n *\n * @publicApi\n */\nexport function setupTestingRouter(\n urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts, location: Location,\n loader: NgModuleFactoryLoader, compiler: Compiler, injector: Injector, routes: Route[][],\n opts?: ExtraOptions | UrlHandlingStrategy, urlHandlingStrategy?: UrlHandlingStrategy) {\n const router = new Router(\n null !, urlSerializer, contexts, location, injector, loader, compiler, flatten(routes));\n if (opts) {\n // Handle deprecated argument ordering.\n if (isUrlHandlingStrategy(opts)) {\n router.urlHandlingStrategy = opts;\n } else {\n // Handle ExtraOptions\n\n if (opts.malformedUriErrorHandler) {\n router.malformedUriErrorHandler = opts.malformedUriErrorHandler;\n }\n\n if (opts.paramsInheritanceStrategy) {\n router.paramsInheritanceStrategy = opts.paramsInheritanceStrategy;\n }\n }\n }\n\n if (urlHandlingStrategy) {\n router.urlHandlingStrategy = urlHandlingStrategy;\n }\n return router;\n}\n\n/**\n * @description\n *\n * Sets up the router to be used for testing.\n *\n * The modules sets up the router to be used for testing.\n * It provides spy implementations of `Location`, `LocationStrategy`, and {@link\n * NgModuleFactoryLoader}.\n *\n * @usageNotes\n * ### Example\n *\n * ```\n * beforeEach(() => {\n * TestBed.configureTestModule({\n * imports: [\n * RouterTestingModule.withRoutes(\n * [{path: '', component: BlankCmp}, {path: 'simple', component: SimpleCmp}]\n * )\n * ]\n * });\n * });\n * ```\n *\n * @publicApi\n */\n@NgModule({\n exports: [RouterModule],\n providers: [\n ROUTER_PROVIDERS, {provide: Location, useClass: SpyLocation},\n {provide: LocationStrategy, useClass: MockLocationStrategy},\n {provide: NgModuleFactoryLoader, useClass: SpyNgModuleFactoryLoader}, {\n provide: Router,\n useFactory: setupTestingRouter,\n deps: [\n UrlSerializer, ChildrenOutletContexts, Location, NgModuleFactoryLoader, Compiler, Injector,\n ROUTES, ROUTER_CONFIGURATION, [UrlHandlingStrategy, new Optional()]\n ]\n },\n {provide: PreloadingStrategy, useExisting: NoPreloading}, provideRoutes([])\n ]\n})\nexport class RouterTestingModule {\n static withRoutes(routes: Routes, config?: ExtraOptions):\n ModuleWithProviders<RouterTestingModule> {\n return {\n ngModule: RouterTestingModule,\n providers: [\n provideRoutes(routes),\n {provide: ROUTER_CONFIGURATION, useValue: config ? config : {}},\n ]\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["flatten","ROUTER_PROVIDERS"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,MAAa,wBAAwB;;;;IAsBnC,YAAoB,QAAkB;QAAlB,aAAQ,GAAR,QAAQ,CAAU;;;;QAlB9B,oBAAe,GAAoD,EAAE,CAAC;KAkBpC;;;;;;IAb1C,IAAI,cAAc,CAAC,OAA8B;;cACzC,GAAG,GAA0B,EAAE;QACrC,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO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ED
package/fesm5/router.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v8.2.
|
|
2
|
+
* @license Angular v8.2.4
|
|
3
3
|
* (c) 2010-2019 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { __extends, __decorate, __assign, __values, __spread, __metadata, __param } from 'tslib';
|
|
8
8
|
import { LocationStrategy, Location, PlatformLocation, APP_BASE_HREF, ViewportScroller, HashLocationStrategy, PathLocationStrategy, LOCATION_INITIALIZED } from '@angular/common';
|
|
9
|
-
import { Component, ɵisObservable, ɵisPromise, NgModuleRef, InjectionToken, NgModuleFactory,
|
|
10
|
-
import {
|
|
9
|
+
import { Component, ɵisObservable, ɵisPromise, NgModuleRef, InjectionToken, NgModuleFactory, ɵConsole, NgZone, isDevMode, Input, HostListener, Directive, Attribute, Renderer2, ElementRef, HostBinding, ContentChildren, QueryList, Optional, EventEmitter, Output, ViewContainerRef, ComponentFactoryResolver, ChangeDetectorRef, Injectable, NgModuleFactoryLoader, Compiler, Injector, ApplicationRef, SystemJsNgModuleLoader, NgProbeToken, ANALYZE_FOR_ENTRY_COMPONENTS, SkipSelf, Inject, APP_INITIALIZER, APP_BOOTSTRAP_LISTENER, NgModule, Version } from '@angular/core';
|
|
10
|
+
import { of, from, BehaviorSubject, Observable, EmptyError, combineLatest, defer, Subject, EMPTY } from 'rxjs';
|
|
11
11
|
import { map, concatAll, last as last$1, catchError, first, mergeMap, every, switchMap, take, startWith, scan, filter, concatMap, reduce, tap, finalize, mergeAll } from 'rxjs/operators';
|
|
12
12
|
import { ɵgetDOM } from '@angular/platform-browser';
|
|
13
13
|
|
|
@@ -102,7 +102,10 @@ var NavigationEnd = /** @class */ (function (_super) {
|
|
|
102
102
|
return NavigationEnd;
|
|
103
103
|
}(RouterEvent));
|
|
104
104
|
/**
|
|
105
|
-
* An event triggered when a navigation is canceled.
|
|
105
|
+
* An event triggered when a navigation is canceled, directly or indirectly.
|
|
106
|
+
*
|
|
107
|
+
* This can happen when a [route guard](guide/router#milestone-5-route-guards)
|
|
108
|
+
* returns `false` or initiates a redirect by returning a `UrlTree`.
|
|
106
109
|
*
|
|
107
110
|
* @publicApi
|
|
108
111
|
*/
|
|
@@ -673,6 +676,12 @@ function flatten(arr) {
|
|
|
673
676
|
function last(a) {
|
|
674
677
|
return a.length > 0 ? a[a.length - 1] : null;
|
|
675
678
|
}
|
|
679
|
+
/**
|
|
680
|
+
* Verifys all booleans in an array are `true`.
|
|
681
|
+
*/
|
|
682
|
+
function and(bools) {
|
|
683
|
+
return !bools.some(function (v) { return !v; });
|
|
684
|
+
}
|
|
676
685
|
function forEach(map, callback) {
|
|
677
686
|
for (var prop in map) {
|
|
678
687
|
if (map.hasOwnProperty(prop)) {
|
|
@@ -1961,7 +1970,9 @@ function computeNavigation(commands) {
|
|
|
1961
1970
|
}
|
|
1962
1971
|
if (cmdIdx === 0) {
|
|
1963
1972
|
cmd.split('/').forEach(function (urlPart, partIndex) {
|
|
1964
|
-
if (partIndex == 0 && urlPart === '.')
|
|
1973
|
+
if (partIndex == 0 && urlPart === '.') {
|
|
1974
|
+
// skip './a'
|
|
1975
|
+
}
|
|
1965
1976
|
else if (partIndex == 0 && urlPart === '') { // '/a'
|
|
1966
1977
|
isAbsolute = true;
|
|
1967
1978
|
}
|
|
@@ -3660,7 +3671,7 @@ function defaultRouterHook(snapshot, runExtras) {
|
|
|
3660
3671
|
/**
|
|
3661
3672
|
* @description
|
|
3662
3673
|
*
|
|
3663
|
-
*
|
|
3674
|
+
* A service that provides navigation and URL manipulation capabilities.
|
|
3664
3675
|
*
|
|
3665
3676
|
* @see `Route`.
|
|
3666
3677
|
* @see [Routing and Navigation Guide](guide/router).
|
|
@@ -5701,7 +5712,7 @@ function provideRouterInitializer() {
|
|
|
5701
5712
|
/**
|
|
5702
5713
|
* @publicApi
|
|
5703
5714
|
*/
|
|
5704
|
-
var VERSION = new Version('8.2.
|
|
5715
|
+
var VERSION = new Version('8.2.4');
|
|
5705
5716
|
|
|
5706
5717
|
/**
|
|
5707
5718
|
* @license
|