@uirouter/core
Advanced tools
Comparing version 6.1.0 to 6.1.1
@@ -12,21 +12,6 @@ { | ||
"other": { | ||
"typescript5.4": "./test/typescript5.4", | ||
"typescript3.9": "./test/typescript3.9", | ||
"typescript3.8": "./test/typescript3.8", | ||
"typescript3.7": "./test/typescript3.7", | ||
"typescript3.6": "./test/typescript3.6", | ||
"typescript3.5": "./test/typescript3.5", | ||
"typescript3.4": "./test/typescript3.4", | ||
"typescript3.3": "./test/typescript3.3", | ||
"typescript3.2": "./test/typescript3.2", | ||
"typescript3.1": "./test/typescript3.1", | ||
"typescript3.0": "./test/typescript3.0", | ||
"typescript2.8": "./test/typescript2.8", | ||
"typescript2.7": "./test/typescript2.7", | ||
"typescript2.6": "./test/typescript2.6", | ||
"typescript2.5": "./test/typescript2.5", | ||
"typescript2.4": "./test/typescript2.4", | ||
"typescript2.3": "./test/typescript2.3", | ||
"typescript2.2": "./test/typescript2.2", | ||
"sticky-states": "https://github.com/ui-router/sticky-states.git" | ||
} | ||
} |
@@ -10,8 +10,8 @@ import { StateObject } from '../state/stateObject'; | ||
export declare function noop(): any; | ||
export declare type Mapper<X, T> = (x: X, key?: string | number) => T; | ||
export type Mapper<X, T> = (x: X, key?: string | number) => T; | ||
export interface TypedMap<T> { | ||
[key: string]: T; | ||
} | ||
export declare type Predicate<X> = (x?: X) => boolean; | ||
export declare type PredicateBinary<X, Y> = (x?: X, y?: Y) => boolean; | ||
export type Predicate<X> = (x?: X) => boolean; | ||
export type PredicateBinary<X, Y> = (x?: X, y?: Y) => boolean; | ||
/** | ||
@@ -42,3 +42,3 @@ * An ng1-style injectable | ||
*/ | ||
export declare type IInjectable = Function | any[]; | ||
export type IInjectable = Function | any[]; | ||
export interface Obj extends Object { | ||
@@ -45,0 +45,0 @@ [key: string]: any; |
@@ -1,7 +0,9 @@ | ||
var __spreadArrays = (this && this.__spreadArrays) || function () { | ||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; | ||
for (var r = Array(s), k = 0, i = 0; i < il; i++) | ||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) | ||
r[k] = a[j]; | ||
return r; | ||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { | ||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { | ||
if (ar || !(i in from)) { | ||
if (!ar) ar = Array.prototype.slice.call(from, 0, i); | ||
ar[i] = from[i]; | ||
} | ||
} | ||
return to.concat(ar || Array.prototype.slice.call(from)); | ||
}; | ||
@@ -146,3 +148,3 @@ /** | ||
} | ||
var defaultVals = extend.apply(void 0, __spreadArrays([{}], defaultsList.reverse())); | ||
var defaultVals = extend.apply(void 0, __spreadArray([{}], defaultsList.reverse(), false)); | ||
return extend(defaultVals, pick(opts || {}, Object.keys(defaultVals))); | ||
@@ -149,0 +151,0 @@ } |
var noImpl = function (fnname) { return function () { | ||
throw new Error("No implementation for " + fnname + ". The framework specific code did not implement this method."); | ||
throw new Error("No implementation for ".concat(fnname, ". The framework specific code did not implement this method.")); | ||
}; }; | ||
export var makeStub = function (service, methods) { | ||
return methods.reduce(function (acc, key) { return ((acc[key] = noImpl(service + "." + key + "()")), acc); }, {}); | ||
return methods.reduce(function (acc, key) { return ((acc[key] = noImpl("".concat(service, ".").concat(String(key), "()"))), acc); }, {}); | ||
}; | ||
@@ -7,0 +7,0 @@ var services = { |
@@ -113,3 +113,5 @@ /** | ||
/** Given a class, returns a Predicate function that returns true if the object is of that class */ | ||
export declare const is: <T>(ctor: new (...args: any[]) => T) => (obj: any) => obj is T; | ||
export declare const is: <T>(ctor: { | ||
new (...args: any[]): T; | ||
}) => (obj: any) => obj is T; | ||
/** Given a value, returns a Predicate function that returns true if another value is === equal to the original value */ | ||
@@ -116,0 +118,0 @@ export declare const eq: (comp: any) => Predicate<any>; |
@@ -8,8 +8,10 @@ /** | ||
*/ | ||
var __spreadArrays = (this && this.__spreadArrays) || function () { | ||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; | ||
for (var r = Array(s), k = 0, i = 0; i < il; i++) | ||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) | ||
r[k] = a[j]; | ||
return r; | ||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { | ||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { | ||
if (ar || !(i in from)) { | ||
if (!ar) ar = Array.prototype.slice.call(from, 0, i); | ||
ar[i] = from[i]; | ||
} | ||
} | ||
return to.concat(ar || Array.prototype.slice.call(from)); | ||
}; | ||
@@ -63,3 +65,3 @@ /** | ||
var args = Array.prototype.slice.call(arguments); | ||
return curried.bind.apply(curried, __spreadArrays([this], args)); | ||
return curried.bind.apply(curried, __spreadArray([this], args, false)); | ||
}; | ||
@@ -124,9 +126,11 @@ } | ||
*/ | ||
export var not = function (fn) { return function () { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
return !fn.apply(null, args); | ||
}; }; | ||
export var not = function (fn) { | ||
return function () { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
return !fn.apply(null, args); | ||
}; | ||
}; | ||
/** | ||
@@ -168,9 +172,15 @@ * Given two functions that return truthy or falsey values, returns a function that returns truthy | ||
/** Given a class, returns a Predicate function that returns true if the object is of that class */ | ||
export var is = function (ctor) { return function (obj) { | ||
return (obj != null && obj.constructor === ctor) || obj instanceof ctor; | ||
}; }; | ||
export var is = function (ctor) { | ||
return function (obj) { | ||
return (obj != null && obj.constructor === ctor) || obj instanceof ctor; | ||
}; | ||
}; | ||
/** Given a value, returns a Predicate function that returns true if another value is === equal to the original value */ | ||
export var eq = function (value) { return function (other) { return value === other; }; }; | ||
/** Given a value, returns a function which returns the value */ | ||
export var val = function (v) { return function () { return v; }; }; | ||
export var val = function (v) { | ||
return function () { | ||
return v; | ||
}; | ||
}; | ||
export function invoke(fnName, args) { | ||
@@ -177,0 +187,0 @@ return function (obj) { return obj[fnName].apply(obj, args); }; |
@@ -43,3 +43,3 @@ /** | ||
var state = uiview.creationContext ? uiview.creationContext.name || '(root)' : '(none)'; | ||
return "[ui-view#" + uiview.id + " " + uiview.$type + ":" + uiview.fqn + " (" + uiview.name + "@" + state + ")]"; | ||
return "[ui-view#".concat(uiview.id, " ").concat(uiview.$type, ":").concat(uiview.fqn, " (").concat(uiview.name, "@").concat(state, ")]"); | ||
} | ||
@@ -49,3 +49,3 @@ var viewConfigString = function (viewConfig) { | ||
var state = view.$context.name || '(root)'; | ||
return "[View#" + viewConfig.$id + " from '" + state + "' state]: target ui-view: '" + view.$uiViewName + "@" + view.$uiViewContextAnchor + "'"; | ||
return "[View#".concat(viewConfig.$id, " from '").concat(state, "' state]: target ui-view: '").concat(view.$uiViewName, "@").concat(view.$uiViewContextAnchor, "'"); | ||
}; | ||
@@ -79,3 +79,3 @@ function normalizedCat(input) { | ||
var _rid = parse('router.$id'); | ||
var transLbl = function (trans) { return "Transition #" + _tid(trans) + "-" + _rid(trans); }; | ||
var transLbl = function (trans) { return "Transition #".concat(_tid(trans), "-").concat(_rid(trans)); }; | ||
/** | ||
@@ -132,3 +132,3 @@ * Prints UI-Router Transition trace information to the console. | ||
return; | ||
safeConsole.log(transLbl(trans) + ": Started -> " + stringify(trans)); | ||
safeConsole.log("".concat(transLbl(trans), ": Started -> ").concat(stringify(trans))); | ||
}; | ||
@@ -139,3 +139,3 @@ /** @internal called by ui-router code */ | ||
return; | ||
safeConsole.log(transLbl(trans) + ": Ignored <> " + stringify(trans)); | ||
safeConsole.log("".concat(transLbl(trans), ": Ignored <> ").concat(stringify(trans))); | ||
}; | ||
@@ -147,3 +147,3 @@ /** @internal called by ui-router code */ | ||
var event = parse('traceData.hookType')(options) || 'internal', context = parse('traceData.context.state.name')(options) || parse('traceData.context')(options) || 'unknown', name = functionToString(step.registeredHook.callback); | ||
safeConsole.log(transLbl(trans) + ": Hook -> " + event + " context: " + context + ", " + maxLength(200, name)); | ||
safeConsole.log("".concat(transLbl(trans), ": Hook -> ").concat(event, " context: ").concat(context, ", ").concat(maxLength(200, name))); | ||
}; | ||
@@ -154,3 +154,3 @@ /** @internal called by ui-router code */ | ||
return; | ||
safeConsole.log(transLbl(trans) + ": <- Hook returned: " + maxLength(200, stringify(hookResult))); | ||
safeConsole.log("".concat(transLbl(trans), ": <- Hook returned: ").concat(maxLength(200, stringify(hookResult)))); | ||
}; | ||
@@ -161,3 +161,3 @@ /** @internal called by ui-router code */ | ||
return; | ||
safeConsole.log(transLbl(trans) + ": Resolving " + path + " (" + when + ")"); | ||
safeConsole.log("".concat(transLbl(trans), ": Resolving ").concat(path, " (").concat(when, ")")); | ||
}; | ||
@@ -168,3 +168,3 @@ /** @internal called by ui-router code */ | ||
return; | ||
safeConsole.log(transLbl(trans) + ": <- Resolved " + resolvable + " to: " + maxLength(200, stringify(resolvable.data))); | ||
safeConsole.log("".concat(transLbl(trans), ": <- Resolved ").concat(resolvable, " to: ").concat(maxLength(200, stringify(resolvable.data)))); | ||
}; | ||
@@ -175,3 +175,3 @@ /** @internal called by ui-router code */ | ||
return; | ||
safeConsole.log(transLbl(trans) + ": <- Rejected " + stringify(trans) + ", reason: " + reason); | ||
safeConsole.log("".concat(transLbl(trans), ": <- Rejected ").concat(stringify(trans), ", reason: ").concat(reason)); | ||
}; | ||
@@ -182,3 +182,3 @@ /** @internal called by ui-router code */ | ||
return; | ||
safeConsole.log(transLbl(trans) + ": <- Success " + stringify(trans) + ", final state: " + finalState.name); | ||
safeConsole.log("".concat(transLbl(trans), ": <- Success ").concat(stringify(trans), ", final state: ").concat(finalState.name)); | ||
}; | ||
@@ -190,3 +190,3 @@ /** @internal called by ui-router code */ | ||
return; | ||
safeConsole.log("ui-view: " + padString(30, event) + " " + uiViewString(viewData) + extra); | ||
safeConsole.log("ui-view: ".concat(padString(30, event), " ").concat(uiViewString(viewData)).concat(extra)); | ||
}; | ||
@@ -197,3 +197,3 @@ /** @internal called by ui-router code */ | ||
return; | ||
this.traceUIViewEvent('Updating', viewData, " with ViewConfig from context='" + context + "'"); | ||
this.traceUIViewEvent('Updating', viewData, " with ViewConfig from context='".concat(context, "'")); | ||
}; | ||
@@ -204,3 +204,3 @@ /** @internal called by ui-router code */ | ||
return; | ||
this.traceUIViewEvent('Fill', viewData, " with: " + maxLength(200, html)); | ||
this.traceUIViewEvent('Fill', viewData, " with: ".concat(maxLength(200, html))); | ||
}; | ||
@@ -218,3 +218,3 @@ /** @internal called by ui-router code */ | ||
var uiv = uiView && uiView.fqn; | ||
var cfg = viewConfig && viewConfig.viewDecl.$context.name + ": (" + viewConfig.viewDecl.$name + ")"; | ||
var cfg = viewConfig && "".concat(viewConfig.viewDecl.$context.name, ": (").concat(viewConfig.viewDecl.$name, ")"); | ||
return _b = {}, _b[uivheader] = uiv, _b[cfgheader] = cfg, _b; | ||
@@ -229,3 +229,3 @@ }) | ||
return; | ||
safeConsole.log("VIEWCONFIG: " + event + " " + viewConfigString(viewConfig)); | ||
safeConsole.log("VIEWCONFIG: ".concat(event, " ").concat(viewConfigString(viewConfig))); | ||
}; | ||
@@ -236,3 +236,3 @@ /** @internal called by ui-router code */ | ||
return; | ||
safeConsole.log("VIEWCONFIG: " + event + " " + uiViewString(viewData)); | ||
safeConsole.log("VIEWCONFIG: ".concat(event, " ").concat(uiViewString(viewData))); | ||
}; | ||
@@ -239,0 +239,0 @@ return Trace; |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=interface.js.map |
@@ -35,3 +35,3 @@ import { extend, filter, map, allTrueR, find } from '../common/common'; | ||
if (cfg.type && urlType && urlType.name !== 'string') | ||
throw new Error("Param '" + id + "' has two type configurations."); | ||
throw new Error("Param '".concat(id, "' has two type configurations.")); | ||
if (cfg.type && urlType && urlType.name === 'string' && paramTypes.type(cfg.type)) | ||
@@ -62,3 +62,3 @@ return paramTypes.type(cfg.type); | ||
return squash; | ||
throw new Error("Invalid squash policy: '" + squash + "'. Valid policies: false, true, or arbitrary string"); | ||
throw new Error("Invalid squash policy: '".concat(squash, "'. Valid policies: false, true, or arbitrary string")); | ||
} | ||
@@ -159,3 +159,3 @@ function getReplace(config, arrayMode, isOptional, squash) { | ||
if (defaultValue !== null && defaultValue !== undefined && !_this.type.is(defaultValue)) | ||
throw new Error("Default value (" + defaultValue + ") for parameter '" + _this.id + "' is not an instance of ParamType (" + _this.type.name + ")"); | ||
throw new Error("Default value (".concat(defaultValue, ") for parameter '").concat(_this.id, "' is not an instance of ParamType (").concat(_this.type.name, ")")); | ||
if (_this.config.$$fn['__cacheable']) { | ||
@@ -193,3 +193,3 @@ _this._defaultValueCache = { defaultValue: defaultValue }; | ||
Param.prototype.toString = function () { | ||
return "{Param:" + this.id + " " + this.type + " squash: '" + this.squash + "' optional: " + this.isOptional + "}"; | ||
return "{Param:".concat(this.id, " ").concat(this.type, " squash: '").concat(this.squash, "' optional: ").concat(this.isOptional, "}"); | ||
}; | ||
@@ -196,0 +196,0 @@ return Param; |
@@ -62,3 +62,3 @@ import { extend, filter, map } from '../common/common'; | ||
ParamType.prototype.toString = function () { | ||
return "{ParamType:" + this.name + "}"; | ||
return "{ParamType:".concat(this.name, "}"); | ||
}; | ||
@@ -65,0 +65,0 @@ /** Given an encoded string, or a decoded object, returns a decoded object */ |
@@ -60,3 +60,3 @@ import { fromJson, toJson, identity, equals, inherit, map, extend, pick } from '../common/common'; | ||
if (this.types.hasOwnProperty(name)) | ||
throw new Error("A type named '" + name + "' has already been defined."); | ||
throw new Error("A type named '".concat(name, "' has already been defined.")); | ||
this.types[name] = new ParamType(extend({ name: name }, definition)); | ||
@@ -90,3 +90,3 @@ if (definitionFn) { | ||
// tslint:disable-next-line:triple-equals | ||
equals: function (a, b) { return a == b; }, | ||
equals: function (a, b) { return a == b; }, // allow coersion for null/undefined/"" | ||
}; | ||
@@ -93,0 +93,0 @@ return extend({}, defaultTypeBase, def); |
@@ -25,3 +25,5 @@ import { extend, ancestors } from '../common/common'; | ||
for (var j in parentParamsKeys) { | ||
if (parentParams[parentParamsKeys[j]].inherit == false || inheritList.indexOf(parentParamsKeys[j]) >= 0) | ||
if (!parentParamsKeys.hasOwnProperty(j) || | ||
parentParams[parentParamsKeys[j]].inherit == false || | ||
inheritList.indexOf(parentParamsKeys[j]) >= 0) | ||
continue; | ||
@@ -28,0 +30,0 @@ inheritList.push(parentParamsKeys[j]); |
@@ -60,2 +60,2 @@ import { StateObject } from '../state/stateObject'; | ||
/** @internal */ | ||
export declare type GetParamsFn = (pathNode: PathNode) => Param[]; | ||
export type GetParamsFn = (pathNode: PathNode) => Param[]; |
@@ -196,4 +196,4 @@ /** | ||
} | ||
export declare type PolicyWhen = 'LAZY' | 'EAGER'; | ||
export declare type PolicyAsync = 'WAIT' | 'NOWAIT' | CustomAsyncPolicy; | ||
export type PolicyWhen = 'LAZY' | 'EAGER'; | ||
export type PolicyAsync = 'WAIT' | 'NOWAIT' | CustomAsyncPolicy; | ||
export interface CustomAsyncPolicy { | ||
@@ -200,0 +200,0 @@ (data: any): Promise<any>; |
@@ -103,3 +103,3 @@ import { extend, identity } from '../common/common'; | ||
Resolvable.prototype.toString = function () { | ||
return "Resolvable(token: " + stringify(this.token) + ", requires: [" + this.deps.map(stringify) + "])"; | ||
return "Resolvable(token: ".concat(stringify(this.token), ", requires: [").concat(this.deps.map(stringify), "])"); | ||
}; | ||
@@ -106,0 +106,0 @@ Resolvable.prototype.clone = function () { |
@@ -95,2 +95,2 @@ import { UrlMatcherFactory } from './url/urlMatcherFactory'; | ||
/** @internal */ | ||
export declare type PluginFactory<T> = (router: UIRouter, options?: any) => T; | ||
export type PluginFactory<T> = (router: UIRouter, options?: any) => T; |
@@ -10,3 +10,3 @@ import { ParamDeclaration, RawParams } from '../params/interface'; | ||
import { TargetState } from './targetState'; | ||
export declare type StateOrName = string | StateDeclaration | StateObject; | ||
export type StateOrName = string | StateDeclaration | StateObject; | ||
export interface TransitionPromise extends Promise<StateObject> { | ||
@@ -20,3 +20,3 @@ transition: Transition; | ||
} | ||
export declare type ResolveTypes = Resolvable | ResolvableLiteral | ProviderLike; | ||
export type ResolveTypes = Resolvable | ResolvableLiteral | ProviderLike; | ||
/** | ||
@@ -70,3 +70,3 @@ * Base interface for declaring a view | ||
*/ | ||
export declare type RedirectToResult = string | TargetState | { | ||
export type RedirectToResult = string | TargetState | { | ||
state?: string; | ||
@@ -709,4 +709,4 @@ params?: RawParams; | ||
*/ | ||
export declare type _StateDeclaration = StateDeclaration | { | ||
export type _StateDeclaration = StateDeclaration | { | ||
new (): StateDeclaration; | ||
}; |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=interface.js.map |
@@ -15,3 +15,3 @@ import { StateObject } from './stateObject'; | ||
*/ | ||
export declare type BuilderFunction = (state: StateObject, parent?: BuilderFunction) => any; | ||
export type BuilderFunction = (state: StateObject, parent?: BuilderFunction) => any; | ||
/** | ||
@@ -18,0 +18,0 @@ * This is a [[StateBuilder.builder]] function for the `resolve:` block on a [[StateDeclaration]]. |
@@ -43,3 +43,3 @@ import { applyPairs, extend, identity, inherit, mapObj, noop, omit, tail, values, copy } from '../common/common'; | ||
if (!$urlMatcherFactoryProvider.isMatcher(url)) | ||
throw new Error("Invalid url '" + url + "' in state '" + stateObject + "'"); | ||
throw new Error("Invalid url '".concat(url, "' in state '").concat(stateObject, "'")); | ||
return parsed && parsed.root ? url : ((parent && parent.navigable) || root()).url.append(url); | ||
@@ -259,3 +259,3 @@ }; | ||
if (state.parent) { | ||
throw new Error("States that specify the 'parent:' property should not have a '.' in their name (" + name + ")"); | ||
throw new Error("States that specify the 'parent:' property should not have a '.' in their name (".concat(name, ")")); | ||
} | ||
@@ -262,0 +262,0 @@ // 'foo.bar' |
@@ -28,3 +28,3 @@ import { isString } from '../common/predicates'; | ||
if (matches.length > 1) { | ||
safeConsole.error("stateMatcher.find: Found multiple matches for " + name + " using glob: ", matches.map(function (match) { return match.name; })); | ||
safeConsole.error("stateMatcher.find: Found multiple matches for ".concat(name, " using glob: "), matches.map(function (match) { return match.name; })); | ||
} | ||
@@ -37,3 +37,3 @@ return matches[0]; | ||
if (!base) | ||
throw new Error("No reference point given for path '" + name + "'"); | ||
throw new Error("No reference point given for path '".concat(name, "'")); | ||
var baseState = this.find(base); | ||
@@ -50,3 +50,3 @@ var splitName = name.split('.'); | ||
if (!current.parent) | ||
throw new Error("Path '" + name + "' not valid for state '" + baseState.name + "'"); | ||
throw new Error("Path '".concat(name, "' not valid for state '").concat(baseState.name, "'")); | ||
current = current.parent; | ||
@@ -53,0 +53,0 @@ continue; |
@@ -34,3 +34,3 @@ import { defaults, values, find, inherit } from '../common/common'; | ||
state.__stateObjectCache = { | ||
nameGlob: Glob.fromString(state.name), | ||
nameGlob: Glob.fromString(state.name), // might return null | ||
}; | ||
@@ -37,0 +37,0 @@ return state; |
@@ -21,3 +21,3 @@ import { inArray, isString, prop } from '../common'; | ||
if (this.states.hasOwnProperty(name) || inArray(queue.map(prop('name')), name)) | ||
throw new Error("State '" + name + "' is already defined"); | ||
throw new Error("State '".concat(name, "' is already defined")); | ||
queue.push(state); | ||
@@ -49,3 +49,3 @@ this.flush(); | ||
if (existingState && existingState.name === name_1) { | ||
throw new Error("State '" + name_1 + "' is already defined"); | ||
throw new Error("State '".concat(name_1, "' is already defined")); | ||
} | ||
@@ -52,0 +52,0 @@ var existingFutureState = getState(name_1 + '.**'); |
@@ -16,3 +16,3 @@ import { StateObject } from './stateObject'; | ||
*/ | ||
export declare type StateRegistryListener = (event: 'registered' | 'deregistered', states: StateDeclaration[]) => void; | ||
export type StateRegistryListener = (event: 'registered' | 'deregistered', states: StateDeclaration[]) => void; | ||
/** | ||
@@ -19,0 +19,0 @@ * A registry for all of the application's [[StateDeclaration]]s |
@@ -10,3 +10,3 @@ import { HookResult, TransitionOptions } from '../transition/interface'; | ||
import { StateParams } from '../params/stateParams'; | ||
export declare type OnInvalidCallback = (toState?: TargetState, fromState?: TargetState, injector?: UIInjector) => HookResult; | ||
export type OnInvalidCallback = (toState?: TargetState, fromState?: TargetState, injector?: UIInjector) => HookResult; | ||
/** | ||
@@ -26,3 +26,3 @@ * Provides services related to ui-router states. | ||
*/ | ||
transition: Transition; | ||
get transition(): Transition; | ||
/** | ||
@@ -33,3 +33,3 @@ * The latest successful state parameters | ||
*/ | ||
params: StateParams; | ||
get params(): StateParams; | ||
/** | ||
@@ -40,3 +40,3 @@ * The current [[StateDeclaration]] | ||
*/ | ||
current: StateDeclaration; | ||
get current(): StateDeclaration; | ||
/** | ||
@@ -47,3 +47,3 @@ * The current [[StateObject]] (an internal API) | ||
*/ | ||
$current: StateObject; | ||
get $current(): StateObject; | ||
/** @internal */ | ||
@@ -50,0 +50,0 @@ constructor(/** @internal */ router: UIRouter); |
@@ -283,3 +283,3 @@ import { createProxyFunctions, defaults, extend, inArray, noop, removeFrom, silenceUncaughtInPromise, silentRejection, } from '../common/common'; | ||
if (options.reload && !options.reloadState) | ||
throw new Error("No such reload state '" + (isString(options.reload) ? options.reload : options.reload.name) + "'"); | ||
throw new Error("No such reload state '".concat(isString(options.reload) ? options.reload : options.reload.name, "'")); | ||
return new TargetState(this.router.stateRegistry, identifier, params, options); | ||
@@ -286,0 +286,0 @@ }; |
@@ -93,11 +93,11 @@ import { isObject, isString } from '../common/predicates'; | ||
var stateName = base.name ? base.name : base; | ||
return "Could not resolve '" + this.name() + "' from state '" + stateName + "'"; | ||
return "Could not resolve '".concat(this.name(), "' from state '").concat(stateName, "'"); | ||
} | ||
if (!this._definition) | ||
return "No such state '" + this.name() + "'"; | ||
return "No such state '".concat(this.name(), "'"); | ||
if (!this._definition.self) | ||
return "State '" + this.name() + "' has an invalid definition"; | ||
return "State '".concat(this.name(), "' has an invalid definition"); | ||
}; | ||
TargetState.prototype.toString = function () { | ||
return "'" + this.name() + "'" + stringify(this.params()); | ||
return "'".concat(this.name(), "'").concat(stringify(this.params())); | ||
}; | ||
@@ -104,0 +104,0 @@ /** |
@@ -91,3 +91,3 @@ import { extend, assertPredicate, unnestR, identity } from '../common/common'; | ||
.map(function (reg) { return reg.getHooks(hookType.name); }) // Get named hooks from registries | ||
.filter(assertPredicate(isArray, "broken event named: " + hookType.name)) // Sanity check | ||
.filter(assertPredicate(isArray, "broken event named: ".concat(hookType.name))) // Sanity check | ||
.reduce(unnestR, []) // Un-nest RegisteredHook[][] to RegisteredHook[] array | ||
@@ -94,0 +94,0 @@ .filter(function (hook) { return hook.matches(treeChanges, transition); }); // Only those satisfying matchCriteria |
@@ -165,3 +165,3 @@ import { StateDeclaration } from '../state/interface'; | ||
} | ||
export declare type IHookRegistration = (matchCriteria: HookMatchCriteria, callback: HookFn, options?: HookRegOptions) => Function; | ||
export type IHookRegistration = (matchCriteria: HookMatchCriteria, callback: HookFn, options?: HookRegOptions) => Function; | ||
/** | ||
@@ -229,3 +229,3 @@ * The signature for Transition Hooks. | ||
} | ||
export declare type HookFn = TransitionHookFn | TransitionStateHookFn | TransitionCreateHookFn; | ||
export type HookFn = TransitionHookFn | TransitionStateHookFn | TransitionCreateHookFn; | ||
/** | ||
@@ -244,3 +244,3 @@ * The return value of a [[TransitionHookFn]] or [[TransitionStateHookFn]] | ||
*/ | ||
export declare type HookResult = boolean | TargetState | void | Promise<boolean | TargetState | void>; | ||
export type HookResult = boolean | TargetState | void | Promise<boolean | TargetState | void>; | ||
/** | ||
@@ -697,3 +697,3 @@ * These options may be provided when registering a Transition Hook (such as `onStart`) | ||
/** A predicate type which tests if a [[StateObject]] and [[Transition]] passes some test. Returns a boolean. */ | ||
export declare type IStateMatch = PredicateBinary<StateObject, Transition>; | ||
export type IStateMatch = PredicateBinary<StateObject, Transition>; | ||
/** | ||
@@ -811,3 +811,3 @@ * This object is used to configure whether or not a Transition Hook is invoked for a particular transition, | ||
*/ | ||
export declare type HookMatchCriterion = string | IStateMatch | boolean; | ||
export type HookMatchCriterion = string | IStateMatch | boolean; | ||
declare enum TransitionHookPhase { | ||
@@ -814,0 +814,0 @@ CREATE = 0, |
@@ -109,3 +109,3 @@ 'use strict'; | ||
var _a = this, $id = _a.$id, type = _a.type, message = _a.message; | ||
return "Transition Rejection($id: " + $id + " type: " + type + ", message: " + message + ", detail: " + detail + ")"; | ||
return "Transition Rejection($id: ".concat($id, " type: ").concat(type, ", message: ").concat(message, ", detail: ").concat(detail, ")"); | ||
}; | ||
@@ -112,0 +112,0 @@ Rejection.prototype.toPromise = function () { |
@@ -636,3 +636,3 @@ import { trace } from '../common/trace'; | ||
if (state.self.abstract) { | ||
return Rejection.invalid("Cannot transition to abstract state '" + state.name + "'"); | ||
return Rejection.invalid("Cannot transition to abstract state '".concat(state.name, "'")); | ||
} | ||
@@ -643,4 +643,4 @@ var paramDefs = state.parameters(); | ||
if (invalidParams.length) { | ||
var invalidValues = invalidParams.map(function (param) { return "[" + param.id + ":" + stringify(values[param.id]) + "]"; }).join(', '); | ||
var detail = "The following parameter values are not valid for state '" + state.name + "': " + invalidValues; | ||
var invalidValues = invalidParams.map(function (param) { return "[".concat(param.id, ":").concat(stringify(values[param.id]), "]"); }).join(', '); | ||
var detail = "The following parameter values are not valid for state '".concat(state.name, "': ").concat(invalidValues); | ||
return Rejection.invalid(detail); | ||
@@ -664,3 +664,3 @@ } | ||
var id = this.$id, from = isObject(fromStateOrName) ? fromStateOrName.name : fromStateOrName, fromParams = stringify(avoidEmptyHash(this._treeChanges.from.map(prop('paramValues')).reduce(mergeR, {}))), toValid = this.valid() ? '' : '(X) ', to = isObject(toStateOrName) ? toStateOrName.name : toStateOrName, toParams = stringify(avoidEmptyHash(this.params())); | ||
return "Transition#" + id + "( '" + from + "'" + fromParams + " -> " + toValid + "'" + to + "'" + toParams + " )"; | ||
return "Transition#".concat(id, "( '").concat(from, "'").concat(fromParams, " -> ").concat(toValid, "'").concat(to, "'").concat(toParams, " )"); | ||
}; | ||
@@ -667,0 +667,0 @@ /** @internal */ |
@@ -6,6 +6,6 @@ import { TransitionHookOptions, HookResult } from './interface'; | ||
import { StateDeclaration } from '../state/interface'; | ||
export declare type GetResultHandler = (hook: TransitionHook) => ResultHandler; | ||
export declare type GetErrorHandler = (hook: TransitionHook) => ErrorHandler; | ||
export declare type ResultHandler = (result: HookResult) => Promise<HookResult>; | ||
export declare type ErrorHandler = (error: any) => Promise<any>; | ||
export type GetResultHandler = (hook: TransitionHook) => ResultHandler; | ||
export type GetErrorHandler = (hook: TransitionHook) => ErrorHandler; | ||
export type ResultHandler = (result: HookResult) => Promise<HookResult>; | ||
export type ErrorHandler = (error: any) => Promise<any>; | ||
export declare class TransitionHook { | ||
@@ -12,0 +12,0 @@ private transition; |
@@ -153,3 +153,3 @@ import { TransitionHookPhase } from './interface'; | ||
if (router._disposed) { | ||
return Rejection.aborted("UIRouter instance #" + router.$id + " has been stopped (disposed)").toPromise(); | ||
return Rejection.aborted("UIRouter instance #".concat(router.$id, " has been stopped (disposed)")).toPromise(); | ||
} | ||
@@ -169,3 +169,3 @@ if (this.transition._aborted) { | ||
var event = parse('traceData.hookType')(options) || 'internal', context = parse('traceData.context.state.name')(options) || parse('traceData.context')(options) || 'unknown', name = fnToString(registeredHook.callback); | ||
return event + " context: " + context + ", " + maxLength(200, name); | ||
return "".concat(event, " context: ").concat(context, ", ").concat(maxLength(200, name)); | ||
}; | ||
@@ -172,0 +172,0 @@ /** |
@@ -97,3 +97,3 @@ /** | ||
/** @internal */ | ||
export declare type UrlRuleType = 'STATE' | 'URLMATCHER' | 'REGEXP' | 'RAW' | 'OTHER'; | ||
export type UrlRuleType = 'STATE' | 'URLMATCHER' | 'REGEXP' | 'RAW' | 'OTHER'; | ||
/** | ||
@@ -100,0 +100,0 @@ * The interface for a URL Rule |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=interface.js.map |
@@ -102,3 +102,3 @@ import { ParamTypes } from '../params'; | ||
if (isDefined(value) && value !== true && value !== false && !isString(value)) | ||
throw new Error("Invalid squash policy: " + value + ". Valid policies: false, true, arbitrary-string"); | ||
throw new Error("Invalid squash policy: ".concat(value, ". Valid policies: false, true, arbitrary-string")); | ||
return (this._defaultSquashPolicy = isDefined(value) ? value : this._defaultSquashPolicy); | ||
@@ -105,0 +105,0 @@ }; |
@@ -20,3 +20,3 @@ import { map, inherit, identity, unnest, tail, find, allTrueR, unnestR, arrayTuples } from '../common/common'; | ||
default: | ||
surroundPattern = ["(" + param.squash + "|", ')?']; | ||
surroundPattern = ["(".concat(param.squash, "|"), ')?']; | ||
break; | ||
@@ -126,5 +126,5 @@ } | ||
if (!UrlMatcher.nameValidator.test(id)) | ||
throw new Error("Invalid parameter name '" + id + "' in pattern '" + pattern + "'"); | ||
throw new Error("Invalid parameter name '".concat(id, "' in pattern '").concat(pattern, "'")); | ||
if (find(_this._params, propEq('id', id))) | ||
throw new Error("Duplicate parameter name '" + id + "' in pattern '" + pattern + "'"); | ||
throw new Error("Duplicate parameter name '".concat(id, "' in pattern '").concat(pattern, "'")); | ||
}; | ||
@@ -186,3 +186,3 @@ // Split into static segments separated by path parameter placeholders. | ||
// Replace dashes with encoded "\-" | ||
return encodeURIComponent(str).replace(/-/g, function (c) { return "%5C%" + c.charCodeAt(0).toString(16).toUpperCase(); }); | ||
return encodeURIComponent(str).replace(/-/g, function (c) { return "%5C%".concat(c.charCodeAt(0).toString(16).toUpperCase()); }); | ||
}; | ||
@@ -351,3 +351,3 @@ /** @internal Given a matcher, return an array with the matcher's path segments and path params, in order */ | ||
if (nPathSegments !== match.length - 1) | ||
throw new Error("Unbalanced capture group in route '" + this.pattern + "'"); | ||
throw new Error("Unbalanced capture group in route '".concat(this.pattern, "'")); | ||
function decodePathArray(paramVal) { | ||
@@ -521,3 +521,3 @@ var reverseString = function (str) { return str.split('').reverse().join(''); }; | ||
encoded = map(encoded, encodeURIComponent); | ||
return encoded.map(function (val) { return param.id + "=" + val; }); | ||
return encoded.map(function (val) { return "".concat(param.id, "=").concat(val); }); | ||
}) | ||
@@ -528,3 +528,3 @@ .filter(identity) | ||
// Concat the pathstring with the queryString (if exists) and the hashString (if exists) | ||
return pathString + (queryString ? "?" + queryString : '') + (values['#'] ? '#' + values['#'] : ''); | ||
return pathString + (queryString ? "?".concat(queryString) : '') + (values['#'] ? '#' + values['#'] : ''); | ||
}; | ||
@@ -531,0 +531,0 @@ /** @internal */ |
@@ -66,3 +66,3 @@ import { UrlMatcher } from './urlMatcher'; | ||
/** @deprecated use [[UrlService.interceptDeferred]]*/ | ||
interceptDeferred: boolean; | ||
get interceptDeferred(): boolean; | ||
/** @deprecated use [[UrlService.match]]*/ | ||
@@ -69,0 +69,0 @@ match: (urlParts: UrlParts) => MatchResult; |
@@ -5,6 +5,8 @@ var __extends = (this && this.__extends) || (function () { | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
if (typeof b !== "function" && b !== null) | ||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
extendStatics(d, b); | ||
@@ -11,0 +13,0 @@ function __() { this.constructor = d; } |
@@ -68,3 +68,3 @@ import { extend, assertPredicate, isFunction, isArray, isInjectable, } from '../common/index'; | ||
var params = $injector.annotate(fn); | ||
var ensureExist = assertPredicate(function (key) { return all.hasOwnProperty(key); }, function (key) { return "DI can't find injectable: '" + key + "'"; }); | ||
var ensureExist = assertPredicate(function (key) { return all.hasOwnProperty(key); }, function (key) { return "DI can't find injectable: '".concat(key, "'"); }); | ||
var args = params.filter(ensureExist).map(function (x) { return all[x]; }); | ||
@@ -84,3 +84,3 @@ if (isFunction(fn)) | ||
if (!isInjectable(fn)) | ||
throw new Error("Not an injectable function: " + fn); | ||
throw new Error("Not an injectable function: ".concat(fn)); | ||
if (fn && fn.$inject) | ||
@@ -87,0 +87,0 @@ return fn.$inject; |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=interface.js.map |
@@ -5,6 +5,8 @@ var __extends = (this && this.__extends) || (function () { | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
if (typeof b !== "function" && b !== null) | ||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
extendStatics(d, b); | ||
@@ -11,0 +13,0 @@ function __() { this.constructor = d; } |
@@ -5,6 +5,8 @@ var __extends = (this && this.__extends) || (function () { | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
if (typeof b !== "function" && b !== null) | ||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
extendStatics(d, b); | ||
@@ -11,0 +13,0 @@ function __() { this.constructor = d; } |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=interface.js.map |
@@ -6,3 +6,3 @@ import { TypedMap } from '../common/common'; | ||
import { UIRouter } from '../router'; | ||
export declare type ViewConfigFactory = (path: PathNode[], decl: _ViewDeclaration) => ViewConfig | ViewConfig[]; | ||
export type ViewConfigFactory = (path: PathNode[], decl: _ViewDeclaration) => ViewConfig | ViewConfig[]; | ||
export interface ViewServicePluginAPI { | ||
@@ -9,0 +9,0 @@ _rootViewContext(context?: ViewContext): ViewContext; |
@@ -34,3 +34,3 @@ import { equals, applyPairs, removeFrom, inArray, find } from '../common/common'; | ||
_viewConfigFactory: this._viewConfigFactory.bind(this), | ||
_registeredUIView: function (id) { return find(_this._uiViews, function (view) { return _this.router.$id + "." + view.id === id; }); }, | ||
_registeredUIView: function (id) { return find(_this._uiViews, function (view) { return "".concat(_this.router.$id, ".").concat(view.id) === id; }); }, | ||
_registeredUIViews: function () { return _this._uiViews; }, | ||
@@ -37,0 +37,0 @@ _activeViewConfigs: function () { return _this._viewConfigs; }, |
@@ -10,8 +10,8 @@ import { StateObject } from '../state/stateObject'; | ||
export declare function noop(): any; | ||
export declare type Mapper<X, T> = (x: X, key?: string | number) => T; | ||
export type Mapper<X, T> = (x: X, key?: string | number) => T; | ||
export interface TypedMap<T> { | ||
[key: string]: T; | ||
} | ||
export declare type Predicate<X> = (x?: X) => boolean; | ||
export declare type PredicateBinary<X, Y> = (x?: X, y?: Y) => boolean; | ||
export type Predicate<X> = (x?: X) => boolean; | ||
export type PredicateBinary<X, Y> = (x?: X, y?: Y) => boolean; | ||
/** | ||
@@ -42,3 +42,3 @@ * An ng1-style injectable | ||
*/ | ||
export declare type IInjectable = Function | any[]; | ||
export type IInjectable = Function | any[]; | ||
export interface Obj extends Object { | ||
@@ -45,0 +45,0 @@ [key: string]: any; |
"use strict"; | ||
var __spreadArrays = (this && this.__spreadArrays) || function () { | ||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; | ||
for (var r = Array(s), k = 0, i = 0; i < il; i++) | ||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) | ||
r[k] = a[j]; | ||
return r; | ||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { | ||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { | ||
if (ar || !(i in from)) { | ||
if (!ar) ar = Array.prototype.slice.call(from, 0, i); | ||
ar[i] = from[i]; | ||
} | ||
} | ||
return to.concat(ar || Array.prototype.slice.call(from)); | ||
}; | ||
@@ -113,5 +115,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
*/ | ||
exports.inherit = function (parent, extra) { return exports.extend(Object.create(parent), extra); }; | ||
var inherit = function (parent, extra) { return (0, exports.extend)(Object.create(parent), extra); }; | ||
exports.inherit = inherit; | ||
/** Given an array, returns true if the object is found in the array, (using indexOf) */ | ||
exports.inArray = hof_1.curry(_inArray); | ||
exports.inArray = (0, hof_1.curry)(_inArray); | ||
function _inArray(array, obj) { | ||
@@ -125,3 +128,3 @@ return array.indexOf(obj) !== -1; | ||
*/ | ||
exports.removeFrom = hof_1.curry(_removeFrom); | ||
exports.removeFrom = (0, hof_1.curry)(_removeFrom); | ||
function _removeFrom(array, obj) { | ||
@@ -135,3 +138,3 @@ var idx = array.indexOf(obj); | ||
/** pushes a values to an array and returns the value */ | ||
exports.pushTo = hof_1.curry(_pushTo); | ||
exports.pushTo = (0, hof_1.curry)(_pushTo); | ||
function _pushTo(arr, val) { | ||
@@ -142,8 +145,9 @@ return arr.push(val), val; | ||
/** Given an array of (deregistration) functions, calls all functions and removes each one from the source array */ | ||
exports.deregAll = function (functions) { | ||
var deregAll = function (functions) { | ||
return functions.slice().forEach(function (fn) { | ||
typeof fn === 'function' && fn(); | ||
exports.removeFrom(functions, fn); | ||
(0, exports.removeFrom)(functions, fn); | ||
}); | ||
}; | ||
exports.deregAll = deregAll; | ||
/** | ||
@@ -159,8 +163,9 @@ * Applies a set of defaults to an options object. The options object is filtered | ||
} | ||
var defaultVals = exports.extend.apply(void 0, __spreadArrays([{}], defaultsList.reverse())); | ||
return exports.extend(defaultVals, pick(opts || {}, Object.keys(defaultVals))); | ||
var defaultVals = exports.extend.apply(void 0, __spreadArray([{}], defaultsList.reverse(), false)); | ||
return (0, exports.extend)(defaultVals, pick(opts || {}, Object.keys(defaultVals))); | ||
} | ||
exports.defaults = defaults; | ||
/** Reduce function that merges each element of the list into a single object, using extend */ | ||
exports.mergeR = function (memo, item) { return exports.extend(memo, item); }; | ||
var mergeR = function (memo, item) { return (0, exports.extend)(memo, item); }; | ||
exports.mergeR = mergeR; | ||
/** | ||
@@ -219,3 +224,3 @@ * Finds the common ancestor path between two states. | ||
return Object.keys(obj) | ||
.filter(hof_1.not(exports.inArray(propNames))) | ||
.filter((0, hof_1.not)((0, exports.inArray)(propNames))) | ||
.reduce(function (acc, key) { return ((acc[key] = obj[key]), acc); }, {}); | ||
@@ -228,3 +233,3 @@ } | ||
function pluck(collection, propName) { | ||
return map(collection, hof_1.prop(propName)); | ||
return map(collection, (0, hof_1.prop)(propName)); | ||
} | ||
@@ -234,5 +239,5 @@ exports.pluck = pluck; | ||
function filter(collection, callback) { | ||
var arr = predicates_1.isArray(collection), result = arr ? [] : {}; | ||
var arr = (0, predicates_1.isArray)(collection), result = arr ? [] : {}; | ||
var accept = arr ? function (x) { return result.push(x); } : function (x, key) { return (result[key] = x); }; | ||
exports.forEach(collection, function (item, i) { | ||
(0, exports.forEach)(collection, function (item, i) { | ||
if (callback(item, i)) | ||
@@ -247,3 +252,3 @@ accept(item, i); | ||
var result; | ||
exports.forEach(collection, function (item, i) { | ||
(0, exports.forEach)(collection, function (item, i) { | ||
if (result) | ||
@@ -261,4 +266,4 @@ return; | ||
function map(collection, callback, target) { | ||
target = target || (predicates_1.isArray(collection) ? [] : {}); | ||
exports.forEach(collection, function (item, i) { return (target[i] = callback(item, i)); }); | ||
target = target || ((0, predicates_1.isArray)(collection) ? [] : {}); | ||
(0, exports.forEach)(collection, function (item, i) { return (target[i] = callback(item, i)); }); | ||
return target; | ||
@@ -277,3 +282,4 @@ } | ||
*/ | ||
exports.values = function (obj) { return Object.keys(obj).map(function (key) { return obj[key]; }); }; | ||
var values = function (obj) { return Object.keys(obj).map(function (key) { return obj[key]; }); }; | ||
exports.values = values; | ||
/** | ||
@@ -292,3 +298,4 @@ * Reduce function that returns true if all of the values are truthy. | ||
*/ | ||
exports.allTrueR = function (memo, elem) { return memo && elem; }; | ||
var allTrueR = function (memo, elem) { return memo && elem; }; | ||
exports.allTrueR = allTrueR; | ||
/** | ||
@@ -307,3 +314,4 @@ * Reduce function that returns true if any of the values are truthy. | ||
*/ | ||
exports.anyTrueR = function (memo, elem) { return memo || elem; }; | ||
var anyTrueR = function (memo, elem) { return memo || elem; }; | ||
exports.anyTrueR = anyTrueR; | ||
/** | ||
@@ -318,3 +326,4 @@ * Reduce function which un-nests a single level of arrays | ||
*/ | ||
exports.unnestR = function (memo, elem) { return memo.concat(elem); }; | ||
var unnestR = function (memo, elem) { return memo.concat(elem); }; | ||
exports.unnestR = unnestR; | ||
/** | ||
@@ -330,5 +339,6 @@ * Reduce function which recursively un-nests all arrays | ||
*/ | ||
exports.flattenR = function (memo, elem) { | ||
return predicates_1.isArray(elem) ? memo.concat(elem.reduce(exports.flattenR, [])) : pushR(memo, elem); | ||
var flattenR = function (memo, elem) { | ||
return (0, predicates_1.isArray)(elem) ? memo.concat(elem.reduce(exports.flattenR, [])) : pushR(memo, elem); | ||
}; | ||
exports.flattenR = flattenR; | ||
/** | ||
@@ -344,3 +354,4 @@ * Reduce function that pushes an object to an array, then returns the array. | ||
/** Reduce function that filters out duplicates */ | ||
exports.uniqR = function (acc, token) { return (exports.inArray(acc, token) ? acc : pushR(acc, token)); }; | ||
var uniqR = function (acc, token) { return ((0, exports.inArray)(acc, token) ? acc : pushR(acc, token)); }; | ||
exports.uniqR = uniqR; | ||
/** | ||
@@ -356,3 +367,4 @@ * Return a new array with a single level of arrays unnested. | ||
*/ | ||
exports.unnest = function (arr) { return arr.reduce(exports.unnestR, []); }; | ||
var unnest = function (arr) { return arr.reduce(exports.unnestR, []); }; | ||
exports.unnest = unnest; | ||
/** | ||
@@ -368,3 +380,4 @@ * Return a completely flattened version of an array. | ||
*/ | ||
exports.flatten = function (arr) { return arr.reduce(exports.flattenR, []); }; | ||
var flatten = function (arr) { return arr.reduce(exports.flattenR, []); }; | ||
exports.flatten = flatten; | ||
/** | ||
@@ -406,3 +419,3 @@ * Given a .filter Predicate, builds a .filter Predicate which throws an error if any elements do not pass. | ||
if (!result) { | ||
throw new Error(predicates_1.isFunction(errMsg) ? errMsg(obj) : errMsg); | ||
throw new Error((0, predicates_1.isFunction)(errMsg) ? errMsg(obj) : errMsg); | ||
} | ||
@@ -422,3 +435,4 @@ return result; | ||
*/ | ||
exports.pairs = function (obj) { return Object.keys(obj).map(function (key) { return [key, obj[key]]; }); }; | ||
var pairs = function (obj) { return Object.keys(obj).map(function (key) { return [key, obj[key]]; }); }; | ||
exports.pairs = pairs; | ||
/** | ||
@@ -496,5 +510,5 @@ * Given two or more parallel arrays, returns an array of tuples where | ||
var key, value; | ||
if (predicates_1.isArray(keyValTuple)) | ||
if ((0, predicates_1.isArray)(keyValTuple)) | ||
key = keyValTuple[0], value = keyValTuple[1]; | ||
if (!predicates_1.isString(key)) | ||
if (!(0, predicates_1.isString)(key)) | ||
throw new Error('invalid parameters to applyPairs'); | ||
@@ -518,3 +532,3 @@ memo[key] = value; | ||
dest = {}; | ||
return exports.extend(dest, src); | ||
return (0, exports.extend)(dest, src); | ||
} | ||
@@ -524,3 +538,3 @@ exports.copy = copy; | ||
function _forEach(obj, cb, _this) { | ||
if (predicates_1.isArray(obj)) | ||
if ((0, predicates_1.isArray)(obj)) | ||
return obj.forEach(cb, _this); | ||
@@ -553,9 +567,9 @@ Object.keys(obj).forEach(function (key) { return cb(obj[key], key); }); | ||
var tup = [o1, o2]; | ||
if (hof_1.all(predicates_1.isArray)(tup)) | ||
if ((0, hof_1.all)(predicates_1.isArray)(tup)) | ||
return _arraysEq(o1, o2); | ||
if (hof_1.all(predicates_1.isDate)(tup)) | ||
if ((0, hof_1.all)(predicates_1.isDate)(tup)) | ||
return o1.getTime() === o2.getTime(); | ||
if (hof_1.all(predicates_1.isRegExp)(tup)) | ||
if ((0, hof_1.all)(predicates_1.isRegExp)(tup)) | ||
return o1.toString() === o2.toString(); | ||
if (hof_1.all(predicates_1.isFunction)(tup)) | ||
if ((0, hof_1.all)(predicates_1.isFunction)(tup)) | ||
return true; // meh | ||
@@ -584,4 +598,6 @@ var predicates = [predicates_1.isFunction, predicates_1.isArray, predicates_1.isDate, predicates_1.isRegExp]; | ||
// issue #2676 | ||
exports.silenceUncaughtInPromise = function (promise) { return promise.catch(function (e) { return 0; }) && promise; }; | ||
exports.silentRejection = function (error) { return exports.silenceUncaughtInPromise(coreservices_1.services.$q.reject(error)); }; | ||
var silenceUncaughtInPromise = function (promise) { return promise.catch(function (e) { return 0; }) && promise; }; | ||
exports.silenceUncaughtInPromise = silenceUncaughtInPromise; | ||
var silentRejection = function (error) { return (0, exports.silenceUncaughtInPromise)(coreservices_1.services.$q.reject(error)); }; | ||
exports.silentRejection = silentRejection; | ||
//# sourceMappingURL=common.js.map |
@@ -5,7 +5,8 @@ "use strict"; | ||
var noImpl = function (fnname) { return function () { | ||
throw new Error("No implementation for " + fnname + ". The framework specific code did not implement this method."); | ||
throw new Error("No implementation for ".concat(fnname, ". The framework specific code did not implement this method.")); | ||
}; }; | ||
exports.makeStub = function (service, methods) { | ||
return methods.reduce(function (acc, key) { return ((acc[key] = noImpl(service + "." + key + "()")), acc); }, {}); | ||
var makeStub = function (service, methods) { | ||
return methods.reduce(function (acc, key) { return ((acc[key] = noImpl("".concat(service, ".").concat(String(key), "()"))), acc); }, {}); | ||
}; | ||
exports.makeStub = makeStub; | ||
var services = { | ||
@@ -12,0 +13,0 @@ $q: undefined, |
@@ -113,3 +113,5 @@ /** | ||
/** Given a class, returns a Predicate function that returns true if the object is of that class */ | ||
export declare const is: <T>(ctor: new (...args: any[]) => T) => (obj: any) => obj is T; | ||
export declare const is: <T>(ctor: { | ||
new (...args: any[]): T; | ||
}) => (obj: any) => obj is T; | ||
/** Given a value, returns a Predicate function that returns true if another value is === equal to the original value */ | ||
@@ -116,0 +118,0 @@ export declare const eq: (comp: any) => Predicate<any>; |
@@ -9,8 +9,10 @@ "use strict"; | ||
*/ | ||
var __spreadArrays = (this && this.__spreadArrays) || function () { | ||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; | ||
for (var r = Array(s), k = 0, i = 0; i < il; i++) | ||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) | ||
r[k] = a[j]; | ||
return r; | ||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { | ||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { | ||
if (ar || !(i in from)) { | ||
if (!ar) ar = Array.prototype.slice.call(from, 0, i); | ||
ar[i] = from[i]; | ||
} | ||
} | ||
return to.concat(ar || Array.prototype.slice.call(from)); | ||
}; | ||
@@ -66,3 +68,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
var args = Array.prototype.slice.call(arguments); | ||
return curried.bind.apply(curried, __spreadArrays([this], args)); | ||
return curried.bind.apply(curried, __spreadArray([this], args, false)); | ||
}; | ||
@@ -108,3 +110,4 @@ } | ||
*/ | ||
exports.prop = function (name) { return function (obj) { return obj && obj[name]; }; }; | ||
var prop = function (name) { return function (obj) { return obj && obj[name]; }; }; | ||
exports.prop = prop; | ||
/** | ||
@@ -126,3 +129,4 @@ * Given a property name and a value, returns a function that returns a boolean based on whether | ||
*/ | ||
exports.parse = function (name) { return pipe.apply(null, name.split('.').map(exports.prop)); }; | ||
var parse = function (name) { return pipe.apply(null, name.split('.').map(exports.prop)); }; | ||
exports.parse = parse; | ||
/** | ||
@@ -132,9 +136,12 @@ * Given a function that returns a truthy or falsey value, returns a | ||
*/ | ||
exports.not = function (fn) { return function () { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
return !fn.apply(null, args); | ||
}; }; | ||
var not = function (fn) { | ||
return function () { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
return !fn.apply(null, args); | ||
}; | ||
}; | ||
exports.not = not; | ||
/** | ||
@@ -174,13 +181,24 @@ * Given two functions that return truthy or falsey values, returns a function that returns truthy | ||
*/ | ||
exports.all = function (fn1) { return function (arr) { return arr.reduce(function (b, x) { return b && !!fn1(x); }, true); }; }; | ||
var all = function (fn1) { return function (arr) { return arr.reduce(function (b, x) { return b && !!fn1(x); }, true); }; }; | ||
exports.all = all; | ||
// tslint:disable-next-line:variable-name | ||
exports.any = function (fn1) { return function (arr) { return arr.reduce(function (b, x) { return b || !!fn1(x); }, false); }; }; | ||
var any = function (fn1) { return function (arr) { return arr.reduce(function (b, x) { return b || !!fn1(x); }, false); }; }; | ||
exports.any = any; | ||
/** Given a class, returns a Predicate function that returns true if the object is of that class */ | ||
exports.is = function (ctor) { return function (obj) { | ||
return (obj != null && obj.constructor === ctor) || obj instanceof ctor; | ||
}; }; | ||
var is = function (ctor) { | ||
return function (obj) { | ||
return (obj != null && obj.constructor === ctor) || obj instanceof ctor; | ||
}; | ||
}; | ||
exports.is = is; | ||
/** Given a value, returns a Predicate function that returns true if another value is === equal to the original value */ | ||
exports.eq = function (value) { return function (other) { return value === other; }; }; | ||
var eq = function (value) { return function (other) { return value === other; }; }; | ||
exports.eq = eq; | ||
/** Given a value, returns a function which returns the value */ | ||
exports.val = function (v) { return function () { return v; }; }; | ||
var val = function (v) { | ||
return function () { | ||
return v; | ||
}; | ||
}; | ||
exports.val = val; | ||
function invoke(fnName, args) { | ||
@@ -187,0 +205,0 @@ return function (obj) { return obj[fnName].apply(obj, args); }; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -10,3 +14,3 @@ if (k2 === undefined) k2 = k; | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
@@ -13,0 +17,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -16,9 +16,11 @@ "use strict"; | ||
exports.isUndefined = tis('undefined'); | ||
exports.isDefined = hof_1.not(exports.isUndefined); | ||
exports.isNull = function (o) { return o === null; }; | ||
exports.isNullOrUndefined = hof_1.or(exports.isNull, exports.isUndefined); | ||
exports.isDefined = (0, hof_1.not)(exports.isUndefined); | ||
var isNull = function (o) { return o === null; }; | ||
exports.isNull = isNull; | ||
exports.isNullOrUndefined = (0, hof_1.or)(exports.isNull, exports.isUndefined); | ||
exports.isFunction = tis('function'); | ||
exports.isNumber = tis('number'); | ||
exports.isString = tis('string'); | ||
exports.isObject = function (x) { return x !== null && typeof x === 'object'; }; | ||
var isObject = function (x) { return x !== null && typeof x === 'object'; }; | ||
exports.isObject = isObject; | ||
exports.isArray = Array.isArray; | ||
@@ -34,7 +36,7 @@ exports.isDate = (function (x) { return toStr.call(x) === '[object Date]'; }); | ||
function isInjectable(val) { | ||
if (exports.isArray(val) && val.length) { | ||
if ((0, exports.isArray)(val) && val.length) { | ||
var head = val.slice(0, -1), tail = val.slice(-1); | ||
return !(head.filter(hof_1.not(exports.isString)).length || tail.filter(hof_1.not(exports.isFunction)).length); | ||
return !(head.filter((0, hof_1.not)(exports.isString)).length || tail.filter((0, hof_1.not)(exports.isFunction)).length); | ||
} | ||
return exports.isFunction(val); | ||
return (0, exports.isFunction)(val); | ||
} | ||
@@ -47,3 +49,3 @@ exports.isInjectable = isInjectable; | ||
*/ | ||
exports.isPromise = hof_1.and(exports.isObject, hof_1.pipe(hof_1.prop('then'), exports.isFunction)); | ||
exports.isPromise = (0, hof_1.and)(exports.isObject, (0, hof_1.pipe)((0, hof_1.prop)('then'), exports.isFunction)); | ||
//# sourceMappingURL=predicates.js.map |
@@ -12,3 +12,3 @@ "use strict"; | ||
this._evictListeners = []; | ||
this.onEvict = common_1.pushTo(this._evictListeners); | ||
this.onEvict = (0, common_1.pushTo)(this._evictListeners); | ||
} | ||
@@ -15,0 +15,0 @@ Queue.prototype.enqueue = function (item) { |
@@ -63,3 +63,3 @@ "use strict"; | ||
function fnToString(fn) { | ||
var _fn = predicates_1.isArray(fn) ? fn.slice(-1)[0] : fn; | ||
var _fn = (0, predicates_1.isArray)(fn) ? fn.slice(-1)[0] : fn; | ||
return (_fn && _fn.toString()) || 'undefined'; | ||
@@ -72,15 +72,15 @@ } | ||
var hasToString = function (obj) { | ||
return predicates_1.isObject(obj) && !predicates_1.isArray(obj) && obj.constructor !== Object && predicates_1.isFunction(obj.toString); | ||
return (0, predicates_1.isObject)(obj) && !(0, predicates_1.isArray)(obj) && obj.constructor !== Object && (0, predicates_1.isFunction)(obj.toString); | ||
}; | ||
var stringifyPattern = hof_1.pattern([ | ||
[predicates_1.isUndefined, hof_1.val('undefined')], | ||
[predicates_1.isNull, hof_1.val('null')], | ||
[predicates_1.isPromise, hof_1.val('[Promise]')], | ||
var stringifyPattern = (0, hof_1.pattern)([ | ||
[predicates_1.isUndefined, (0, hof_1.val)('undefined')], | ||
[predicates_1.isNull, (0, hof_1.val)('null')], | ||
[predicates_1.isPromise, (0, hof_1.val)('[Promise]')], | ||
[isRejection, function (x) { return x._transitionRejection.toString(); }], | ||
[hasToString, function (x) { return x.toString(); }], | ||
[predicates_1.isInjectable, functionToString], | ||
[hof_1.val(true), common_1.identity], | ||
[(0, hof_1.val)(true), common_1.identity], | ||
]); | ||
function format(value) { | ||
if (predicates_1.isObject(value)) { | ||
if ((0, predicates_1.isObject)(value)) { | ||
if (seen.indexOf(value) !== -1) | ||
@@ -92,3 +92,3 @@ return '[circular ref]'; | ||
} | ||
if (predicates_1.isUndefined(o)) { | ||
if ((0, predicates_1.isUndefined)(o)) { | ||
// Workaround for IE & Edge Spec incompatibility where replacer function would not be called when JSON.stringify | ||
@@ -103,3 +103,3 @@ // is given `undefined` as value. To work around that, we simply detect `undefined` and bail out early by | ||
/** Returns a function that splits a string on a character or substring */ | ||
exports.beforeAfterSubstr = function (char) { | ||
var beforeAfterSubstr = function (char) { | ||
return function (str) { | ||
@@ -114,8 +114,11 @@ if (!str) | ||
}; | ||
exports.beforeAfterSubstr = beforeAfterSubstr; | ||
exports.hostRegex = new RegExp('^(?:[a-z]+:)?//[^/]+/'); | ||
exports.stripLastPathElement = function (str) { return str.replace(/\/[^/]*$/, ''); }; | ||
exports.splitHash = exports.beforeAfterSubstr('#'); | ||
exports.splitQuery = exports.beforeAfterSubstr('?'); | ||
exports.splitEqual = exports.beforeAfterSubstr('='); | ||
exports.trimHashVal = function (str) { return (str ? str.replace(/^#/, '') : ''); }; | ||
var stripLastPathElement = function (str) { return str.replace(/\/[^/]*$/, ''); }; | ||
exports.stripLastPathElement = stripLastPathElement; | ||
exports.splitHash = (0, exports.beforeAfterSubstr)('#'); | ||
exports.splitQuery = (0, exports.beforeAfterSubstr)('?'); | ||
exports.splitEqual = (0, exports.beforeAfterSubstr)('='); | ||
var trimHashVal = function (str) { return (str ? str.replace(/^#/, '') : ''); }; | ||
exports.trimHashVal = trimHashVal; | ||
/** | ||
@@ -149,7 +152,7 @@ * Splits on a delimiter, but returns the delimiters in the array | ||
function joinNeighborsR(acc, x) { | ||
if (predicates_1.isString(common_1.tail(acc)) && predicates_1.isString(x)) | ||
return acc.slice(0, -1).concat(common_1.tail(acc) + x); | ||
return common_1.pushR(acc, x); | ||
if ((0, predicates_1.isString)((0, common_1.tail)(acc)) && (0, predicates_1.isString)(x)) | ||
return acc.slice(0, -1).concat((0, common_1.tail)(acc) + x); | ||
return (0, common_1.pushR)(acc, x); | ||
} | ||
exports.joinNeighborsR = joinNeighborsR; | ||
//# sourceMappingURL=strings.js.map |
@@ -46,3 +46,3 @@ "use strict"; | ||
var state = uiview.creationContext ? uiview.creationContext.name || '(root)' : '(none)'; | ||
return "[ui-view#" + uiview.id + " " + uiview.$type + ":" + uiview.fqn + " (" + uiview.name + "@" + state + ")]"; | ||
return "[ui-view#".concat(uiview.id, " ").concat(uiview.$type, ":").concat(uiview.fqn, " (").concat(uiview.name, "@").concat(state, ")]"); | ||
} | ||
@@ -52,6 +52,6 @@ var viewConfigString = function (viewConfig) { | ||
var state = view.$context.name || '(root)'; | ||
return "[View#" + viewConfig.$id + " from '" + state + "' state]: target ui-view: '" + view.$uiViewName + "@" + view.$uiViewContextAnchor + "'"; | ||
return "[View#".concat(viewConfig.$id, " from '").concat(state, "' state]: target ui-view: '").concat(view.$uiViewName, "@").concat(view.$uiViewContextAnchor, "'"); | ||
}; | ||
function normalizedCat(input) { | ||
return predicates_1.isNumber(input) ? Category[input] : Category[Category[input]]; | ||
return (0, predicates_1.isNumber)(input) ? Category[input] : Category[Category[input]]; | ||
} | ||
@@ -78,7 +78,6 @@ /** | ||
Category[Category["VIEWCONFIG"] = 4] = "VIEWCONFIG"; | ||
})(Category || (Category = {})); | ||
exports.Category = Category; | ||
var _tid = hof_1.parse('$id'); | ||
var _rid = hof_1.parse('router.$id'); | ||
var transLbl = function (trans) { return "Transition #" + _tid(trans) + "-" + _rid(trans); }; | ||
})(Category || (exports.Category = Category = {})); | ||
var _tid = (0, hof_1.parse)('$id'); | ||
var _rid = (0, hof_1.parse)('router.$id'); | ||
var transLbl = function (trans) { return "Transition #".concat(_tid(trans), "-").concat(_rid(trans)); }; | ||
/** | ||
@@ -135,3 +134,3 @@ * Prints UI-Router Transition trace information to the console. | ||
return; | ||
safeConsole_1.safeConsole.log(transLbl(trans) + ": Started -> " + strings_1.stringify(trans)); | ||
safeConsole_1.safeConsole.log("".concat(transLbl(trans), ": Started -> ").concat((0, strings_1.stringify)(trans))); | ||
}; | ||
@@ -142,3 +141,3 @@ /** @internal called by ui-router code */ | ||
return; | ||
safeConsole_1.safeConsole.log(transLbl(trans) + ": Ignored <> " + strings_1.stringify(trans)); | ||
safeConsole_1.safeConsole.log("".concat(transLbl(trans), ": Ignored <> ").concat((0, strings_1.stringify)(trans))); | ||
}; | ||
@@ -149,4 +148,4 @@ /** @internal called by ui-router code */ | ||
return; | ||
var event = hof_1.parse('traceData.hookType')(options) || 'internal', context = hof_1.parse('traceData.context.state.name')(options) || hof_1.parse('traceData.context')(options) || 'unknown', name = strings_1.functionToString(step.registeredHook.callback); | ||
safeConsole_1.safeConsole.log(transLbl(trans) + ": Hook -> " + event + " context: " + context + ", " + strings_1.maxLength(200, name)); | ||
var event = (0, hof_1.parse)('traceData.hookType')(options) || 'internal', context = (0, hof_1.parse)('traceData.context.state.name')(options) || (0, hof_1.parse)('traceData.context')(options) || 'unknown', name = (0, strings_1.functionToString)(step.registeredHook.callback); | ||
safeConsole_1.safeConsole.log("".concat(transLbl(trans), ": Hook -> ").concat(event, " context: ").concat(context, ", ").concat((0, strings_1.maxLength)(200, name))); | ||
}; | ||
@@ -157,3 +156,3 @@ /** @internal called by ui-router code */ | ||
return; | ||
safeConsole_1.safeConsole.log(transLbl(trans) + ": <- Hook returned: " + strings_1.maxLength(200, strings_1.stringify(hookResult))); | ||
safeConsole_1.safeConsole.log("".concat(transLbl(trans), ": <- Hook returned: ").concat((0, strings_1.maxLength)(200, (0, strings_1.stringify)(hookResult)))); | ||
}; | ||
@@ -164,3 +163,3 @@ /** @internal called by ui-router code */ | ||
return; | ||
safeConsole_1.safeConsole.log(transLbl(trans) + ": Resolving " + path + " (" + when + ")"); | ||
safeConsole_1.safeConsole.log("".concat(transLbl(trans), ": Resolving ").concat(path, " (").concat(when, ")")); | ||
}; | ||
@@ -171,3 +170,3 @@ /** @internal called by ui-router code */ | ||
return; | ||
safeConsole_1.safeConsole.log(transLbl(trans) + ": <- Resolved " + resolvable + " to: " + strings_1.maxLength(200, strings_1.stringify(resolvable.data))); | ||
safeConsole_1.safeConsole.log("".concat(transLbl(trans), ": <- Resolved ").concat(resolvable, " to: ").concat((0, strings_1.maxLength)(200, (0, strings_1.stringify)(resolvable.data)))); | ||
}; | ||
@@ -178,3 +177,3 @@ /** @internal called by ui-router code */ | ||
return; | ||
safeConsole_1.safeConsole.log(transLbl(trans) + ": <- Rejected " + strings_1.stringify(trans) + ", reason: " + reason); | ||
safeConsole_1.safeConsole.log("".concat(transLbl(trans), ": <- Rejected ").concat((0, strings_1.stringify)(trans), ", reason: ").concat(reason)); | ||
}; | ||
@@ -185,3 +184,3 @@ /** @internal called by ui-router code */ | ||
return; | ||
safeConsole_1.safeConsole.log(transLbl(trans) + ": <- Success " + strings_1.stringify(trans) + ", final state: " + finalState.name); | ||
safeConsole_1.safeConsole.log("".concat(transLbl(trans), ": <- Success ").concat((0, strings_1.stringify)(trans), ", final state: ").concat(finalState.name)); | ||
}; | ||
@@ -193,3 +192,3 @@ /** @internal called by ui-router code */ | ||
return; | ||
safeConsole_1.safeConsole.log("ui-view: " + strings_1.padString(30, event) + " " + uiViewString(viewData) + extra); | ||
safeConsole_1.safeConsole.log("ui-view: ".concat((0, strings_1.padString)(30, event), " ").concat(uiViewString(viewData)).concat(extra)); | ||
}; | ||
@@ -200,3 +199,3 @@ /** @internal called by ui-router code */ | ||
return; | ||
this.traceUIViewEvent('Updating', viewData, " with ViewConfig from context='" + context + "'"); | ||
this.traceUIViewEvent('Updating', viewData, " with ViewConfig from context='".concat(context, "'")); | ||
}; | ||
@@ -207,3 +206,3 @@ /** @internal called by ui-router code */ | ||
return; | ||
this.traceUIViewEvent('Fill', viewData, " with: " + strings_1.maxLength(200, html)); | ||
this.traceUIViewEvent('Fill', viewData, " with: ".concat((0, strings_1.maxLength)(200, html))); | ||
}; | ||
@@ -221,3 +220,3 @@ /** @internal called by ui-router code */ | ||
var uiv = uiView && uiView.fqn; | ||
var cfg = viewConfig && viewConfig.viewDecl.$context.name + ": (" + viewConfig.viewDecl.$name + ")"; | ||
var cfg = viewConfig && "".concat(viewConfig.viewDecl.$context.name, ": (").concat(viewConfig.viewDecl.$name, ")"); | ||
return _b = {}, _b[uivheader] = uiv, _b[cfgheader] = cfg, _b; | ||
@@ -232,3 +231,3 @@ }) | ||
return; | ||
safeConsole_1.safeConsole.log("VIEWCONFIG: " + event + " " + viewConfigString(viewConfig)); | ||
safeConsole_1.safeConsole.log("VIEWCONFIG: ".concat(event, " ").concat(viewConfigString(viewConfig))); | ||
}; | ||
@@ -239,3 +238,3 @@ /** @internal called by ui-router code */ | ||
return; | ||
safeConsole_1.safeConsole.log("VIEWCONFIG: " + event + " " + uiViewString(viewData)); | ||
safeConsole_1.safeConsole.log("VIEWCONFIG: ".concat(event, " ").concat(uiViewString(viewData))); | ||
}; | ||
@@ -242,0 +241,0 @@ return Trace; |
@@ -17,7 +17,8 @@ "use strict"; | ||
} | ||
exports.registerAddCoreResolvables = function (transitionService) { | ||
var registerAddCoreResolvables = function (transitionService) { | ||
return transitionService.onCreate({}, addCoreResolvables); | ||
}; | ||
exports.registerAddCoreResolvables = registerAddCoreResolvables; | ||
var TRANSITION_TOKENS = ['$transition$', transition_1.Transition]; | ||
var isTransition = common_1.inArray(TRANSITION_TOKENS); | ||
var isTransition = (0, common_1.inArray)(TRANSITION_TOKENS); | ||
// References to Transition in the treeChanges pathnodes makes all | ||
@@ -27,4 +28,4 @@ // previous Transitions reachable in memory, causing a memory leak | ||
// Do not use this on current transitions, only on old ones. | ||
exports.treeChangesCleanup = function (trans) { | ||
var nodes = common_1.values(trans.treeChanges()).reduce(common_1.unnestR, []).reduce(common_1.uniqR, []); | ||
var treeChangesCleanup = function (trans) { | ||
var nodes = (0, common_1.values)(trans.treeChanges()).reduce(common_1.unnestR, []).reduce(common_1.uniqR, []); | ||
// If the resolvable is a Transition, return a new resolvable with null data | ||
@@ -38,2 +39,3 @@ var replaceTransitionWithNull = function (r) { | ||
}; | ||
exports.treeChangesCleanup = treeChangesCleanup; | ||
//# sourceMappingURL=coreResolvables.js.map |
@@ -28,5 +28,6 @@ "use strict"; | ||
} | ||
exports.registerIgnoredTransitionHook = function (transitionService) { | ||
var registerIgnoredTransitionHook = function (transitionService) { | ||
return transitionService.onBefore({}, ignoredHook, { priority: -9999 }); | ||
}; | ||
exports.registerIgnoredTransitionHook = registerIgnoredTransitionHook; | ||
//# sourceMappingURL=ignoredTransition.js.map |
@@ -16,5 +16,6 @@ "use strict"; | ||
} | ||
exports.registerInvalidTransitionHook = function (transitionService) { | ||
var registerInvalidTransitionHook = function (transitionService) { | ||
return transitionService.onBefore({}, invalidTransitionHook, { priority: -10000 }); | ||
}; | ||
exports.registerInvalidTransitionHook = registerInvalidTransitionHook; | ||
//# sourceMappingURL=invalidTransition.js.map |
@@ -59,5 +59,6 @@ "use strict"; | ||
}; | ||
exports.registerLazyLoadHook = function (transitionService) { | ||
var registerLazyLoadHook = function (transitionService) { | ||
return transitionService.onBefore({ entering: function (state) { return !!state.lazyLoad; } }, lazyLoadHook); | ||
}; | ||
exports.registerLazyLoadHook = registerLazyLoadHook; | ||
/** | ||
@@ -64,0 +65,0 @@ * Invokes a state's lazy load function |
@@ -27,5 +27,6 @@ "use strict"; | ||
var onExitHook = makeEnterExitRetainHook('onExit'); | ||
exports.registerOnExitHook = function (transitionService) { | ||
var registerOnExitHook = function (transitionService) { | ||
return transitionService.onExit({ exiting: function (state) { return !!state.onExit; } }, onExitHook); | ||
}; | ||
exports.registerOnExitHook = registerOnExitHook; | ||
/** | ||
@@ -41,5 +42,6 @@ * The [[TransitionStateHookFn]] for onRetain | ||
var onRetainHook = makeEnterExitRetainHook('onRetain'); | ||
exports.registerOnRetainHook = function (transitionService) { | ||
var registerOnRetainHook = function (transitionService) { | ||
return transitionService.onRetain({ retained: function (state) { return !!state.onRetain; } }, onRetainHook); | ||
}; | ||
exports.registerOnRetainHook = registerOnRetainHook; | ||
/** | ||
@@ -55,5 +57,6 @@ * The [[TransitionStateHookFn]] for onEnter | ||
var onEnterHook = makeEnterExitRetainHook('onEnter'); | ||
exports.registerOnEnterHook = function (transitionService) { | ||
var registerOnEnterHook = function (transitionService) { | ||
return transitionService.onEnter({ entering: function (state) { return !!state.onEnter; } }, onEnterHook); | ||
}; | ||
exports.registerOnEnterHook = registerOnEnterHook; | ||
//# sourceMappingURL=onEnterExitRetain.js.map |
@@ -24,3 +24,3 @@ "use strict"; | ||
return result; | ||
if (predicates_1.isString(result)) | ||
if ((0, predicates_1.isString)(result)) | ||
return $state.target(result, trans.params(), trans.options()); | ||
@@ -30,3 +30,3 @@ if (result['state'] || result['params']) | ||
} | ||
if (predicates_1.isFunction(redirect)) { | ||
if ((0, predicates_1.isFunction)(redirect)) { | ||
return coreservices_1.services.$q.when(redirect(trans)).then(handleResult); | ||
@@ -36,5 +36,6 @@ } | ||
}; | ||
exports.registerRedirectToHook = function (transitionService) { | ||
var registerRedirectToHook = function (transitionService) { | ||
return transitionService.onStart({ to: function (state) { return !!state.redirectTo; } }, redirectToHook); | ||
}; | ||
exports.registerRedirectToHook = registerRedirectToHook; | ||
//# sourceMappingURL=redirectTo.js.map |
@@ -20,5 +20,6 @@ "use strict"; | ||
}; | ||
exports.registerEagerResolvePath = function (transitionService) { | ||
var registerEagerResolvePath = function (transitionService) { | ||
return transitionService.onStart({}, eagerResolvePath, { priority: exports.RESOLVE_HOOK_PRIORITY }); | ||
}; | ||
exports.registerEagerResolvePath = registerEagerResolvePath; | ||
/** | ||
@@ -36,5 +37,6 @@ * A [[TransitionHookFn]] which resolves all LAZY Resolvables for the state (and all its ancestors) in the To Path | ||
}; | ||
exports.registerLazyResolveState = function (transitionService) { | ||
return transitionService.onEnter({ entering: hof_1.val(true) }, lazyResolveState, { priority: exports.RESOLVE_HOOK_PRIORITY }); | ||
var registerLazyResolveState = function (transitionService) { | ||
return transitionService.onEnter({ entering: (0, hof_1.val)(true) }, lazyResolveState, { priority: exports.RESOLVE_HOOK_PRIORITY }); | ||
}; | ||
exports.registerLazyResolveState = registerLazyResolveState; | ||
/** | ||
@@ -53,5 +55,6 @@ * A [[TransitionHookFn]] which resolves any dynamically added (LAZY or EAGER) Resolvables. | ||
}; | ||
exports.registerResolveRemaining = function (transitionService) { | ||
var registerResolveRemaining = function (transitionService) { | ||
return transitionService.onFinish({}, resolveRemaining, { priority: exports.RESOLVE_HOOK_PRIORITY }); | ||
}; | ||
exports.registerResolveRemaining = registerResolveRemaining; | ||
//# sourceMappingURL=resolve.js.map |
@@ -23,3 +23,3 @@ "use strict"; | ||
globals.current = globals.$current.self; | ||
common_1.copy(trans.params(), globals.params); | ||
(0, common_1.copy)(trans.params(), globals.params); | ||
}; | ||
@@ -34,5 +34,6 @@ var clearCurrentTransition = function () { | ||
}; | ||
exports.registerUpdateGlobalState = function (transitionService) { | ||
var registerUpdateGlobalState = function (transitionService) { | ||
return transitionService.onCreate({}, updateGlobalState); | ||
}; | ||
exports.registerUpdateGlobalState = registerUpdateGlobalState; | ||
//# sourceMappingURL=updateGlobals.js.map |
@@ -23,5 +23,6 @@ "use strict"; | ||
}; | ||
exports.registerUpdateUrl = function (transitionService) { | ||
var registerUpdateUrl = function (transitionService) { | ||
return transitionService.onSuccess({}, updateUrl, { priority: 9999 }); | ||
}; | ||
exports.registerUpdateUrl = registerUpdateUrl; | ||
//# sourceMappingURL=url.js.map |
@@ -21,5 +21,6 @@ "use strict"; | ||
}; | ||
exports.registerLoadEnteringViews = function (transitionService) { | ||
var registerLoadEnteringViews = function (transitionService) { | ||
return transitionService.onFinish({}, loadEnteringViews); | ||
}; | ||
exports.registerLoadEnteringViews = registerLoadEnteringViews; | ||
/** | ||
@@ -45,5 +46,6 @@ * A [[TransitionHookFn]] which activates the new views when a transition is successful. | ||
}; | ||
exports.registerActivateViews = function (transitionService) { | ||
var registerActivateViews = function (transitionService) { | ||
return transitionService.onSuccess({}, activateViews); | ||
}; | ||
exports.registerActivateViews = registerActivateViews; | ||
//# sourceMappingURL=views.js.map |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -10,3 +14,3 @@ if (k2 === undefined) k2 = k; | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
@@ -13,0 +17,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -10,3 +14,3 @@ if (k2 === undefined) k2 = k; | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
@@ -13,0 +17,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -18,10 +18,9 @@ "use strict"; | ||
DefType[DefType["CONFIG"] = 2] = "CONFIG"; | ||
})(DefType || (DefType = {})); | ||
exports.DefType = DefType; | ||
})(DefType || (exports.DefType = DefType = {})); | ||
function getParamDeclaration(paramName, location, state) { | ||
var noReloadOnSearch = (state.reloadOnSearch === false && location === DefType.SEARCH) || undefined; | ||
var dynamic = common_1.find([state.dynamic, noReloadOnSearch], predicates_1.isDefined); | ||
var defaultConfig = predicates_1.isDefined(dynamic) ? { dynamic: dynamic } : {}; | ||
var dynamic = (0, common_1.find)([state.dynamic, noReloadOnSearch], predicates_1.isDefined); | ||
var defaultConfig = (0, predicates_1.isDefined)(dynamic) ? { dynamic: dynamic } : {}; | ||
var paramConfig = unwrapShorthand(state && state.params && state.params[paramName]); | ||
return common_1.extend(defaultConfig, paramConfig); | ||
return (0, common_1.extend)(defaultConfig, paramConfig); | ||
} | ||
@@ -34,8 +33,8 @@ function unwrapShorthand(cfg) { | ||
} | ||
var $$fn = predicates_1.isInjectable(cfg.value) ? cfg.value : getStaticDefaultValue; | ||
return common_1.extend(cfg, { $$fn: $$fn }); | ||
var $$fn = (0, predicates_1.isInjectable)(cfg.value) ? cfg.value : getStaticDefaultValue; | ||
return (0, common_1.extend)(cfg, { $$fn: $$fn }); | ||
} | ||
function getType(cfg, urlType, location, id, paramTypes) { | ||
if (cfg.type && urlType && urlType.name !== 'string') | ||
throw new Error("Param '" + id + "' has two type configurations."); | ||
throw new Error("Param '".concat(id, "' has two type configurations.")); | ||
if (cfg.type && urlType && urlType.name === 'string' && paramTypes.type(cfg.type)) | ||
@@ -62,7 +61,7 @@ return paramTypes.type(cfg.type); | ||
return false; | ||
if (!predicates_1.isDefined(squash) || squash == null) | ||
if (!(0, predicates_1.isDefined)(squash) || squash == null) | ||
return defaultPolicy; | ||
if (squash === true || predicates_1.isString(squash)) | ||
if (squash === true || (0, predicates_1.isString)(squash)) | ||
return squash; | ||
throw new Error("Invalid squash policy: '" + squash + "'. Valid policies: false, true, or arbitrary string"); | ||
throw new Error("Invalid squash policy: '".concat(squash, "'. Valid policies: false, true, or arbitrary string")); | ||
} | ||
@@ -74,7 +73,7 @@ function getReplace(config, arrayMode, isOptional, squash) { | ||
]; | ||
var replace = predicates_1.isArray(config.replace) ? config.replace : []; | ||
if (predicates_1.isString(squash)) | ||
var replace = (0, predicates_1.isArray)(config.replace) ? config.replace : []; | ||
if ((0, predicates_1.isString)(squash)) | ||
replace.push({ from: squash, to: undefined }); | ||
var configuredKeys = common_1.map(replace, hof_1.prop('from')); | ||
return common_1.filter(defaultPolicy, function (item) { return configuredKeys.indexOf(item.from) === -1; }).concat(replace); | ||
var configuredKeys = (0, common_1.map)(replace, (0, hof_1.prop)('from')); | ||
return (0, common_1.filter)(defaultPolicy, function (item) { return configuredKeys.indexOf(item.from) === -1; }).concat(replace); | ||
} | ||
@@ -88,7 +87,7 @@ var Param = /** @class */ (function () { | ||
var isOptional = config.value !== undefined || location === DefType.SEARCH; | ||
var dynamic = predicates_1.isDefined(config.dynamic) ? !!config.dynamic : !!type.dynamic; | ||
var raw = predicates_1.isDefined(config.raw) ? !!config.raw : !!type.raw; | ||
var dynamic = (0, predicates_1.isDefined)(config.dynamic) ? !!config.dynamic : !!type.dynamic; | ||
var raw = (0, predicates_1.isDefined)(config.raw) ? !!config.raw : !!type.raw; | ||
var squash = getSquashPolicy(config, isOptional, urlConfig.defaultSquashPolicy()); | ||
var replace = getReplace(config, arrayMode, isOptional, squash); | ||
var inherit = predicates_1.isDefined(config.inherit) ? !!config.inherit : !!type.inherit; | ||
var inherit = (0, predicates_1.isDefined)(config.inherit) ? !!config.inherit : !!type.inherit; | ||
// array config: param name (param[]) overrides default settings. explicit config overrides param name. | ||
@@ -98,5 +97,5 @@ function getArrayMode() { | ||
var arrayParamNomenclature = id.match(/\[\]$/) ? { array: true } : {}; | ||
return common_1.extend(arrayDefaults, arrayParamNomenclature, config).array; | ||
return (0, common_1.extend)(arrayDefaults, arrayParamNomenclature, config).array; | ||
} | ||
common_1.extend(this, { id: id, type: type, location: location, isOptional: isOptional, dynamic: dynamic, raw: raw, squash: squash, replace: replace, inherit: inherit, array: arrayMode, config: config }); | ||
(0, common_1.extend)(this, { id: id, type: type, location: location, isOptional: isOptional, dynamic: dynamic, raw: raw, squash: squash, replace: replace, inherit: inherit, array: arrayMode, config: config }); | ||
} | ||
@@ -166,3 +165,3 @@ Param.values = function (params, values) { | ||
if (defaultValue !== null && defaultValue !== undefined && !_this.type.is(defaultValue)) | ||
throw new Error("Default value (" + defaultValue + ") for parameter '" + _this.id + "' is not an instance of ParamType (" + _this.type.name + ")"); | ||
throw new Error("Default value (".concat(defaultValue, ") for parameter '").concat(_this.id, "' is not an instance of ParamType (").concat(_this.type.name, ")")); | ||
if (_this.config.$$fn['__cacheable']) { | ||
@@ -182,3 +181,3 @@ _this._defaultValueCache = { defaultValue: defaultValue }; | ||
value = replaceSpecialValues(value); | ||
return predicates_1.isUndefined(value) ? getDefaultValue() : this.type.$normalize(value); | ||
return (0, predicates_1.isUndefined)(value) ? getDefaultValue() : this.type.$normalize(value); | ||
}; | ||
@@ -190,3 +189,3 @@ Param.prototype.isSearch = function () { | ||
// There was no parameter value, but the param is optional | ||
if ((predicates_1.isUndefined(value) || value === null) && this.isOptional) | ||
if (((0, predicates_1.isUndefined)(value) || value === null) && this.isOptional) | ||
return true; | ||
@@ -199,6 +198,6 @@ // The value was not of the correct ParamType, and could not be decoded to the correct ParamType | ||
var encoded = this.type.encode(normalized); | ||
return !(predicates_1.isString(encoded) && !this.type.pattern.exec(encoded)); | ||
return !((0, predicates_1.isString)(encoded) && !this.type.pattern.exec(encoded)); | ||
}; | ||
Param.prototype.toString = function () { | ||
return "{Param:" + this.id + " " + this.type + " squash: '" + this.squash + "' optional: " + this.isOptional + "}"; | ||
return "{Param:".concat(this.id, " ").concat(this.type, " squash: '").concat(this.squash, "' optional: ").concat(this.isOptional, "}"); | ||
}; | ||
@@ -205,0 +204,0 @@ return Param; |
@@ -40,3 +40,3 @@ "use strict"; | ||
this.inherit = true; | ||
common_1.extend(this, def); | ||
(0, common_1.extend)(this, def); | ||
} | ||
@@ -66,3 +66,3 @@ // consider these four methods to be "abstract methods" that should be overridden | ||
ParamType.prototype.toString = function () { | ||
return "{ParamType:" + this.name + "}"; | ||
return "{ParamType:".concat(this.name, "}"); | ||
}; | ||
@@ -98,3 +98,3 @@ /** Given an encoded string, or a decoded object, returns a decoded object */ | ||
function arrayWrap(val) { | ||
return predicates_1.isArray(val) ? val : predicates_1.isDefined(val) ? [val] : []; | ||
return (0, predicates_1.isArray)(val) ? val : (0, predicates_1.isDefined)(val) ? [val] : []; | ||
} | ||
@@ -115,7 +115,7 @@ // Unwrap array value for "auto" mode. Return undefined for empty array. | ||
return function handleArray(val) { | ||
if (predicates_1.isArray(val) && val.length === 0) | ||
if ((0, predicates_1.isArray)(val) && val.length === 0) | ||
return val; | ||
var arr = arrayWrap(val); | ||
var result = common_1.map(arr, callback); | ||
return allTruthyMode === true ? common_1.filter(result, function (x) { return !x; }).length === 0 : arrayUnwrap(result); | ||
var result = (0, common_1.map)(arr, callback); | ||
return allTruthyMode === true ? (0, common_1.filter)(result, function (x) { return !x; }).length === 0 : arrayUnwrap(result); | ||
}; | ||
@@ -141,3 +141,3 @@ } | ||
}); | ||
common_1.extend(this, { | ||
(0, common_1.extend)(this, { | ||
dynamic: type.dynamic, | ||
@@ -144,0 +144,0 @@ name: type.name, |
@@ -36,3 +36,3 @@ "use strict"; | ||
this.typeQueue = []; | ||
this.defaultTypes = common_1.pick(ParamTypes.prototype, [ | ||
this.defaultTypes = (0, common_1.pick)(ParamTypes.prototype, [ | ||
'hash', | ||
@@ -49,4 +49,4 @@ 'string', | ||
// Register default types. Store them in the prototype of this.types. | ||
var makeType = function (definition, name) { return new paramType_1.ParamType(common_1.extend({ name: name }, definition)); }; | ||
this.types = common_1.inherit(common_1.map(this.defaultTypes, makeType), {}); | ||
var makeType = function (definition, name) { return new paramType_1.ParamType((0, common_1.extend)({ name: name }, definition)); }; | ||
this.types = (0, common_1.inherit)((0, common_1.map)(this.defaultTypes, makeType), {}); | ||
} | ||
@@ -62,7 +62,7 @@ ParamTypes.prototype.dispose = function () { | ||
ParamTypes.prototype.type = function (name, definition, definitionFn) { | ||
if (!predicates_1.isDefined(definition)) | ||
if (!(0, predicates_1.isDefined)(definition)) | ||
return this.types[name]; | ||
if (this.types.hasOwnProperty(name)) | ||
throw new Error("A type named '" + name + "' has already been defined."); | ||
this.types[name] = new paramType_1.ParamType(common_1.extend({ name: name }, definition)); | ||
throw new Error("A type named '".concat(name, "' has already been defined.")); | ||
this.types[name] = new paramType_1.ParamType((0, common_1.extend)({ name: name }, definition)); | ||
if (definitionFn) { | ||
@@ -80,3 +80,3 @@ this.typeQueue.push({ name: name, def: definitionFn }); | ||
throw new Error("You cannot override a type's .pattern at runtime."); | ||
common_1.extend(this.types[type.name], coreservices_1.services.$injector.invoke(type.def)); | ||
(0, common_1.extend)(this.types[type.name], coreservices_1.services.$injector.invoke(type.def)); | ||
} | ||
@@ -93,11 +93,11 @@ }; | ||
decode: valToString, | ||
is: hof_1.is(String), | ||
is: (0, hof_1.is)(String), | ||
pattern: /.*/, | ||
// tslint:disable-next-line:triple-equals | ||
equals: function (a, b) { return a == b; }, | ||
equals: function (a, b) { return a == b; }, // allow coersion for null/undefined/"" | ||
}; | ||
return common_1.extend({}, defaultTypeBase, def); | ||
return (0, common_1.extend)({}, defaultTypeBase, def); | ||
}; | ||
// Default Parameter Type Definitions | ||
common_1.extend(ParamTypes.prototype, { | ||
(0, common_1.extend)(ParamTypes.prototype, { | ||
string: makeDefaultType({}), | ||
@@ -114,3 +114,3 @@ path: makeDefaultType({ | ||
is: function (val) { | ||
return !predicates_1.isNullOrUndefined(val) && this.decode(val.toString()) === val; | ||
return !(0, predicates_1.isNullOrUndefined)(val) && this.decode(val.toString()) === val; | ||
}, | ||
@@ -122,3 +122,3 @@ pattern: /-?\d+/, | ||
decode: function (val) { return parseInt(val, 10) !== 0; }, | ||
is: hof_1.is(Boolean), | ||
is: (0, hof_1.is)(Boolean), | ||
pattern: /0|1/, | ||
@@ -148,3 +148,3 @@ }), | ||
decode: common_1.fromJson, | ||
is: hof_1.is(Object), | ||
is: (0, hof_1.is)(Object), | ||
equals: common_1.equals, | ||
@@ -151,0 +151,0 @@ pattern: /[^/]*/, |
@@ -8,3 +8,3 @@ "use strict"; | ||
if (params === void 0) { params = {}; } | ||
common_1.extend(this, params); | ||
(0, common_1.extend)(this, params); | ||
} | ||
@@ -20,3 +20,3 @@ /** | ||
StateParams.prototype.$inherit = function (newParams, $current, $to) { | ||
var parents = common_1.ancestors($current, $to), inherited = {}, inheritList = []; | ||
var parents = (0, common_1.ancestors)($current, $to), inherited = {}, inheritList = []; | ||
for (var i in parents) { | ||
@@ -30,3 +30,5 @@ if (!parents[i] || !parents[i].params) | ||
for (var j in parentParamsKeys) { | ||
if (parentParams[parentParamsKeys[j]].inherit == false || inheritList.indexOf(parentParamsKeys[j]) >= 0) | ||
if (!parentParamsKeys.hasOwnProperty(j) || | ||
parentParams[parentParamsKeys[j]].inherit == false || | ||
inheritList.indexOf(parentParamsKeys[j]) >= 0) | ||
continue; | ||
@@ -37,3 +39,3 @@ inheritList.push(parentParamsKeys[j]); | ||
} | ||
return common_1.extend({}, inherited, newParams); | ||
return (0, common_1.extend)({}, inherited, newParams); | ||
}; | ||
@@ -40,0 +42,0 @@ return StateParams; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -10,3 +14,3 @@ if (k2 === undefined) k2 = k; | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
@@ -13,0 +17,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -60,2 +60,2 @@ import { StateObject } from '../state/stateObject'; | ||
/** @internal */ | ||
export declare type GetParamsFn = (pathNode: PathNode) => Param[]; | ||
export type GetParamsFn = (pathNode: PathNode) => Param[]; |
@@ -20,3 +20,3 @@ "use strict"; | ||
this.paramSchema = node.paramSchema.slice(); | ||
this.paramValues = common_1.extend({}, node.paramValues); | ||
this.paramValues = (0, common_1.extend)({}, node.paramValues); | ||
this.resolvables = node.resolvables.slice(); | ||
@@ -39,3 +39,3 @@ this.views = node.views && node.views.slice(); | ||
var getParamVal = function (paramDef) { return [paramDef.id, paramDef.value(params[paramDef.id])]; }; | ||
this.paramValues = this.paramSchema.reduce(function (memo, pDef) { return common_1.applyPairs(memo, getParamVal(pDef)); }, {}); | ||
this.paramValues = this.paramSchema.reduce(function (memo, pDef) { return (0, common_1.applyPairs)(memo, getParamVal(pDef)); }, {}); | ||
return this; | ||
@@ -45,3 +45,3 @@ }; | ||
PathNode.prototype.parameter = function (name) { | ||
return common_1.find(this.paramSchema, hof_1.propEq('id', name)); | ||
return (0, common_1.find)(this.paramSchema, (0, hof_1.propEq)('id', name)); | ||
}; | ||
@@ -48,0 +48,0 @@ /** |
@@ -16,4 +16,4 @@ "use strict"; | ||
PathUtils.makeTargetState = function (registry, path) { | ||
var state = common_1.tail(path).state; | ||
return new targetState_1.TargetState(registry, state, path.map(hof_1.prop('paramValues')).reduce(common_1.mergeR, {}), {}); | ||
var state = (0, common_1.tail)(path).state; | ||
return new targetState_1.TargetState(registry, state, path.map((0, hof_1.prop)('paramValues')).reduce(common_1.mergeR, {}), {}); | ||
}; | ||
@@ -40,5 +40,5 @@ PathUtils.buildPath = function (targetState) { | ||
path | ||
.filter(function (node) { return common_1.inArray(states, node.state); }) | ||
.filter(function (node) { return (0, common_1.inArray)(states, node.state); }) | ||
.forEach(function (node) { | ||
var viewDecls = common_1.values(node.state.views || {}); | ||
var viewDecls = (0, common_1.values)(node.state.views || {}); | ||
var subPath = PathUtils.subPath(path, function (n) { return n === node; }); | ||
@@ -63,4 +63,4 @@ var viewConfigs = viewDecls.map(function (view) { return $view.createViewConfig(subPath, view); }); | ||
function nodeParamVals(path, state) { | ||
var node = common_1.find(path, hof_1.propEq('state', state)); | ||
return common_1.extend({}, node && node.paramValues); | ||
var node = (0, common_1.find)(path, (0, hof_1.propEq)('state', state)); | ||
return (0, common_1.extend)({}, node && node.paramValues); | ||
} | ||
@@ -71,3 +71,3 @@ var noInherit = fromPath | ||
.filter(function (param) { return !param.inherit; }) | ||
.map(hof_1.prop('id')); | ||
.map((0, hof_1.prop)('id')); | ||
/** | ||
@@ -79,9 +79,9 @@ * Given an [[PathNode]] "toNode", return a new [[PathNode]] with param values inherited from the | ||
// All param values for the node (may include default key/vals, when key was not found in toParams) | ||
var toParamVals = common_1.extend({}, toNode && toNode.paramValues); | ||
var toParamVals = (0, common_1.extend)({}, toNode && toNode.paramValues); | ||
// limited to only those keys found in toParams | ||
var incomingParamVals = common_1.pick(toParamVals, toKeys); | ||
toParamVals = common_1.omit(toParamVals, toKeys); | ||
var fromParamVals = common_1.omit(nodeParamVals(fromPath, toNode.state) || {}, noInherit); | ||
var incomingParamVals = (0, common_1.pick)(toParamVals, toKeys); | ||
toParamVals = (0, common_1.omit)(toParamVals, toKeys); | ||
var fromParamVals = (0, common_1.omit)(nodeParamVals(fromPath, toNode.state) || {}, noInherit); | ||
// extend toParamVals with any fromParamVals, then override any of those those with incomingParamVals | ||
var ownParamVals = common_1.extend(toParamVals, fromParamVals, incomingParamVals); | ||
var ownParamVals = (0, common_1.extend)(toParamVals, fromParamVals, incomingParamVals); | ||
return new pathNode_1.PathNode(toNode.state).applyRawParams(ownParamVals); | ||
@@ -135,3 +135,3 @@ } | ||
var done = false; | ||
var tuples = common_1.arrayTuples(pathA, pathB); | ||
var tuples = (0, common_1.arrayTuples)(pathA, pathB); | ||
return tuples.reduce(function (matching, _a) { | ||
@@ -165,3 +165,3 @@ var nodeA = _a[0], nodeB = _a[1]; | ||
PathUtils.subPath = function (path, predicate) { | ||
var node = common_1.find(path, predicate); | ||
var node = (0, common_1.find)(path, predicate); | ||
var elementIdx = path.indexOf(node); | ||
@@ -174,3 +174,3 @@ return elementIdx === -1 ? undefined : path.slice(0, elementIdx + 1); | ||
/** Gets the raw parameter values from a path */ | ||
PathUtils.paramValues = function (path) { return path.reduce(function (acc, node) { return common_1.extend(acc, node.paramValues); }, {}); }; | ||
PathUtils.paramValues = function (path) { return path.reduce(function (acc, node) { return (0, common_1.extend)(acc, node.paramValues); }, {}); }; | ||
return PathUtils; | ||
@@ -177,0 +177,0 @@ }()); |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -10,3 +14,3 @@ if (k2 === undefined) k2 = k; | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
@@ -13,0 +17,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -196,4 +196,4 @@ /** | ||
} | ||
export declare type PolicyWhen = 'LAZY' | 'EAGER'; | ||
export declare type PolicyAsync = 'WAIT' | 'NOWAIT' | CustomAsyncPolicy; | ||
export type PolicyWhen = 'LAZY' | 'EAGER'; | ||
export type PolicyAsync = 'WAIT' | 'NOWAIT' | CustomAsyncPolicy; | ||
export interface CustomAsyncPolicy { | ||
@@ -200,0 +200,0 @@ (data: any): Promise<any>; |
@@ -32,8 +32,8 @@ "use strict"; | ||
if (arg1 instanceof Resolvable) { | ||
common_1.extend(this, arg1); | ||
(0, common_1.extend)(this, arg1); | ||
} | ||
else if (predicates_1.isFunction(resolveFn)) { | ||
if (predicates_2.isNullOrUndefined(arg1)) | ||
else if ((0, predicates_1.isFunction)(resolveFn)) { | ||
if ((0, predicates_2.isNullOrUndefined)(arg1)) | ||
throw new Error('new Resolvable(): token argument is required'); | ||
if (!predicates_1.isFunction(resolveFn)) | ||
if (!(0, predicates_1.isFunction)(resolveFn)) | ||
throw new Error('new Resolvable(): resolveFn argument must be a function'); | ||
@@ -48,3 +48,3 @@ this.token = arg1; | ||
} | ||
else if (predicates_1.isObject(arg1) && arg1.token && (arg1.hasOwnProperty('resolveFn') || arg1.hasOwnProperty('data'))) { | ||
else if ((0, predicates_1.isObject)(arg1) && arg1.token && (arg1.hasOwnProperty('resolveFn') || arg1.hasOwnProperty('data'))) { | ||
var literal = arg1; | ||
@@ -81,3 +81,3 @@ return new Resolvable(literal.token, literal.resolveFn, literal.deps, literal.policy, literal.data); | ||
var asyncPolicy = this.getPolicy(state).async; | ||
var customAsyncPolicy = predicates_1.isFunction(asyncPolicy) ? asyncPolicy : common_1.identity; | ||
var customAsyncPolicy = (0, predicates_1.isFunction)(asyncPolicy) ? asyncPolicy : common_1.identity; | ||
// After the final value has been resolved, update the state of the Resolvable | ||
@@ -109,3 +109,3 @@ var applyResolvedValue = function (resolvedValue) { | ||
Resolvable.prototype.toString = function () { | ||
return "Resolvable(token: " + strings_1.stringify(this.token) + ", requires: [" + this.deps.map(strings_1.stringify) + "])"; | ||
return "Resolvable(token: ".concat((0, strings_1.stringify)(this.token), ", requires: [").concat(this.deps.map(strings_1.stringify), "])"); | ||
}; | ||
@@ -112,0 +112,0 @@ Resolvable.prototype.clone = function () { |
@@ -47,3 +47,3 @@ "use strict"; | ||
.filter(function (r) { return r.token === token; }); | ||
return common_1.tail(matching); | ||
return (0, common_1.tail)(matching); | ||
}; | ||
@@ -97,3 +97,3 @@ /** Returns the [[ResolvePolicy]] for the given [[Resolvable]] */ | ||
ResolveContext.prototype.addResolvables = function (newResolvables, state) { | ||
var node = common_1.find(this._path, hof_1.propEq('state', state)); | ||
var node = (0, common_1.find)(this._path, (0, hof_1.propEq)('state', state)); | ||
var keys = newResolvables.map(function (r) { return r.token; }); | ||
@@ -113,3 +113,3 @@ node.resolvables = node.resolvables.filter(function (r) { return keys.indexOf(r.token) === -1; }).concat(newResolvables); | ||
// This option determines which 'when' policy Resolvables we are about to fetch. | ||
var whenOption = common_1.inArray(ALL_WHENS, when) ? when : 'LAZY'; | ||
var whenOption = (0, common_1.inArray)(ALL_WHENS, when) ? when : 'LAZY'; | ||
// If the caller specified EAGER, only the EAGER Resolvables are fetched. | ||
@@ -121,3 +121,3 @@ // if the caller specified LAZY, both EAGER and LAZY Resolvables are fetched.` | ||
var matchesPolicy = function (acceptedVals, whenOrAsync) { return function (resolvable) { | ||
return common_1.inArray(acceptedVals, _this.getPolicy(resolvable)[whenOrAsync]); | ||
return (0, common_1.inArray)(acceptedVals, _this.getPolicy(resolvable)[whenOrAsync]); | ||
}; }; | ||
@@ -129,3 +129,3 @@ // Trigger all the (matching) Resolvables in the path | ||
var nowait = nodeResolvables.filter(matchesPolicy(['NOWAIT'], 'async')); | ||
var wait = nodeResolvables.filter(hof_1.not(matchesPolicy(['NOWAIT'], 'async'))); | ||
var wait = nodeResolvables.filter((0, hof_1.not)(matchesPolicy(['NOWAIT'], 'async'))); | ||
// For the matching Resolvables, start their async fetch process. | ||
@@ -149,3 +149,3 @@ var subContext = _this.subContext(node.state); | ||
ResolveContext.prototype.findNode = function (resolvable) { | ||
return common_1.find(this._path, function (node) { return common_1.inArray(node.resolvables, resolvable); }); | ||
return (0, common_1.find)(this._path, function (node) { return (0, common_1.inArray)(node.resolvables, resolvable); }); | ||
}; | ||
@@ -169,6 +169,6 @@ /** | ||
if (matching.length) | ||
return common_1.tail(matching); | ||
return (0, common_1.tail)(matching); | ||
var fromInjector = _this.injector().getNative(token); | ||
if (common_2.isUndefined(fromInjector)) { | ||
throw new Error('Could not find Dependency Injection token: ' + strings_1.stringify(token)); | ||
if ((0, common_2.isUndefined)(fromInjector)) { | ||
throw new Error('Could not find Dependency Injection token: ' + (0, strings_1.stringify)(token)); | ||
} | ||
@@ -195,3 +195,3 @@ return new resolvable_1.Resolvable(token, function () { return fromInjector; }, [], fromInjector); | ||
if (!resolvable.resolved) { | ||
throw new Error('Resolvable async .get() not complete:' + strings_1.stringify(resolvable.token)); | ||
throw new Error('Resolvable async .get() not complete:' + (0, strings_1.stringify)(resolvable.token)); | ||
} | ||
@@ -198,0 +198,0 @@ return resolvable.data; |
@@ -95,2 +95,2 @@ import { UrlMatcherFactory } from './url/urlMatcherFactory'; | ||
/** @internal */ | ||
export declare type PluginFactory<T> = (router: UIRouter, options?: any) => T; | ||
export type PluginFactory<T> = (router: UIRouter, options?: any) => T; |
@@ -23,5 +23,5 @@ "use strict"; | ||
/** @internal */ | ||
var locationServiceStub = common_2.makeStub('LocationServices', locSvcFns); | ||
var locationServiceStub = (0, common_2.makeStub)('LocationServices', locSvcFns); | ||
/** @internal */ | ||
var locationConfigStub = common_2.makeStub('LocationConfig', locCfgFns); | ||
var locationConfigStub = (0, common_2.makeStub)('LocationConfig', locCfgFns); | ||
/** | ||
@@ -102,3 +102,3 @@ * An instance of UI-Router. | ||
var _this = this; | ||
if (disposable && predicates_1.isFunction(disposable.dispose)) { | ||
if (disposable && (0, predicates_1.isFunction)(disposable.dispose)) { | ||
disposable.dispose(this); | ||
@@ -111,3 +111,3 @@ return undefined; | ||
typeof d.dispose === 'function' && d.dispose(_this); | ||
common_1.removeFrom(_this._disposables, d); | ||
(0, common_1.removeFrom)(_this._disposables, d); | ||
} | ||
@@ -179,3 +179,3 @@ catch (ignored) { } | ||
UIRouter.prototype.getPlugin = function (pluginName) { | ||
return pluginName ? this._plugins[pluginName] : common_1.values(this._plugins); | ||
return pluginName ? this._plugins[pluginName] : (0, common_1.values)(this._plugins); | ||
}; | ||
@@ -182,0 +182,0 @@ return UIRouter; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -10,3 +14,3 @@ if (k2 === undefined) k2 = k; | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
@@ -13,0 +17,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -10,3 +10,3 @@ import { ParamDeclaration, RawParams } from '../params/interface'; | ||
import { TargetState } from './targetState'; | ||
export declare type StateOrName = string | StateDeclaration | StateObject; | ||
export type StateOrName = string | StateDeclaration | StateObject; | ||
export interface TransitionPromise extends Promise<StateObject> { | ||
@@ -20,3 +20,3 @@ transition: Transition; | ||
} | ||
export declare type ResolveTypes = Resolvable | ResolvableLiteral | ProviderLike; | ||
export type ResolveTypes = Resolvable | ResolvableLiteral | ProviderLike; | ||
/** | ||
@@ -70,3 +70,3 @@ * Base interface for declaring a view | ||
*/ | ||
export declare type RedirectToResult = string | TargetState | { | ||
export type RedirectToResult = string | TargetState | { | ||
state?: string; | ||
@@ -709,4 +709,4 @@ params?: RawParams; | ||
*/ | ||
export declare type _StateDeclaration = StateDeclaration | { | ||
export type _StateDeclaration = StateDeclaration | { | ||
new (): StateDeclaration; | ||
}; |
@@ -15,3 +15,3 @@ import { StateObject } from './stateObject'; | ||
*/ | ||
export declare type BuilderFunction = (state: StateObject, parent?: BuilderFunction) => any; | ||
export type BuilderFunction = (state: StateObject, parent?: BuilderFunction) => any; | ||
/** | ||
@@ -18,0 +18,0 @@ * This is a [[StateBuilder.builder]] function for the `resolve:` block on a [[StateDeclaration]]. |
@@ -11,3 +11,3 @@ "use strict"; | ||
var parseUrl = function (url) { | ||
if (!predicates_1.isString(url)) | ||
if (!(0, predicates_1.isString)(url)) | ||
return false; | ||
@@ -26,3 +26,3 @@ var root = url.charAt(0) === '^'; | ||
if (state.parent && state.parent.data) { | ||
state.data = state.self.data = common_1.inherit(state.parent.data, state.data); | ||
state.data = state.self.data = (0, common_1.inherit)(state.parent.data, state.data); | ||
} | ||
@@ -38,3 +38,3 @@ return state.data; | ||
var newStateDec = {}; | ||
common_1.copy(stateDec, newStateDec); | ||
(0, common_1.copy)(stateDec, newStateDec); | ||
newStateDec.url += '{remainder:any}'; // match any path (.*) | ||
@@ -49,3 +49,3 @@ stateDec = newStateDec; | ||
if (!$urlMatcherFactoryProvider.isMatcher(url)) | ||
throw new Error("Invalid url '" + url + "' in state '" + stateObject + "'"); | ||
throw new Error("Invalid url '".concat(url, "' in state '").concat(stateObject, "'")); | ||
return parsed && parsed.root ? url : ((parent && parent.navigable) || root()).url.append(url); | ||
@@ -63,3 +63,3 @@ }; | ||
var urlParams = (state.url && state.url.parameters({ inherit: false })) || []; | ||
var nonUrlParams = common_1.values(common_1.mapObj(common_1.omit(state.params || {}, urlParams.map(hof_1.prop('id'))), makeConfigParam)); | ||
var nonUrlParams = (0, common_1.values)((0, common_1.mapObj)((0, common_1.omit)(state.params || {}, urlParams.map((0, hof_1.prop)('id'))), makeConfigParam)); | ||
return urlParams | ||
@@ -75,3 +75,3 @@ .concat(nonUrlParams) | ||
function includesBuilder(state) { | ||
var includes = state.parent ? common_1.extend({}, state.parent.includes) : {}; | ||
var includes = state.parent ? (0, common_1.extend)({}, state.parent.includes) : {}; | ||
includes[state.name] = true; | ||
@@ -147,3 +147,3 @@ return includes; | ||
var isTupleFromObj = function (obj) { | ||
return !!(obj && obj.val && (predicates_1.isString(obj.val) || predicates_1.isArray(obj.val) || predicates_1.isFunction(obj.val))); | ||
return !!(obj && obj.val && ((0, predicates_1.isString)(obj.val) || (0, predicates_1.isArray)(obj.val) || (0, predicates_1.isFunction)(obj.val))); | ||
}; | ||
@@ -153,22 +153,22 @@ /** extracts the token from a Provider or provide literal */ | ||
// prettier-ignore: Given a literal resolve or provider object, returns a Resolvable | ||
var literal2Resolvable = hof_1.pattern([ | ||
[hof_1.prop('resolveFn'), function (p) { return new resolvable_1.Resolvable(getToken(p), p.resolveFn, p.deps, p.policy); }], | ||
[hof_1.prop('useFactory'), function (p) { return new resolvable_1.Resolvable(getToken(p), p.useFactory, p.deps || p.dependencies, p.policy); }], | ||
[hof_1.prop('useClass'), function (p) { return new resolvable_1.Resolvable(getToken(p), function () { return new p.useClass(); }, [], p.policy); }], | ||
[hof_1.prop('useValue'), function (p) { return new resolvable_1.Resolvable(getToken(p), function () { return p.useValue; }, [], p.policy, p.useValue); }], | ||
[hof_1.prop('useExisting'), function (p) { return new resolvable_1.Resolvable(getToken(p), common_1.identity, [p.useExisting], p.policy); }], | ||
var literal2Resolvable = (0, hof_1.pattern)([ | ||
[(0, hof_1.prop)('resolveFn'), function (p) { return new resolvable_1.Resolvable(getToken(p), p.resolveFn, p.deps, p.policy); }], | ||
[(0, hof_1.prop)('useFactory'), function (p) { return new resolvable_1.Resolvable(getToken(p), p.useFactory, p.deps || p.dependencies, p.policy); }], | ||
[(0, hof_1.prop)('useClass'), function (p) { return new resolvable_1.Resolvable(getToken(p), function () { return new p.useClass(); }, [], p.policy); }], | ||
[(0, hof_1.prop)('useValue'), function (p) { return new resolvable_1.Resolvable(getToken(p), function () { return p.useValue; }, [], p.policy, p.useValue); }], | ||
[(0, hof_1.prop)('useExisting'), function (p) { return new resolvable_1.Resolvable(getToken(p), common_1.identity, [p.useExisting], p.policy); }], | ||
]); | ||
// prettier-ignore | ||
var tuple2Resolvable = hof_1.pattern([ | ||
[hof_1.pipe(hof_1.prop('val'), predicates_1.isString), function (tuple) { return new resolvable_1.Resolvable(tuple.token, common_1.identity, [tuple.val], tuple.policy); }], | ||
[hof_1.pipe(hof_1.prop('val'), predicates_1.isArray), function (tuple) { return new resolvable_1.Resolvable(tuple.token, common_1.tail(tuple.val), tuple.val.slice(0, -1), tuple.policy); }], | ||
[hof_1.pipe(hof_1.prop('val'), predicates_1.isFunction), function (tuple) { return new resolvable_1.Resolvable(tuple.token, tuple.val, annotate(tuple.val), tuple.policy); }], | ||
var tuple2Resolvable = (0, hof_1.pattern)([ | ||
[(0, hof_1.pipe)((0, hof_1.prop)('val'), predicates_1.isString), function (tuple) { return new resolvable_1.Resolvable(tuple.token, common_1.identity, [tuple.val], tuple.policy); }], | ||
[(0, hof_1.pipe)((0, hof_1.prop)('val'), predicates_1.isArray), function (tuple) { return new resolvable_1.Resolvable(tuple.token, (0, common_1.tail)(tuple.val), tuple.val.slice(0, -1), tuple.policy); }], | ||
[(0, hof_1.pipe)((0, hof_1.prop)('val'), predicates_1.isFunction), function (tuple) { return new resolvable_1.Resolvable(tuple.token, tuple.val, annotate(tuple.val), tuple.policy); }], | ||
]); | ||
// prettier-ignore | ||
var item2Resolvable = hof_1.pattern([ | ||
[hof_1.is(resolvable_1.Resolvable), function (r) { return r; }], | ||
var item2Resolvable = (0, hof_1.pattern)([ | ||
[(0, hof_1.is)(resolvable_1.Resolvable), function (r) { return r; }], | ||
[isResolveLiteral, literal2Resolvable], | ||
[isLikeNg2Provider, literal2Resolvable], | ||
[isTupleFromObj, tuple2Resolvable], | ||
[hof_1.val(true), function (obj) { throw new Error('Invalid resolve value: ' + strings_1.stringify(obj)); },], | ||
[(0, hof_1.val)(true), function (obj) { throw new Error('Invalid resolve value: ' + (0, strings_1.stringify)(obj)); },], | ||
]); | ||
@@ -178,3 +178,3 @@ // If resolveBlock is already an array, use it as-is. | ||
var decl = state.resolve; | ||
var items = predicates_1.isArray(decl) ? decl : objects2Tuples(decl, state.resolvePolicy || {}); | ||
var items = (0, predicates_1.isArray)(decl) ? decl : objects2Tuples(decl, state.resolvePolicy || {}); | ||
return items.map(item2Resolvable); | ||
@@ -230,5 +230,5 @@ } | ||
// Backwards compat: if only one builder exists, return it, else return whole arary. | ||
if (predicates_1.isString(name) && !predicates_1.isDefined(fn)) | ||
if ((0, predicates_1.isString)(name) && !(0, predicates_1.isDefined)(fn)) | ||
return array.length > 1 ? array : array[0]; | ||
if (!predicates_1.isString(name) || !predicates_1.isFunction(fn)) | ||
if (!(0, predicates_1.isString)(name) || !(0, predicates_1.isFunction)(fn)) | ||
return; | ||
@@ -272,3 +272,3 @@ builders[name] = array; | ||
if (state.parent) { | ||
throw new Error("States that specify the 'parent:' property should not have a '.' in their name (" + name + ")"); | ||
throw new Error("States that specify the 'parent:' property should not have a '.' in their name (".concat(name, ")")); | ||
} | ||
@@ -280,3 +280,3 @@ // 'foo.bar' | ||
return ''; | ||
return predicates_1.isString(state.parent) ? state.parent : state.parent.name; | ||
return (0, predicates_1.isString)(state.parent) ? state.parent : state.parent.name; | ||
}; | ||
@@ -287,3 +287,3 @@ StateBuilder.prototype.name = function (state) { | ||
return name; | ||
var parentName = predicates_1.isString(state.parent) ? state.parent : state.parent.name; | ||
var parentName = (0, predicates_1.isString)(state.parent) ? state.parent : state.parent.name; | ||
return parentName ? parentName + '.' + name : name; | ||
@@ -290,0 +290,0 @@ }; |
@@ -19,3 +19,3 @@ "use strict"; | ||
return undefined; | ||
var isStr = predicates_1.isString(stateOrName); | ||
var isStr = (0, predicates_1.isString)(stateOrName); | ||
var name = isStr ? stateOrName : stateOrName.name; | ||
@@ -29,6 +29,6 @@ if (this.isRelative(name)) | ||
else if (isStr && matchGlob) { | ||
var _states = common_1.values(this._states); | ||
var _states = (0, common_1.values)(this._states); | ||
var matches = _states.filter(function (_state) { return _state.__stateObjectCache.nameGlob && _state.__stateObjectCache.nameGlob.matches(name); }); | ||
if (matches.length > 1) { | ||
safeConsole_1.safeConsole.error("stateMatcher.find: Found multiple matches for " + name + " using glob: ", matches.map(function (match) { return match.name; })); | ||
safeConsole_1.safeConsole.error("stateMatcher.find: Found multiple matches for ".concat(name, " using glob: "), matches.map(function (match) { return match.name; })); | ||
} | ||
@@ -41,3 +41,3 @@ return matches[0]; | ||
if (!base) | ||
throw new Error("No reference point given for path '" + name + "'"); | ||
throw new Error("No reference point given for path '".concat(name, "'")); | ||
var baseState = this.find(base); | ||
@@ -54,3 +54,3 @@ var splitName = name.split('.'); | ||
if (!current.parent) | ||
throw new Error("Path '" + name + "' not valid for state '" + baseState.name + "'"); | ||
throw new Error("Path '".concat(name, "' not valid for state '").concat(baseState.name, "'")); | ||
current = current.parent; | ||
@@ -57,0 +57,0 @@ continue; |
@@ -33,7 +33,7 @@ "use strict"; | ||
stateDecl = StateObject.isStateClass(stateDecl) ? new stateDecl() : stateDecl; | ||
var state = common_1.inherit(common_1.inherit(stateDecl, StateObject.prototype)); | ||
var state = (0, common_1.inherit)((0, common_1.inherit)(stateDecl, StateObject.prototype)); | ||
stateDecl.$$state = function () { return state; }; | ||
state.self = stateDecl; | ||
state.__stateObjectCache = { | ||
nameGlob: glob_1.Glob.fromString(state.name), | ||
nameGlob: glob_1.Glob.fromString(state.name), // might return null | ||
}; | ||
@@ -84,6 +84,6 @@ return state; | ||
StateObject.prototype.parameters = function (opts) { | ||
opts = common_1.defaults(opts, { inherit: true, matchingKeys: null }); | ||
opts = (0, common_1.defaults)(opts, { inherit: true, matchingKeys: null }); | ||
var inherited = (opts.inherit && this.parent && this.parent.parameters()) || []; | ||
return inherited | ||
.concat(common_1.values(this.params)) | ||
.concat((0, common_1.values)(this.params)) | ||
.filter(function (param) { return !opts.matchingKeys || opts.matchingKeys.hasOwnProperty(param.id); }); | ||
@@ -101,3 +101,3 @@ }; | ||
return ((this.url && this.url.parameter(id, opts)) || | ||
common_1.find(common_1.values(this.params), hof_1.propEq('id', id)) || | ||
(0, common_1.find)((0, common_1.values)(this.params), (0, hof_1.propEq)('id', id)) || | ||
(opts.inherit && this.parent && this.parent.parameter(id))); | ||
@@ -110,8 +110,8 @@ }; | ||
StateObject.isStateClass = function (stateDecl) { | ||
return predicates_1.isFunction(stateDecl) && stateDecl['__uiRouterState'] === true; | ||
return (0, predicates_1.isFunction)(stateDecl) && stateDecl['__uiRouterState'] === true; | ||
}; | ||
/** Predicate which returns true if the object is a [[StateDeclaration]] object */ | ||
StateObject.isStateDeclaration = function (obj) { return predicates_1.isFunction(obj['$$state']); }; | ||
StateObject.isStateDeclaration = function (obj) { return (0, predicates_1.isFunction)(obj['$$state']); }; | ||
/** Predicate which returns true if the object is an internal [[StateObject]] object */ | ||
StateObject.isState = function (obj) { return predicates_1.isObject(obj['__stateObjectCache']); }; | ||
StateObject.isState = function (obj) { return (0, predicates_1.isObject)(obj['__stateObjectCache']); }; | ||
return StateObject; | ||
@@ -118,0 +118,0 @@ }()); |
@@ -21,6 +21,6 @@ "use strict"; | ||
var name = state.name; | ||
if (!common_1.isString(name)) | ||
if (!(0, common_1.isString)(name)) | ||
throw new Error('State must have a valid name'); | ||
if (this.states.hasOwnProperty(name) || common_1.inArray(queue.map(common_1.prop('name')), name)) | ||
throw new Error("State '" + name + "' is already defined"); | ||
if (this.states.hasOwnProperty(name) || (0, common_1.inArray)(queue.map((0, common_1.prop)('name')), name)) | ||
throw new Error("State '".concat(name, "' is already defined")); | ||
queue.push(state); | ||
@@ -52,3 +52,3 @@ this.flush(); | ||
if (existingState && existingState.name === name_1) { | ||
throw new Error("State '" + name_1 + "' is already defined"); | ||
throw new Error("State '".concat(name_1, "' is already defined")); | ||
} | ||
@@ -55,0 +55,0 @@ var existingFutureState = getState(name_1 + '.**'); |
@@ -16,3 +16,3 @@ import { StateObject } from './stateObject'; | ||
*/ | ||
export declare type StateRegistryListener = (event: 'registered' | 'deregistered', states: StateDeclaration[]) => void; | ||
export type StateRegistryListener = (event: 'registered' | 'deregistered', states: StateDeclaration[]) => void; | ||
/** | ||
@@ -19,0 +19,0 @@ * A registry for all of the application's [[StateDeclaration]]s |
@@ -80,3 +80,3 @@ "use strict"; | ||
return function deregisterListener() { | ||
common_1.removeFrom(this.listeners)(listener); | ||
(0, common_1.removeFrom)(this.listeners)(listener); | ||
}.bind(this); | ||
@@ -126,3 +126,3 @@ }; | ||
.rules() | ||
.filter(hof_1.propEq('state', _state)) | ||
.filter((0, hof_1.propEq)('state', _state)) | ||
.forEach(function (rule) { return rulesApi.removeRule(rule); }); | ||
@@ -129,0 +129,0 @@ // Remove state from registry |
@@ -10,3 +10,3 @@ import { HookResult, TransitionOptions } from '../transition/interface'; | ||
import { StateParams } from '../params/stateParams'; | ||
export declare type OnInvalidCallback = (toState?: TargetState, fromState?: TargetState, injector?: UIInjector) => HookResult; | ||
export type OnInvalidCallback = (toState?: TargetState, fromState?: TargetState, injector?: UIInjector) => HookResult; | ||
/** | ||
@@ -26,3 +26,3 @@ * Provides services related to ui-router states. | ||
*/ | ||
transition: Transition; | ||
get transition(): Transition; | ||
/** | ||
@@ -33,3 +33,3 @@ * The latest successful state parameters | ||
*/ | ||
params: StateParams; | ||
get params(): StateParams; | ||
/** | ||
@@ -40,3 +40,3 @@ * The current [[StateDeclaration]] | ||
*/ | ||
current: StateDeclaration; | ||
get current(): StateDeclaration; | ||
/** | ||
@@ -47,3 +47,3 @@ * The current [[StateObject]] (an internal API) | ||
*/ | ||
$current: StateObject; | ||
get $current(): StateObject; | ||
/** @internal */ | ||
@@ -50,0 +50,0 @@ constructor(/** @internal */ router: UIRouter); |
@@ -45,4 +45,4 @@ "use strict"; | ||
var getters = ['current', '$current', 'params', 'transition']; | ||
var boundFns = Object.keys(StateService.prototype).filter(hof_1.not(common_1.inArray(getters))); | ||
common_1.createProxyFunctions(hof_1.val(StateService.prototype), this, hof_1.val(this), boundFns); | ||
var boundFns = Object.keys(StateService.prototype).filter((0, hof_1.not)((0, common_1.inArray)(getters))); | ||
(0, common_1.createProxyFunctions)((0, hof_1.val)(StateService.prototype), this, (0, hof_1.val)(this), boundFns); | ||
} | ||
@@ -172,3 +172,3 @@ Object.defineProperty(StateService.prototype, "transition", { | ||
return function deregisterListener() { | ||
common_1.removeFrom(this.invalidCallbacks)(callback); | ||
(0, common_1.removeFrom)(this.invalidCallbacks)(callback); | ||
}.bind(this); | ||
@@ -222,3 +222,3 @@ }; | ||
return this.transitionTo(this.current, this.params, { | ||
reload: predicates_1.isDefined(reloadState) ? reloadState : true, | ||
reload: (0, predicates_1.isDefined)(reloadState) ? reloadState : true, | ||
inherit: false, | ||
@@ -270,3 +270,3 @@ notify: false, | ||
var defautGoOpts = { relative: this.$current, inherit: true }; | ||
var transOpts = common_1.defaults(options, defautGoOpts, transitionService_1.defaultTransOpts); | ||
var transOpts = (0, common_1.defaults)(options, defautGoOpts, transitionService_1.defaultTransOpts); | ||
return this.transitionTo(to, params, transOpts); | ||
@@ -284,3 +284,3 @@ }; | ||
// If we're reloading, find the state object to reload from | ||
if (predicates_1.isObject(options.reload) && !options.reload.name) | ||
if ((0, predicates_1.isObject)(options.reload) && !options.reload.name) | ||
throw new Error('Invalid reload state object'); | ||
@@ -291,3 +291,3 @@ var reg = this.router.stateRegistry; | ||
if (options.reload && !options.reloadState) | ||
throw new Error("No such reload state '" + (predicates_1.isString(options.reload) ? options.reload : options.reload.name) + "'"); | ||
throw new Error("No such reload state '".concat((0, predicates_1.isString)(options.reload) ? options.reload : options.reload.name, "'")); | ||
return new targetState_1.TargetState(this.router.stateRegistry, identifier, params, options); | ||
@@ -332,5 +332,5 @@ }; | ||
var globals = router.globals; | ||
options = common_1.defaults(options, transitionService_1.defaultTransOpts); | ||
options = (0, common_1.defaults)(options, transitionService_1.defaultTransOpts); | ||
var getCurrent = function () { return globals.transition; }; | ||
options = common_1.extend(options, { current: getCurrent }); | ||
options = (0, common_1.extend)(options, { current: getCurrent }); | ||
var ref = this.target(to, toParams, options); | ||
@@ -341,3 +341,3 @@ var currentPath = this.getCurrentPath(); | ||
if (!ref.valid()) | ||
return common_1.silentRejection(ref.error()); | ||
return (0, common_1.silentRejection)(ref.error()); | ||
if (options.supercede === false && getCurrent()) { | ||
@@ -381,5 +381,5 @@ return (rejectFactory_1.Rejection.ignored('Another transition is in progress and supercede has been set to false in TransitionOptions for the transition. So the transition was ignored in favour of the existing one in progress.').toPromise()); | ||
var transitionToPromise = transition.run().catch(rejectedTransitionHandler(transition)); | ||
common_1.silenceUncaughtInPromise(transitionToPromise); // issue #2676 | ||
(0, common_1.silenceUncaughtInPromise)(transitionToPromise); // issue #2676 | ||
// Return a promise for the transition, which also has the transition object on it. | ||
return common_1.extend(transitionToPromise, { transition: transition }); | ||
return (0, common_1.extend)(transitionToPromise, { transition: transition }); | ||
}; | ||
@@ -418,5 +418,5 @@ /** | ||
StateService.prototype.is = function (stateOrName, params, options) { | ||
options = common_1.defaults(options, { relative: this.$current }); | ||
options = (0, common_1.defaults)(options, { relative: this.$current }); | ||
var state = this.router.stateRegistry.matcher.find(stateOrName, options.relative); | ||
if (!predicates_1.isDefined(state)) | ||
if (!(0, predicates_1.isDefined)(state)) | ||
return undefined; | ||
@@ -469,4 +469,4 @@ if (this.$current !== state) | ||
StateService.prototype.includes = function (stateOrName, params, options) { | ||
options = common_1.defaults(options, { relative: this.$current }); | ||
var glob = predicates_1.isString(stateOrName) && glob_1.Glob.fromString(stateOrName); | ||
options = (0, common_1.defaults)(options, { relative: this.$current }); | ||
var glob = (0, predicates_1.isString)(stateOrName) && glob_1.Glob.fromString(stateOrName); | ||
if (glob) { | ||
@@ -478,5 +478,5 @@ if (!glob.matches(this.$current.name)) | ||
var state = this.router.stateRegistry.matcher.find(stateOrName, options.relative), include = this.$current.includes; | ||
if (!predicates_1.isDefined(state)) | ||
if (!(0, predicates_1.isDefined)(state)) | ||
return undefined; | ||
if (!predicates_1.isDefined(include[state.name])) | ||
if (!(0, predicates_1.isDefined)(include[state.name])) | ||
return false; | ||
@@ -511,6 +511,6 @@ if (!params) | ||
}; | ||
options = common_1.defaults(options, defaultHrefOpts); | ||
options = (0, common_1.defaults)(options, defaultHrefOpts); | ||
params = params || {}; | ||
var state = this.router.stateRegistry.matcher.find(stateOrName, options.relative); | ||
if (!predicates_1.isDefined(state)) | ||
if (!(0, predicates_1.isDefined)(state)) | ||
return null; | ||
@@ -577,3 +577,3 @@ if (options.inherit) | ||
transition = transition || this.router.transitionService.create(currentPath, target); | ||
return lazyLoad_1.lazyLoadState(transition, state); | ||
return (0, lazyLoad_1.lazyLoadState)(transition, state); | ||
}; | ||
@@ -580,0 +580,0 @@ return StateService; |
@@ -55,4 +55,4 @@ "use strict"; | ||
this._identifier = _identifier; | ||
this._params = common_1.extend({}, _params || {}); | ||
this._options = common_1.extend({}, _options || {}); | ||
this._params = (0, common_1.extend)({}, _params || {}); | ||
this._options = (0, common_1.extend)({}, _options || {}); | ||
this._definition = _stateRegistry.matcher.find(_identifier, this._options.relative); | ||
@@ -97,11 +97,11 @@ } | ||
var stateName = base.name ? base.name : base; | ||
return "Could not resolve '" + this.name() + "' from state '" + stateName + "'"; | ||
return "Could not resolve '".concat(this.name(), "' from state '").concat(stateName, "'"); | ||
} | ||
if (!this._definition) | ||
return "No such state '" + this.name() + "'"; | ||
return "No such state '".concat(this.name(), "'"); | ||
if (!this._definition.self) | ||
return "State '" + this.name() + "' has an invalid definition"; | ||
return "State '".concat(this.name(), "' has an invalid definition"); | ||
}; | ||
TargetState.prototype.toString = function () { | ||
return "'" + this.name() + "'" + strings_1.stringify(this.params()); | ||
return "'".concat(this.name(), "'").concat((0, strings_1.stringify)(this.params())); | ||
}; | ||
@@ -126,3 +126,3 @@ /** | ||
if (replace === void 0) { replace = false; } | ||
var newParams = replace ? params : common_1.extend({}, this._params, params); | ||
var newParams = replace ? params : (0, common_1.extend)({}, this._params, params); | ||
return new TargetState(this._stateRegistry, this._identifier, newParams, this._options); | ||
@@ -139,3 +139,3 @@ }; | ||
if (replace === void 0) { replace = false; } | ||
var newOpts = replace ? options : common_1.extend({}, this._options, options); | ||
var newOpts = replace ? options : (0, common_1.extend)({}, this._options, options); | ||
return new TargetState(this._stateRegistry, this._identifier, this._params, newOpts); | ||
@@ -145,3 +145,3 @@ }; | ||
TargetState.isDef = function (obj) { | ||
return obj && obj.state && (predicates_1.isString(obj.state) || (predicates_1.isObject(obj.state) && predicates_1.isString(obj.state.name))); | ||
return obj && obj.state && ((0, predicates_1.isString)(obj.state) || ((0, predicates_1.isObject)(obj.state) && (0, predicates_1.isString)(obj.state.name))); | ||
}; | ||
@@ -148,0 +148,0 @@ return TargetState; |
@@ -61,3 +61,3 @@ "use strict"; | ||
return matchingNodes.map(function (node) { | ||
var _options = common_1.extend({ | ||
var _options = (0, common_1.extend)({ | ||
bind: hook.bind, | ||
@@ -95,3 +95,3 @@ traceData: { hookType: hookType.name, context: node }, | ||
.map(function (reg) { return reg.getHooks(hookType.name); }) // Get named hooks from registries | ||
.filter(common_1.assertPredicate(predicates_1.isArray, "broken event named: " + hookType.name)) // Sanity check | ||
.filter((0, common_1.assertPredicate)(predicates_1.isArray, "broken event named: ".concat(hookType.name))) // Sanity check | ||
.reduce(common_1.unnestR, []) // Un-nest RegisteredHook[][] to RegisteredHook[] array | ||
@@ -98,0 +98,0 @@ .filter(function (hook) { return hook.matches(treeChanges, transition); }); // Only those satisfying matchCriteria |
@@ -20,3 +20,3 @@ "use strict"; | ||
function matchState(state, criterion, transition) { | ||
var toMatch = common_1.isString(criterion) ? [criterion] : criterion; | ||
var toMatch = (0, common_1.isString)(criterion) ? [criterion] : criterion; | ||
function matchGlobs(_state) { | ||
@@ -32,3 +32,3 @@ var globStrings = toMatch; | ||
} | ||
var matchFn = (common_1.isFunction(toMatch) ? toMatch : matchGlobs); | ||
var matchFn = ((0, common_1.isFunction)(toMatch) ? toMatch : matchGlobs); | ||
return !!matchFn(state, transition); | ||
@@ -90,3 +90,3 @@ } | ||
RegisteredHook.prototype._getDefaultMatchCriteria = function () { | ||
return common_1.mapObj(this.tranSvc._pluginapi._getPathTypes(), function () { return true; }); | ||
return (0, common_1.mapObj)(this.tranSvc._pluginapi._getPathTypes(), function () { return true; }); | ||
}; | ||
@@ -110,4 +110,4 @@ /** | ||
var _this = this; | ||
var criteria = common_1.extend(this._getDefaultMatchCriteria(), this.matchCriteria); | ||
var paths = common_1.values(this.tranSvc._pluginapi._getPathTypes()); | ||
var criteria = (0, common_1.extend)(this._getDefaultMatchCriteria(), this.matchCriteria); | ||
var paths = (0, common_1.values)(this.tranSvc._pluginapi._getPathTypes()); | ||
return paths.reduce(function (mn, pathtype) { | ||
@@ -118,3 +118,3 @@ // STATE scope criteria matches against every node in the path. | ||
var path = treeChanges[pathtype.name] || []; | ||
var nodes = isStateHook ? path : [common_1.tail(path)]; | ||
var nodes = isStateHook ? path : [(0, common_1.tail)(path)]; | ||
mn[pathtype.name] = _this._matchingNodes(nodes, criteria[pathtype.name], transition); | ||
@@ -133,3 +133,3 @@ return mn; | ||
// Check if all the criteria matched the TreeChanges object | ||
var allMatched = common_1.values(matches).every(common_1.identity); | ||
var allMatched = (0, common_1.values)(matches).every(common_1.identity); | ||
return allMatched ? matches : null; | ||
@@ -149,3 +149,3 @@ }; | ||
var hooks = (_registeredHooks[eventType.name] = []); | ||
var removeHookFn = common_1.removeFrom(hooks); | ||
var removeHookFn = (0, common_1.removeFrom)(hooks); | ||
// Create hook registration function on the IHookRegistry for the event | ||
@@ -152,0 +152,0 @@ registry[eventType.name] = hookRegistrationFn; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -10,3 +14,3 @@ if (k2 === undefined) k2 = k; | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
@@ -13,0 +17,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -165,3 +165,3 @@ import { StateDeclaration } from '../state/interface'; | ||
} | ||
export declare type IHookRegistration = (matchCriteria: HookMatchCriteria, callback: HookFn, options?: HookRegOptions) => Function; | ||
export type IHookRegistration = (matchCriteria: HookMatchCriteria, callback: HookFn, options?: HookRegOptions) => Function; | ||
/** | ||
@@ -229,3 +229,3 @@ * The signature for Transition Hooks. | ||
} | ||
export declare type HookFn = TransitionHookFn | TransitionStateHookFn | TransitionCreateHookFn; | ||
export type HookFn = TransitionHookFn | TransitionStateHookFn | TransitionCreateHookFn; | ||
/** | ||
@@ -244,3 +244,3 @@ * The return value of a [[TransitionHookFn]] or [[TransitionStateHookFn]] | ||
*/ | ||
export declare type HookResult = boolean | TargetState | void | Promise<boolean | TargetState | void>; | ||
export type HookResult = boolean | TargetState | void | Promise<boolean | TargetState | void>; | ||
/** | ||
@@ -697,3 +697,3 @@ * These options may be provided when registering a Transition Hook (such as `onStart`) | ||
/** A predicate type which tests if a [[StateObject]] and [[Transition]] passes some test. Returns a boolean. */ | ||
export declare type IStateMatch = PredicateBinary<StateObject, Transition>; | ||
export type IStateMatch = PredicateBinary<StateObject, Transition>; | ||
/** | ||
@@ -811,3 +811,3 @@ * This object is used to configure whether or not a Transition Hook is invoked for a particular transition, | ||
*/ | ||
export declare type HookMatchCriterion = string | IStateMatch | boolean; | ||
export type HookMatchCriterion = string | IStateMatch | boolean; | ||
declare enum TransitionHookPhase { | ||
@@ -814,0 +814,0 @@ CREATE = 0, |
@@ -11,4 +11,3 @@ "use strict"; | ||
TransitionHookPhase[TransitionHookPhase["ERROR"] = 4] = "ERROR"; | ||
})(TransitionHookPhase || (TransitionHookPhase = {})); | ||
exports.TransitionHookPhase = TransitionHookPhase; | ||
})(TransitionHookPhase || (exports.TransitionHookPhase = TransitionHookPhase = {})); | ||
var TransitionHookScope; | ||
@@ -18,4 +17,3 @@ (function (TransitionHookScope) { | ||
TransitionHookScope[TransitionHookScope["STATE"] = 1] = "STATE"; | ||
})(TransitionHookScope || (TransitionHookScope = {})); | ||
exports.TransitionHookScope = TransitionHookScope; | ||
})(TransitionHookScope || (exports.TransitionHookScope = TransitionHookScope = {})); | ||
//# sourceMappingURL=interface.js.map |
@@ -46,4 +46,3 @@ 'use strict'; | ||
RejectType[RejectType["ERROR"] = 6] = "ERROR"; | ||
})(RejectType || (RejectType = {})); | ||
exports.RejectType = RejectType; | ||
})(RejectType || (exports.RejectType = RejectType = {})); | ||
/** @internal */ | ||
@@ -61,3 +60,3 @@ var id = 0; | ||
Rejection.isRejectionPromise = function (obj) { | ||
return obj && typeof obj.then === 'function' && hof_1.is(Rejection)(obj._transitionRejection); | ||
return obj && typeof obj.then === 'function' && (0, hof_1.is)(Rejection)(obj._transitionRejection); | ||
}; | ||
@@ -107,12 +106,12 @@ /** Returns a Rejection due to transition superseded */ | ||
Rejection.normalize = function (detail) { | ||
return hof_1.is(Rejection)(detail) ? detail : Rejection.errored(detail); | ||
return (0, hof_1.is)(Rejection)(detail) ? detail : Rejection.errored(detail); | ||
}; | ||
Rejection.prototype.toString = function () { | ||
var detailString = function (d) { return (d && d.toString !== Object.prototype.toString ? d.toString() : strings_1.stringify(d)); }; | ||
var detailString = function (d) { return (d && d.toString !== Object.prototype.toString ? d.toString() : (0, strings_1.stringify)(d)); }; | ||
var detail = detailString(this.detail); | ||
var _a = this, $id = _a.$id, type = _a.type, message = _a.message; | ||
return "Transition Rejection($id: " + $id + " type: " + type + ", message: " + message + ", detail: " + detail + ")"; | ||
return "Transition Rejection($id: ".concat($id, " type: ").concat(type, ", message: ").concat(message, ", detail: ").concat(detail, ")"); | ||
}; | ||
Rejection.prototype.toPromise = function () { | ||
return common_1.extend(common_1.silentRejection(this), { _transitionRejection: this }); | ||
return (0, common_1.extend)((0, common_1.silentRejection)(this), { _transitionRejection: this }); | ||
}; | ||
@@ -119,0 +118,0 @@ return Rejection; |
@@ -21,3 +21,3 @@ "use strict"; | ||
/** @internal */ | ||
var stateSelf = hof_1.prop('self'); | ||
var stateSelf = (0, hof_1.prop)('self'); | ||
/** | ||
@@ -68,3 +68,3 @@ * Represents a transition between two states. | ||
// current() is assumed to come from targetState.options, but provide a naive implementation otherwise. | ||
this._options = common_1.extend({ current: hof_1.val(this) }, targetState.options()); | ||
this._options = (0, common_1.extend)({ current: (0, hof_1.val)(this) }, targetState.options()); | ||
this.$id = router.transitionService._transitionCount++; | ||
@@ -119,3 +119,3 @@ var toPath = pathUtils_1.PathUtils.buildToPath(fromPath, targetState); | ||
.filter(function (type) { return type.hookPhase !== interface_1.TransitionHookPhase.CREATE; }) | ||
.forEach(function (type) { return hookRegistry_1.makeEvent(_this, _this.router.transitionService, type); }); | ||
.forEach(function (type) { return (0, hookRegistry_1.makeEvent)(_this, _this.router.transitionService, type); }); | ||
}; | ||
@@ -135,3 +135,3 @@ /** @internal */ | ||
Transition.prototype.$from = function () { | ||
return common_1.tail(this._treeChanges.from).state; | ||
return (0, common_1.tail)(this._treeChanges.from).state; | ||
}; | ||
@@ -143,3 +143,3 @@ /** | ||
Transition.prototype.$to = function () { | ||
return common_1.tail(this._treeChanges.to).state; | ||
return (0, common_1.tail)(this._treeChanges.to).state; | ||
}; | ||
@@ -185,8 +185,8 @@ /** | ||
} | ||
return !((compare.to && !hookRegistry_1.matchState(this.$to(), compare.to, this)) || | ||
(compare.from && !hookRegistry_1.matchState(this.$from(), compare.from, this))); | ||
return !((compare.to && !(0, hookRegistry_1.matchState)(this.$to(), compare.to, this)) || | ||
(compare.from && !(0, hookRegistry_1.matchState)(this.$from(), compare.from, this))); | ||
}; | ||
Transition.prototype.params = function (pathname) { | ||
if (pathname === void 0) { pathname = 'to'; } | ||
return Object.freeze(this._treeChanges[pathname].map(hof_1.prop('paramValues')).reduce(common_1.mergeR, {})); | ||
return Object.freeze(this._treeChanges[pathname].map((0, hof_1.prop)('paramValues')).reduce(common_1.mergeR, {})); | ||
}; | ||
@@ -338,6 +338,6 @@ Transition.prototype.paramsChanged = function () { | ||
if (state === void 0) { state = ''; } | ||
resolvable = hof_1.is(resolvable_1.Resolvable)(resolvable) ? resolvable : new resolvable_1.Resolvable(resolvable); | ||
resolvable = (0, hof_1.is)(resolvable_1.Resolvable)(resolvable) ? resolvable : new resolvable_1.Resolvable(resolvable); | ||
var stateName = typeof state === 'string' ? state : state.name; | ||
var topath = this._treeChanges.to; | ||
var targetNode = common_1.find(topath, function (node) { return node.state.name === stateName; }); | ||
var targetNode = (0, common_1.find)(topath, function (node) { return node.state.name === stateName; }); | ||
var resolveContext = new resolveContext_1.ResolveContext(topath); | ||
@@ -410,3 +410,3 @@ resolveContext.addResolvables([resolvable], targetNode.state); | ||
Transition.prototype.entering = function () { | ||
return common_1.map(this._treeChanges.entering, hof_1.prop('state')).map(stateSelf); | ||
return (0, common_1.map)(this._treeChanges.entering, (0, hof_1.prop)('state')).map(stateSelf); | ||
}; | ||
@@ -419,3 +419,3 @@ /** | ||
Transition.prototype.exiting = function () { | ||
return common_1.map(this._treeChanges.exiting, hof_1.prop('state')).map(stateSelf).reverse(); | ||
return (0, common_1.map)(this._treeChanges.exiting, (0, hof_1.prop)('state')).map(stateSelf).reverse(); | ||
}; | ||
@@ -429,3 +429,3 @@ /** | ||
Transition.prototype.retained = function () { | ||
return common_1.map(this._treeChanges.retained, hof_1.prop('state')).map(stateSelf); | ||
return (0, common_1.map)(this._treeChanges.retained, (0, hof_1.prop)('state')).map(stateSelf); | ||
}; | ||
@@ -447,4 +447,4 @@ /** | ||
var path = this._treeChanges[pathname]; | ||
path = !state ? path : path.filter(hof_1.propEq('state', state)); | ||
return path.map(hof_1.prop('views')).filter(common_1.identity).reduce(common_1.unnestR, []); | ||
path = !state ? path : path.filter((0, hof_1.propEq)('state', state)); | ||
return path.map((0, hof_1.prop)('views')).filter(common_1.identity).reduce(common_1.unnestR, []); | ||
}; | ||
@@ -479,3 +479,3 @@ Transition.prototype.treeChanges = function (pathname) { | ||
} | ||
var newOptions = common_1.extend({}, this.options(), targetState.options(), redirectOpts); | ||
var newOptions = (0, common_1.extend)({}, this.options(), targetState.options(), redirectOpts); | ||
targetState = targetState.withOptions(newOptions, true); | ||
@@ -498,3 +498,3 @@ var newTransition = this.router.transitionService.create(this._treeChanges.from, targetState); | ||
// Find any "entering" nodes in the redirect path that match the original path and aren't being reloaded | ||
var matchingEnteringNodes = pathUtils_1.PathUtils.matching(redirectEnteringNodes, originalEnteringNodes, pathUtils_1.PathUtils.nonDynamicParams).filter(hof_1.not(nodeIsReloading(targetState.options().reloadState))); | ||
var matchingEnteringNodes = pathUtils_1.PathUtils.matching(redirectEnteringNodes, originalEnteringNodes, pathUtils_1.PathUtils.nonDynamicParams).filter((0, hof_1.not)(nodeIsReloading(targetState.options().reloadState))); | ||
// Use the existing (possibly pre-resolved) resolvables for the matching entering nodes. | ||
@@ -520,3 +520,3 @@ matchingEnteringNodes.forEach(function (node, idx) { | ||
// If the to/from paths are different | ||
var pathsDiffer = common_1.arrayTuples(tc.to, tc.from) | ||
var pathsDiffer = (0, common_1.arrayTuples)(tc.to, tc.from) | ||
.map(function (tuple) { return tuple[0].state !== tuple[1].state; }) | ||
@@ -529,3 +529,3 @@ .reduce(common_1.anyTrueR, false); | ||
var _a = [tc.to, tc.from].map(function (path) { return path.map(function (x) { return x.paramValues; }); }), toValues = _a[0], fromValues = _a[1]; | ||
var tuples = common_1.arrayTuples(nodeSchemas, toValues, fromValues); | ||
var tuples = (0, common_1.arrayTuples)(nodeSchemas, toValues, fromValues); | ||
return tuples.map(function (_a) { | ||
@@ -639,3 +639,3 @@ var schema = _a[0], toVals = _a[1], fromVals = _a[2]; | ||
// Do not set flag if the transition is already complete | ||
if (predicates_1.isUndefined(this.success)) { | ||
if ((0, predicates_1.isUndefined)(this.success)) { | ||
this._aborted = true; | ||
@@ -655,3 +655,3 @@ } | ||
if (state.self.abstract) { | ||
return rejectFactory_1.Rejection.invalid("Cannot transition to abstract state '" + state.name + "'"); | ||
return rejectFactory_1.Rejection.invalid("Cannot transition to abstract state '".concat(state.name, "'")); | ||
} | ||
@@ -662,4 +662,4 @@ var paramDefs = state.parameters(); | ||
if (invalidParams.length) { | ||
var invalidValues = invalidParams.map(function (param) { return "[" + param.id + ":" + strings_1.stringify(values[param.id]) + "]"; }).join(', '); | ||
var detail = "The following parameter values are not valid for state '" + state.name + "': " + invalidValues; | ||
var invalidValues = invalidParams.map(function (param) { return "[".concat(param.id, ":").concat((0, strings_1.stringify)(values[param.id]), "]"); }).join(', '); | ||
var detail = "The following parameter values are not valid for state '".concat(state.name, "': ").concat(invalidValues); | ||
return rejectFactory_1.Rejection.invalid(detail); | ||
@@ -679,7 +679,7 @@ } | ||
var avoidEmptyHash = function (params) { | ||
return params['#'] !== null && params['#'] !== undefined ? params : common_1.omit(params, ['#']); | ||
return params['#'] !== null && params['#'] !== undefined ? params : (0, common_1.omit)(params, ['#']); | ||
}; | ||
// (X) means the to state is invalid. | ||
var id = this.$id, from = predicates_1.isObject(fromStateOrName) ? fromStateOrName.name : fromStateOrName, fromParams = strings_1.stringify(avoidEmptyHash(this._treeChanges.from.map(hof_1.prop('paramValues')).reduce(common_1.mergeR, {}))), toValid = this.valid() ? '' : '(X) ', to = predicates_1.isObject(toStateOrName) ? toStateOrName.name : toStateOrName, toParams = strings_1.stringify(avoidEmptyHash(this.params())); | ||
return "Transition#" + id + "( '" + from + "'" + fromParams + " -> " + toValid + "'" + to + "'" + toParams + " )"; | ||
var id = this.$id, from = (0, predicates_1.isObject)(fromStateOrName) ? fromStateOrName.name : fromStateOrName, fromParams = (0, strings_1.stringify)(avoidEmptyHash(this._treeChanges.from.map((0, hof_1.prop)('paramValues')).reduce(common_1.mergeR, {}))), toValid = this.valid() ? '' : '(X) ', to = (0, predicates_1.isObject)(toStateOrName) ? toStateOrName.name : toStateOrName, toParams = (0, strings_1.stringify)(avoidEmptyHash(this.params())); | ||
return "Transition#".concat(id, "( '").concat(from, "'").concat(fromParams, " -> ").concat(toValid, "'").concat(to, "'").concat(toParams, " )"); | ||
}; | ||
@@ -686,0 +686,0 @@ /** @internal */ |
@@ -6,6 +6,6 @@ import { TransitionHookOptions, HookResult } from './interface'; | ||
import { StateDeclaration } from '../state/interface'; | ||
export declare type GetResultHandler = (hook: TransitionHook) => ResultHandler; | ||
export declare type GetErrorHandler = (hook: TransitionHook) => ErrorHandler; | ||
export declare type ResultHandler = (result: HookResult) => Promise<HookResult>; | ||
export declare type ErrorHandler = (error: any) => Promise<any>; | ||
export type GetResultHandler = (hook: TransitionHook) => ResultHandler; | ||
export type GetErrorHandler = (hook: TransitionHook) => ErrorHandler; | ||
export type ResultHandler = (result: HookResult) => Promise<HookResult>; | ||
export type ErrorHandler = (error: any) => Promise<any>; | ||
export declare class TransitionHook { | ||
@@ -12,0 +12,0 @@ private transition; |
@@ -27,3 +27,3 @@ "use strict"; | ||
this.isSuperseded = function () { return _this.type.hookPhase === interface_1.TransitionHookPhase.RUN && !_this.options.transition.isActive(); }; | ||
this.options = common_1.defaults(options, defaultOptions); | ||
this.options = (0, common_1.defaults)(options, defaultOptions); | ||
this.type = registeredHook.eventType; | ||
@@ -68,3 +68,3 @@ } | ||
var hookResult = hooks[idx].invokeHook(); | ||
if (predicates_1.isPromise(hookResult)) { | ||
if ((0, predicates_1.isPromise)(hookResult)) { | ||
var remainingHooks = hooks.slice(idx + 1); | ||
@@ -101,3 +101,3 @@ return TransitionHook.chain(remainingHooks, hookResult).then(doneCallback); | ||
var result = invokeCallback(); | ||
if (!this.type.synchronous && predicates_1.isPromise(result)) { | ||
if (!this.type.synchronous && (0, predicates_1.isPromise)(result)) { | ||
return result.catch(normalizeErr).then(handleResult, handleError); | ||
@@ -134,3 +134,3 @@ } | ||
// Hook returned a promise | ||
if (predicates_1.isPromise(result)) { | ||
if ((0, predicates_1.isPromise)(result)) { | ||
// Wait for the promise, then reprocess with the resulting value | ||
@@ -145,3 +145,3 @@ return result.then(function (val) { return _this.handleHookResult(val); }); | ||
} | ||
var isTargetState = hof_1.is(targetState_1.TargetState); | ||
var isTargetState = (0, hof_1.is)(targetState_1.TargetState); | ||
// hook returned a TargetState | ||
@@ -161,3 +161,3 @@ if (isTargetState(result)) { | ||
if (router._disposed) { | ||
return rejectFactory_1.Rejection.aborted("UIRouter instance #" + router.$id + " has been stopped (disposed)").toPromise(); | ||
return rejectFactory_1.Rejection.aborted("UIRouter instance #".concat(router.$id, " has been stopped (disposed)")).toPromise(); | ||
} | ||
@@ -176,4 +176,4 @@ if (this.transition._aborted) { | ||
var _a = this, options = _a.options, registeredHook = _a.registeredHook; | ||
var event = hof_1.parse('traceData.hookType')(options) || 'internal', context = hof_1.parse('traceData.context.state.name')(options) || hof_1.parse('traceData.context')(options) || 'unknown', name = strings_1.fnToString(registeredHook.callback); | ||
return event + " context: " + context + ", " + strings_1.maxLength(200, name); | ||
var event = (0, hof_1.parse)('traceData.hookType')(options) || 'internal', context = (0, hof_1.parse)('traceData.context.state.name')(options) || (0, hof_1.parse)('traceData.context')(options) || 'unknown', name = (0, strings_1.fnToString)(registeredHook.callback); | ||
return "".concat(event, " context: ").concat(context, ", ").concat((0, strings_1.maxLength)(200, name)); | ||
}; | ||
@@ -192,3 +192,3 @@ /** | ||
TransitionHook.LOG_REJECTED_RESULT = function (hook) { return function (result) { | ||
predicates_1.isPromise(result) && result.catch(function (err) { return hook.logError(rejectFactory_1.Rejection.normalize(err)); }); | ||
(0, predicates_1.isPromise)(result) && result.catch(function (err) { return hook.logError(rejectFactory_1.Rejection.normalize(err)); }); | ||
return undefined; | ||
@@ -201,3 +201,3 @@ }; }; | ||
TransitionHook.LOG_ERROR = function (hook) { return function (error) { return hook.logError(error); }; }; | ||
TransitionHook.REJECT_ERROR = function (hook) { return function (error) { return common_1.silentRejection(error); }; }; | ||
TransitionHook.REJECT_ERROR = function (hook) { return function (error) { return (0, common_1.silentRejection)(error); }; }; | ||
TransitionHook.THROW_ERROR = function (hook) { return function (error) { | ||
@@ -204,0 +204,0 @@ throw error; |
@@ -65,3 +65,3 @@ "use strict"; | ||
this._deregisterHookFns = {}; | ||
this._pluginapi = (common_1.createProxyFunctions(hof_1.val(this), {}, hof_1.val(this), [ | ||
this._pluginapi = ((0, common_1.createProxyFunctions)((0, hof_1.val)(this), {}, (0, hof_1.val)(this), [ | ||
'_definePathType', | ||
@@ -141,6 +141,6 @@ '_defineEvent', | ||
TransitionService.prototype.dispose = function (router) { | ||
common_1.values(this._registeredHooks).forEach(function (hooksArray) { | ||
(0, common_1.values)(this._registeredHooks).forEach(function (hooksArray) { | ||
return hooksArray.forEach(function (hook) { | ||
hook._deregistered = true; | ||
common_1.removeFrom(hooksArray, hook); | ||
(0, common_1.removeFrom)(hooksArray, hook); | ||
}); | ||
@@ -197,7 +197,7 @@ }); | ||
this._eventTypes.push(eventType); | ||
hookRegistry_1.makeEvent(this, this, eventType); | ||
(0, hookRegistry_1.makeEvent)(this, this, eventType); | ||
}; | ||
/** @internal */ | ||
TransitionService.prototype._getEvents = function (phase) { | ||
var transitionHookTypes = predicates_1.isDefined(phase) | ||
var transitionHookTypes = (0, predicates_1.isDefined)(phase) | ||
? this._eventTypes.filter(function (type) { return type.hookPhase === phase; }) | ||
@@ -238,24 +238,24 @@ : this._eventTypes.slice(); | ||
var fns = this._deregisterHookFns; | ||
fns.addCoreResolves = coreResolvables_1.registerAddCoreResolvables(this); | ||
fns.ignored = ignoredTransition_1.registerIgnoredTransitionHook(this); | ||
fns.invalid = invalidTransition_1.registerInvalidTransitionHook(this); | ||
fns.addCoreResolves = (0, coreResolvables_1.registerAddCoreResolvables)(this); | ||
fns.ignored = (0, ignoredTransition_1.registerIgnoredTransitionHook)(this); | ||
fns.invalid = (0, invalidTransition_1.registerInvalidTransitionHook)(this); | ||
// Wire up redirectTo hook | ||
fns.redirectTo = redirectTo_1.registerRedirectToHook(this); | ||
fns.redirectTo = (0, redirectTo_1.registerRedirectToHook)(this); | ||
// Wire up onExit/Retain/Enter state hooks | ||
fns.onExit = onEnterExitRetain_1.registerOnExitHook(this); | ||
fns.onRetain = onEnterExitRetain_1.registerOnRetainHook(this); | ||
fns.onEnter = onEnterExitRetain_1.registerOnEnterHook(this); | ||
fns.onExit = (0, onEnterExitRetain_1.registerOnExitHook)(this); | ||
fns.onRetain = (0, onEnterExitRetain_1.registerOnRetainHook)(this); | ||
fns.onEnter = (0, onEnterExitRetain_1.registerOnEnterHook)(this); | ||
// Wire up Resolve hooks | ||
fns.eagerResolve = resolve_1.registerEagerResolvePath(this); | ||
fns.lazyResolve = resolve_1.registerLazyResolveState(this); | ||
fns.resolveAll = resolve_1.registerResolveRemaining(this); | ||
fns.eagerResolve = (0, resolve_1.registerEagerResolvePath)(this); | ||
fns.lazyResolve = (0, resolve_1.registerLazyResolveState)(this); | ||
fns.resolveAll = (0, resolve_1.registerResolveRemaining)(this); | ||
// Wire up the View management hooks | ||
fns.loadViews = views_1.registerLoadEnteringViews(this); | ||
fns.activateViews = views_1.registerActivateViews(this); | ||
fns.loadViews = (0, views_1.registerLoadEnteringViews)(this); | ||
fns.activateViews = (0, views_1.registerActivateViews)(this); | ||
// Updates global state after a transition | ||
fns.updateGlobals = updateGlobals_1.registerUpdateGlobalState(this); | ||
fns.updateGlobals = (0, updateGlobals_1.registerUpdateGlobalState)(this); | ||
// After globals.current is updated at priority: 10000 | ||
fns.updateUrl = url_1.registerUpdateUrl(this); | ||
fns.updateUrl = (0, url_1.registerUpdateUrl)(this); | ||
// Lazy load state trees | ||
fns.lazyLoad = lazyLoad_1.registerLazyLoadHook(this); | ||
fns.lazyLoad = (0, lazyLoad_1.registerLazyLoadHook)(this); | ||
}; | ||
@@ -262,0 +262,0 @@ return TransitionService; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -10,5 +14,6 @@ if (k2 === undefined) k2 = k; | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.UrlConfig = exports.UrlRules = void 0; | ||
__exportStar(require("./interface"), exports); | ||
@@ -15,0 +20,0 @@ __exportStar(require("./urlMatcher"), exports); |
@@ -97,3 +97,3 @@ /** | ||
/** @internal */ | ||
export declare type UrlRuleType = 'STATE' | 'URLMATCHER' | 'REGEXP' | 'RAW' | 'OTHER'; | ||
export type UrlRuleType = 'STATE' | 'URLMATCHER' | 'REGEXP' | 'RAW' | 'OTHER'; | ||
/** | ||
@@ -100,0 +100,0 @@ * The interface for a URL Rule |
@@ -84,3 +84,3 @@ "use strict"; | ||
UrlConfig.prototype.caseInsensitive = function (value) { | ||
return (this._isCaseInsensitive = common_1.isDefined(value) ? value : this._isCaseInsensitive); | ||
return (this._isCaseInsensitive = (0, common_1.isDefined)(value) ? value : this._isCaseInsensitive); | ||
}; | ||
@@ -105,5 +105,5 @@ /** | ||
UrlConfig.prototype.defaultSquashPolicy = function (value) { | ||
if (common_1.isDefined(value) && value !== true && value !== false && !common_1.isString(value)) | ||
throw new Error("Invalid squash policy: " + value + ". Valid policies: false, true, arbitrary-string"); | ||
return (this._defaultSquashPolicy = common_1.isDefined(value) ? value : this._defaultSquashPolicy); | ||
if ((0, common_1.isDefined)(value) && value !== true && value !== false && !(0, common_1.isString)(value)) | ||
throw new Error("Invalid squash policy: ".concat(value, ". Valid policies: false, true, arbitrary-string")); | ||
return (this._defaultSquashPolicy = (0, common_1.isDefined)(value) ? value : this._defaultSquashPolicy); | ||
}; | ||
@@ -123,3 +123,3 @@ /** | ||
UrlConfig.prototype.strictMode = function (value) { | ||
return (this._isStrictMode = common_1.isDefined(value) ? value : this._isStrictMode); | ||
return (this._isStrictMode = (0, common_1.isDefined)(value) ? value : this._isStrictMode); | ||
}; | ||
@@ -158,3 +158,3 @@ /** | ||
var type = this.paramTypes.type(name, definition, definitionFn); | ||
return !common_1.isDefined(definition) ? type : this; | ||
return !(0, common_1.isDefined)(definition) ? type : this; | ||
}; | ||
@@ -161,0 +161,0 @@ return UrlConfig; |
@@ -23,3 +23,3 @@ "use strict"; | ||
default: | ||
surroundPattern = ["(" + param.squash + "|", ')?']; | ||
surroundPattern = ["(".concat(param.squash, "|"), ')?']; | ||
break; | ||
@@ -30,3 +30,3 @@ } | ||
var memoizeTo = function (obj, _prop, fn) { return (obj[_prop] = obj[_prop] || fn()); }; | ||
var splitOnSlash = strings_1.splitOnDelim('/'); | ||
var splitOnSlash = (0, strings_1.splitOnDelim)('/'); | ||
var defaultConfig = { | ||
@@ -108,3 +108,3 @@ state: { params: {} }, | ||
this._compiled = []; | ||
this.config = config = common_2.defaults(config, defaultConfig); | ||
this.config = config = (0, common_2.defaults)(config, defaultConfig); | ||
this.pattern = pattern; | ||
@@ -131,5 +131,5 @@ // Find all placeholders and create a compiled pattern, using either classic or curly syntax: | ||
if (!UrlMatcher.nameValidator.test(id)) | ||
throw new Error("Invalid parameter name '" + id + "' in pattern '" + pattern + "'"); | ||
if (common_1.find(_this._params, hof_1.propEq('id', id))) | ||
throw new Error("Duplicate parameter name '" + id + "' in pattern '" + pattern + "'"); | ||
throw new Error("Invalid parameter name '".concat(id, "' in pattern '").concat(pattern, "'")); | ||
if ((0, common_1.find)(_this._params, (0, hof_1.propEq)('id', id))) | ||
throw new Error("Duplicate parameter name '".concat(id, "' in pattern '").concat(pattern, "'")); | ||
}; | ||
@@ -143,3 +143,3 @@ // Split into static segments separated by path parameter placeholders. | ||
var makeRegexpType = function (str) { | ||
return common_1.inherit(paramTypes.type(isSearch ? 'query' : 'path'), { | ||
return (0, common_1.inherit)(paramTypes.type(isSearch ? 'query' : 'path'), { | ||
pattern: new RegExp(str, _this.config.caseInsensitive ? 'i' : undefined), | ||
@@ -165,3 +165,3 @@ }); | ||
this._segments.push(details.segment); | ||
patterns.push([details.segment, common_1.tail(this._params)]); | ||
patterns.push([details.segment, (0, common_1.tail)(this._params)]); | ||
last = placeholder.lastIndex; | ||
@@ -193,3 +193,3 @@ } | ||
// Replace dashes with encoded "\-" | ||
return encodeURIComponent(str).replace(/-/g, function (c) { return "%5C%" + c.charCodeAt(0).toString(16).toUpperCase(); }); | ||
return encodeURIComponent(str).replace(/-/g, function (c) { return "%5C%".concat(c.charCodeAt(0).toString(16).toUpperCase()); }); | ||
}; | ||
@@ -200,5 +200,5 @@ /** @internal Given a matcher, return an array with the matcher's path segments and path params, in order */ | ||
var pathParams = matcher._params.filter(function (p) { return p.location === param_1.DefType.PATH; }); | ||
return common_1.arrayTuples(staticSegments, pathParams.concat(undefined)) | ||
return (0, common_1.arrayTuples)(staticSegments, pathParams.concat(undefined)) | ||
.reduce(common_1.unnestR, []) | ||
.filter(function (x) { return x !== '' && predicates_1.isDefined(x); }); | ||
.filter(function (x) { return x !== '' && (0, predicates_1.isDefined)(x); }); | ||
}; | ||
@@ -236,3 +236,3 @@ /** @internal Given a matcher, return an array with the matcher's query params */ | ||
.reduce(strings_1.joinNeighborsR, []) | ||
.map(function (x) { return (predicates_1.isString(x) ? splitOnSlash(x) : x); }) | ||
.map(function (x) { return ((0, predicates_1.isString)(x) ? splitOnSlash(x) : x); }) | ||
.reduce(common_1.unnestR, [])); | ||
@@ -252,3 +252,3 @@ }; | ||
return 1; | ||
if (predicates_1.isString(segment)) | ||
if ((0, predicates_1.isString)(segment)) | ||
return 2; | ||
@@ -271,3 +271,3 @@ if (segment instanceof param_1.Param) | ||
padArrays(weightsA, weightsB, 0); | ||
var _pairs = common_1.arrayTuples(weightsA, weightsB); | ||
var _pairs = (0, common_1.arrayTuples)(weightsA, weightsB); | ||
var cmp, i; | ||
@@ -306,5 +306,5 @@ for (i = 0; i < _pairs.length; i++) { | ||
UrlMatcher.prototype._getDecodedParamValue = function (value, param) { | ||
if (predicates_1.isDefined(value)) { | ||
if ((0, predicates_1.isDefined)(value)) { | ||
if (this.config.decodeParams && !param.type.raw) { | ||
if (predicates_1.isArray(value)) { | ||
if ((0, predicates_1.isArray)(value)) { | ||
value = value.map(function (paramValue) { return decodeURIComponent(paramValue); }); | ||
@@ -353,3 +353,3 @@ } | ||
'^', | ||
common_1.unnest(_this._cache.path.map(hof_1.prop('_compiled'))).join(''), | ||
(0, common_1.unnest)(_this._cache.path.map((0, hof_1.prop)('_compiled'))).join(''), | ||
_this.config.strict === false ? '/?' : '', | ||
@@ -364,3 +364,3 @@ '$', | ||
if (nPathSegments !== match.length - 1) | ||
throw new Error("Unbalanced capture group in route '" + this.pattern + "'"); | ||
throw new Error("Unbalanced capture group in route '".concat(this.pattern, "'")); | ||
function decodePathArray(paramVal) { | ||
@@ -370,4 +370,4 @@ var reverseString = function (str) { return str.split('').reverse().join(''); }; | ||
var split = reverseString(paramVal).split(/-(?!\\)/); | ||
var allReversed = common_1.map(split, reverseString); | ||
return common_1.map(allReversed, unquoteDashes).reverse(); | ||
var allReversed = (0, common_1.map)(split, reverseString); | ||
return (0, common_1.map)(allReversed, unquoteDashes).reverse(); | ||
} | ||
@@ -409,3 +409,3 @@ for (var i = 0; i < nPathSegments; i++) { | ||
return this._params; | ||
return common_1.unnest(this._cache.path.map(function (matcher) { return matcher._params; })); | ||
return (0, common_1.unnest)(this._cache.path.map(function (matcher) { return matcher._params; })); | ||
}; | ||
@@ -473,3 +473,3 @@ /** | ||
.reduce(common_1.unnestR, []) | ||
.map(function (x) { return (predicates_1.isString(x) ? x : getDetails(x)); }); | ||
.map(function (x) { return ((0, predicates_1.isString)(x) ? x : getDetails(x)); }); | ||
// Extract the query params into a separate array | ||
@@ -501,3 +501,3 @@ var queryParams = urlMatchers | ||
// The element is a static segment (a raw string); just append it | ||
if (predicates_1.isString(x)) | ||
if ((0, predicates_1.isString)(x)) | ||
return acc + x; | ||
@@ -510,3 +510,3 @@ // Otherwise, it's a ParamDetails. | ||
// If squash is a string, use the string for the param value | ||
if (predicates_1.isString(squash)) | ||
if ((0, predicates_1.isString)(squash)) | ||
return acc + squash; | ||
@@ -518,4 +518,4 @@ if (squash !== false) | ||
// If this parameter value is an array, encode the value using encodeDashes | ||
if (predicates_1.isArray(encoded)) | ||
return acc + common_1.map(encoded, UrlMatcher.encodeDashes).join('-'); | ||
if ((0, predicates_1.isArray)(encoded)) | ||
return acc + (0, common_1.map)(encoded, UrlMatcher.encodeDashes).join('-'); | ||
// If the parameter type is "raw", then do not encodeURIComponent | ||
@@ -534,3 +534,3 @@ if (param.raw) | ||
return; | ||
if (!predicates_1.isArray(encoded)) | ||
if (!(0, predicates_1.isArray)(encoded)) | ||
encoded = [encoded]; | ||
@@ -540,4 +540,4 @@ if (encoded.length === 0) | ||
if (!param.raw) | ||
encoded = common_1.map(encoded, encodeURIComponent); | ||
return encoded.map(function (val) { return param.id + "=" + val; }); | ||
encoded = (0, common_1.map)(encoded, encodeURIComponent); | ||
return encoded.map(function (val) { return "".concat(param.id, "=").concat(val); }); | ||
}) | ||
@@ -548,3 +548,3 @@ .filter(common_1.identity) | ||
// Concat the pathstring with the queryString (if exists) and the hashString (if exists) | ||
return pathString + (queryString ? "?" + queryString : '') + (values['#'] ? '#' + values['#'] : ''); | ||
return pathString + (queryString ? "?".concat(queryString) : '') + (values['#'] ? '#' + values['#'] : ''); | ||
}; | ||
@@ -551,0 +551,0 @@ /** @internal */ |
@@ -78,3 +78,3 @@ "use strict"; | ||
}; | ||
return new urlMatcher_1.UrlMatcher(pattern, urlConfig.paramTypes, this.paramFactory, common_1.extend(globalConfig, config)); | ||
return new urlMatcher_1.UrlMatcher(pattern, urlConfig.paramTypes, this.paramFactory, (0, common_1.extend)(globalConfig, config)); | ||
}; | ||
@@ -90,8 +90,8 @@ /** | ||
// TODO: typeof? | ||
if (!common_1.isObject(object)) | ||
if (!(0, common_1.isObject)(object)) | ||
return false; | ||
var result = true; | ||
common_1.forEach(urlMatcher_1.UrlMatcher.prototype, function (val, name) { | ||
if (common_1.isFunction(val)) | ||
result = result && common_1.isDefined(object[name]) && common_1.isFunction(object[name]); | ||
(0, common_1.forEach)(urlMatcher_1.UrlMatcher.prototype, function (val, name) { | ||
if ((0, common_1.isFunction)(val)) | ||
result = result && (0, common_1.isDefined)(object[name]) && (0, common_1.isFunction)(object[name]); | ||
}); | ||
@@ -98,0 +98,0 @@ return result; |
@@ -66,3 +66,3 @@ import { UrlMatcher } from './urlMatcher'; | ||
/** @deprecated use [[UrlService.interceptDeferred]]*/ | ||
interceptDeferred: boolean; | ||
get interceptDeferred(): boolean; | ||
/** @deprecated use [[UrlService.match]]*/ | ||
@@ -69,0 +69,0 @@ match: (urlParts: UrlParts) => MatchResult; |
@@ -10,3 +10,3 @@ "use strict"; | ||
if (isHtml5) | ||
return common_1.stripLastPathElement(baseHref) + url; | ||
return (0, common_1.stripLastPathElement)(baseHref) + url; | ||
if (absolute) | ||
@@ -13,0 +13,0 @@ return baseHref.slice(1) + url; |
@@ -29,7 +29,7 @@ "use strict"; | ||
var isState = stateObject_1.StateObject.isState, isStateDeclaration = stateObject_1.StateObject.isStateDeclaration; | ||
var makeRule = hof_1.pattern([ | ||
var makeRule = (0, hof_1.pattern)([ | ||
[predicates_1.isString, function (_what) { return makeRule(_this.compile(_what)); }], | ||
[hof_1.is(urlMatcher_1.UrlMatcher), function (_what) { return _this.fromUrlMatcher(_what, handler); }], | ||
[hof_1.or(isState, isStateDeclaration), function (_what) { return _this.fromState(_what, _this.router); }], | ||
[hof_1.is(RegExp), function (_what) { return _this.fromRegExp(_what, handler); }], | ||
[(0, hof_1.is)(urlMatcher_1.UrlMatcher), function (_what) { return _this.fromUrlMatcher(_what, handler); }], | ||
[(0, hof_1.or)(isState, isStateDeclaration), function (_what) { return _this.fromState(_what, _this.router); }], | ||
[(0, hof_1.is)(RegExp), function (_what) { return _this.fromRegExp(_what, handler); }], | ||
[predicates_1.isFunction, function (_what) { return new BaseUrlRule(_what, handler); }], | ||
@@ -80,5 +80,5 @@ ]); | ||
var _handler = handler; | ||
if (predicates_1.isString(handler)) | ||
if ((0, predicates_1.isString)(handler)) | ||
handler = this.router.urlMatcherFactory.compile(handler); | ||
if (hof_1.is(urlMatcher_1.UrlMatcher)(handler)) | ||
if ((0, hof_1.is)(urlMatcher_1.UrlMatcher)(handler)) | ||
_handler = function (match) { return handler.format(match); }; | ||
@@ -102,3 +102,3 @@ function matchUrlParamters(url) { | ||
var details = { urlMatcher: urlMatcher, matchPriority: matchPriority, type: 'URLMATCHER' }; | ||
return common_1.extend(new BaseUrlRule(matchUrlParamters, _handler), details); | ||
return (0, common_1.extend)(new BaseUrlRule(matchUrlParamters, _handler), details); | ||
}; | ||
@@ -133,3 +133,3 @@ /** | ||
var details = { state: state, type: 'STATE' }; | ||
return common_1.extend(this.fromUrlMatcher(state.url, handler), details); | ||
return (0, common_1.extend)(this.fromUrlMatcher(state.url, handler), details); | ||
}; | ||
@@ -180,8 +180,8 @@ /** | ||
}; | ||
var _handler = predicates_1.isString(handler) ? redirectUrlTo : handler; | ||
var _handler = (0, predicates_1.isString)(handler) ? redirectUrlTo : handler; | ||
var matchParamsFromRegexp = function (url) { return regexp.exec(url.path); }; | ||
var details = { regexp: regexp, type: 'REGEXP' }; | ||
return common_1.extend(new BaseUrlRule(matchParamsFromRegexp, _handler), details); | ||
return (0, common_1.extend)(new BaseUrlRule(matchParamsFromRegexp, _handler), details); | ||
}; | ||
UrlRuleFactory.isUrlRule = function (obj) { return obj && ['type', 'match', 'handler'].every(function (key) { return predicates_1.isDefined(obj[key]); }); }; | ||
UrlRuleFactory.isUrlRule = function (obj) { return obj && ['type', 'match', 'handler'].every(function (key) { return (0, predicates_1.isDefined)(obj[key]); }); }; | ||
return UrlRuleFactory; | ||
@@ -188,0 +188,0 @@ }()); |
@@ -48,6 +48,6 @@ "use strict"; | ||
function getHandlerFn(handler) { | ||
if (!common_1.isFunction(handler) && !common_1.isString(handler) && !common_1.is(state_1.TargetState)(handler) && !state_1.TargetState.isDef(handler)) { | ||
if (!(0, common_1.isFunction)(handler) && !(0, common_1.isString)(handler) && !(0, common_1.is)(state_1.TargetState)(handler) && !state_1.TargetState.isDef(handler)) { | ||
throw new Error("'handler' must be a string, function, TargetState, or have a state: 'newtarget' property"); | ||
} | ||
return common_1.isFunction(handler) ? handler : common_1.val(handler); | ||
return (0, common_1.isFunction)(handler) ? handler : (0, common_1.val)(handler); | ||
} | ||
@@ -165,3 +165,3 @@ /** | ||
var handlerFn = getHandlerFn(handler); | ||
this._otherwiseFn = this.urlRuleFactory.create(common_1.val(true), handlerFn); | ||
this._otherwiseFn = this.urlRuleFactory.create((0, common_1.val)(true), handlerFn); | ||
this._sorted = false; | ||
@@ -175,3 +175,3 @@ }; | ||
UrlRules.prototype.removeRule = function (rule) { | ||
common_1.removeFrom(this._rules, rule); | ||
(0, common_1.removeFrom)(this._rules, rule); | ||
}; | ||
@@ -338,3 +338,3 @@ /** | ||
var rule = this.urlRuleFactory.create(matcher, handler); | ||
if (common_1.isDefined(options && options.priority)) | ||
if ((0, common_1.isDefined)(options && options.priority)) | ||
rule.priority = options.priority; | ||
@@ -341,0 +341,0 @@ this.rule(rule); |
@@ -165,6 +165,6 @@ "use strict"; | ||
var best = this.match(url); | ||
var applyResult = common_1.pattern([ | ||
var applyResult = (0, common_1.pattern)([ | ||
[common_1.isString, function (newurl) { return urlService.url(newurl, true); }], | ||
[state_1.TargetState.isDef, function (def) { return stateService.go(def.state, def.params, def.options); }], | ||
[common_1.is(state_1.TargetState), function (target) { return stateService.go(target.state(), target.params(), target.options()); }], | ||
[(0, common_1.is)(state_1.TargetState), function (target) { return stateService.go(target.state(), target.params(), target.options()); }], | ||
]); | ||
@@ -243,3 +243,3 @@ applyResult(best && best.rule.handler(best.match, url, this.router)); | ||
var _this = this; | ||
url = common_1.extend({ path: '', search: {}, hash: '' }, url); | ||
url = (0, common_1.extend)({ path: '', search: {}, hash: '' }, url); | ||
var rules = this.rules.rules(); | ||
@@ -246,0 +246,0 @@ // Checks a single rule. Returns { rule: rule, match: match, weight: weight } if it matched, or undefined |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -10,3 +14,3 @@ if (k2 === undefined) k2 = k; | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
@@ -13,0 +17,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -13,5 +13,5 @@ "use strict"; | ||
this._listener = function (evt) { return _this._listeners.forEach(function (cb) { return cb(evt); }); }; | ||
this.hash = function () { return utils_1.parseUrl(_this._get()).hash; }; | ||
this.path = function () { return utils_1.parseUrl(_this._get()).path; }; | ||
this.search = function () { return utils_1.getParams(utils_1.parseUrl(_this._get()).search); }; | ||
this.hash = function () { return (0, utils_1.parseUrl)(_this._get()).hash; }; | ||
this.path = function () { return (0, utils_1.parseUrl)(_this._get()).path; }; | ||
this.search = function () { return (0, utils_1.getParams)((0, utils_1.parseUrl)(_this._get()).search); }; | ||
this._location = common_1.root.location; | ||
@@ -22,3 +22,3 @@ this._history = common_1.root.history; | ||
if (replace === void 0) { replace = true; } | ||
if (common_1.isDefined(url) && url !== this._get()) { | ||
if ((0, common_1.isDefined)(url) && url !== this._get()) { | ||
this._set(null, null, url, replace); | ||
@@ -29,3 +29,3 @@ if (this.fireAfterUpdate) { | ||
} | ||
return utils_1.buildUrl(this); | ||
return (0, utils_1.buildUrl)(this); | ||
}; | ||
@@ -35,6 +35,6 @@ BaseLocationServices.prototype.onChange = function (cb) { | ||
this._listeners.push(cb); | ||
return function () { return common_1.removeFrom(_this._listeners, cb); }; | ||
return function () { return (0, common_1.removeFrom)(_this._listeners, cb); }; | ||
}; | ||
BaseLocationServices.prototype.dispose = function (router) { | ||
common_1.deregAll(this._listeners); | ||
(0, common_1.deregAll)(this._listeners); | ||
}; | ||
@@ -41,0 +41,0 @@ return BaseLocationServices; |
@@ -29,8 +29,8 @@ "use strict"; | ||
BrowserLocationConfig.prototype.hashPrefix = function (newprefix) { | ||
return predicates_1.isDefined(newprefix) ? (this._hashPrefix = newprefix) : this._hashPrefix; | ||
return (0, predicates_1.isDefined)(newprefix) ? (this._hashPrefix = newprefix) : this._hashPrefix; | ||
}; | ||
BrowserLocationConfig.prototype.baseHref = function (href) { | ||
if (predicates_1.isDefined(href)) | ||
if ((0, predicates_1.isDefined)(href)) | ||
this._baseHref = href; | ||
if (predicates_1.isUndefined(this._baseHref)) | ||
if ((0, predicates_1.isUndefined)(this._baseHref)) | ||
this._baseHref = this.getBaseHref(); | ||
@@ -37,0 +37,0 @@ return this._baseHref; |
@@ -6,6 +6,8 @@ "use strict"; | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
if (typeof b !== "function" && b !== null) | ||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
extendStatics(d, b); | ||
@@ -29,3 +31,3 @@ function __() { this.constructor = d; } | ||
HashLocationService.prototype._get = function () { | ||
return common_1.trimHashVal(this._location.hash); | ||
return (0, common_1.trimHashVal)(this._location.hash); | ||
}; | ||
@@ -32,0 +34,0 @@ HashLocationService.prototype._set = function (state, title, url, replace) { |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -10,3 +14,3 @@ if (k2 === undefined) k2 = k; | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
@@ -13,0 +17,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -69,7 +69,7 @@ "use strict"; | ||
invoke: function (fn, context, locals) { | ||
var all = index_1.extend({}, globals, locals || {}); | ||
var all = (0, index_1.extend)({}, globals, locals || {}); | ||
var params = exports.$injector.annotate(fn); | ||
var ensureExist = index_1.assertPredicate(function (key) { return all.hasOwnProperty(key); }, function (key) { return "DI can't find injectable: '" + key + "'"; }); | ||
var ensureExist = (0, index_1.assertPredicate)(function (key) { return all.hasOwnProperty(key); }, function (key) { return "DI can't find injectable: '".concat(key, "'"); }); | ||
var args = params.filter(ensureExist).map(function (x) { return all[x]; }); | ||
if (index_1.isFunction(fn)) | ||
if ((0, index_1.isFunction)(fn)) | ||
return fn.apply(context, args); | ||
@@ -86,7 +86,7 @@ else | ||
annotate: function (fn) { | ||
if (!index_1.isInjectable(fn)) | ||
throw new Error("Not an injectable function: " + fn); | ||
if (!(0, index_1.isInjectable)(fn)) | ||
throw new Error("Not an injectable function: ".concat(fn)); | ||
if (fn && fn.$inject) | ||
return fn.$inject; | ||
if (index_1.isArray(fn)) | ||
if ((0, index_1.isArray)(fn)) | ||
return fn.slice(0, -1); | ||
@@ -93,0 +93,0 @@ var fnStr = fn.toString().replace(STRIP_COMMENTS, ''); |
@@ -21,3 +21,3 @@ "use strict"; | ||
this.html5Mode = function () { return false; }; | ||
this.hashPrefix = function (newval) { return (predicates_1.isDefined(newval) ? (_this._hashPrefix = newval) : _this._hashPrefix); }; | ||
this.hashPrefix = function (newval) { return ((0, predicates_1.isDefined)(newval) ? (_this._hashPrefix = newval) : _this._hashPrefix); }; | ||
} | ||
@@ -24,0 +24,0 @@ return MemoryLocationConfig; |
@@ -6,6 +6,8 @@ "use strict"; | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
if (typeof b !== "function" && b !== null) | ||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
extendStatics(d, b); | ||
@@ -12,0 +14,0 @@ function __() { this.constructor = d; } |
@@ -20,7 +20,7 @@ "use strict"; | ||
/** A `UIRouterPlugin` uses the browser hash to get/set the current location */ | ||
exports.hashLocationPlugin = utils_1.locationPluginFactory('vanilla.hashBangLocation', false, hashLocationService_1.HashLocationService, browserLocationConfig_1.BrowserLocationConfig); | ||
exports.hashLocationPlugin = (0, utils_1.locationPluginFactory)('vanilla.hashBangLocation', false, hashLocationService_1.HashLocationService, browserLocationConfig_1.BrowserLocationConfig); | ||
/** A `UIRouterPlugin` that gets/sets the current location using the browser's `location` and `history` apis */ | ||
exports.pushStateLocationPlugin = utils_1.locationPluginFactory('vanilla.pushStateLocation', true, pushStateLocationService_1.PushStateLocationService, browserLocationConfig_1.BrowserLocationConfig); | ||
exports.pushStateLocationPlugin = (0, utils_1.locationPluginFactory)('vanilla.pushStateLocation', true, pushStateLocationService_1.PushStateLocationService, browserLocationConfig_1.BrowserLocationConfig); | ||
/** A `UIRouterPlugin` that gets/sets the current location from an in-memory object */ | ||
exports.memoryLocationPlugin = utils_1.locationPluginFactory('vanilla.memoryLocation', false, memoryLocationService_1.MemoryLocationService, memoryLocationConfig_1.MemoryLocationConfig); | ||
exports.memoryLocationPlugin = (0, utils_1.locationPluginFactory)('vanilla.memoryLocation', false, memoryLocationService_1.MemoryLocationService, memoryLocationConfig_1.MemoryLocationConfig); | ||
//# sourceMappingURL=plugins.js.map |
@@ -6,6 +6,8 @@ "use strict"; | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
if (typeof b !== "function" && b !== null) | ||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
extendStatics(d, b); | ||
@@ -50,8 +52,8 @@ function __() { this.constructor = d; } | ||
PushStateLocationService.prototype._getBasePrefix = function () { | ||
return common_1.stripLastPathElement(this._config.baseHref()); | ||
return (0, common_1.stripLastPathElement)(this._config.baseHref()); | ||
}; | ||
PushStateLocationService.prototype._get = function () { | ||
var _a = this._location, pathname = _a.pathname, hash = _a.hash, search = _a.search; | ||
search = common_1.splitQuery(search)[1]; // strip ? if found | ||
hash = common_1.splitHash(hash)[1]; // strip # if found | ||
search = (0, common_1.splitQuery)(search)[1]; // strip ? if found | ||
hash = (0, common_1.splitHash)(hash)[1]; // strip # if found | ||
var basePrefix = this._getBasePrefix(); | ||
@@ -58,0 +60,0 @@ var exactBaseHrefMatch = pathname === this._config.baseHref(); |
@@ -40,6 +40,6 @@ "use strict"; | ||
all: function (promises) { | ||
if (index_1.isArray(promises)) { | ||
if ((0, index_1.isArray)(promises)) { | ||
return Promise.all(promises); | ||
} | ||
if (index_1.isObject(promises)) { | ||
if ((0, index_1.isObject)(promises)) { | ||
// Convert promises map to promises array. | ||
@@ -46,0 +46,0 @@ // When each promise resolves, map it to a tuple { key: key, val: val } |
@@ -5,3 +5,3 @@ "use strict"; | ||
var common_1 = require("../common"); | ||
exports.keyValsToObjectR = function (accum, _a) { | ||
var keyValsToObjectR = function (accum, _a) { | ||
var key = _a[0], val = _a[1]; | ||
@@ -11,3 +11,3 @@ if (!accum.hasOwnProperty(key)) { | ||
} | ||
else if (common_1.isArray(accum[key])) { | ||
else if ((0, common_1.isArray)(accum[key])) { | ||
accum[key].push(val); | ||
@@ -20,13 +20,15 @@ } | ||
}; | ||
exports.getParams = function (queryString) { | ||
exports.keyValsToObjectR = keyValsToObjectR; | ||
var getParams = function (queryString) { | ||
return queryString.split('&').filter(common_1.identity).map(common_1.splitEqual).reduce(exports.keyValsToObjectR, {}); | ||
}; | ||
exports.getParams = getParams; | ||
function parseUrl(url) { | ||
var orEmptyString = function (x) { return x || ''; }; | ||
var _a = common_1.splitHash(url).map(orEmptyString), beforehash = _a[0], hash = _a[1]; | ||
var _b = common_1.splitQuery(beforehash).map(orEmptyString), path = _b[0], search = _b[1]; | ||
var _a = (0, common_1.splitHash)(url).map(orEmptyString), beforehash = _a[0], hash = _a[1]; | ||
var _b = (0, common_1.splitQuery)(beforehash).map(orEmptyString), path = _b[0], search = _b[1]; | ||
return { path: path, search: search, hash: hash, url: url }; | ||
} | ||
exports.parseUrl = parseUrl; | ||
exports.buildUrl = function (loc) { | ||
var buildUrl = function (loc) { | ||
var path = loc.path(); | ||
@@ -38,3 +40,3 @@ var searchObject = loc.search(); | ||
var param = searchObject[key]; | ||
var vals = common_1.isArray(param) ? param : [param]; | ||
var vals = (0, common_1.isArray)(param) ? param : [param]; | ||
return vals.map(function (val) { return key + '=' + val; }); | ||
@@ -46,2 +48,3 @@ }) | ||
}; | ||
exports.buildUrl = buildUrl; | ||
function locationPluginFactory(name, isHtml5, serviceClass, configurationClass) { | ||
@@ -48,0 +51,0 @@ return function (uiRouter) { |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -10,3 +14,3 @@ if (k2 === undefined) k2 = k; | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
@@ -13,0 +17,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -6,3 +6,3 @@ import { TypedMap } from '../common/common'; | ||
import { UIRouter } from '../router'; | ||
export declare type ViewConfigFactory = (path: PathNode[], decl: _ViewDeclaration) => ViewConfig | ViewConfig[]; | ||
export type ViewConfigFactory = (path: PathNode[], decl: _ViewDeclaration) => ViewConfig | ViewConfig[]; | ||
export interface ViewServicePluginAPI { | ||
@@ -9,0 +9,0 @@ _rootViewContext(context?: ViewContext): ViewContext; |
@@ -37,3 +37,3 @@ "use strict"; | ||
_viewConfigFactory: this._viewConfigFactory.bind(this), | ||
_registeredUIView: function (id) { return common_1.find(_this._uiViews, function (view) { return _this.router.$id + "." + view.id === id; }); }, | ||
_registeredUIView: function (id) { return (0, common_1.find)(_this._uiViews, function (view) { return "".concat(_this.router.$id, ".").concat(view.id) === id; }); }, | ||
_registeredUIViews: function () { return _this._uiViews; }, | ||
@@ -43,3 +43,3 @@ _activeViewConfigs: function () { return _this._viewConfigs; }, | ||
_this._listeners.push(listener); | ||
return function () { return common_1.removeFrom(_this._listeners, listener); }; | ||
return function () { return (0, common_1.removeFrom)(_this._listeners, listener); }; | ||
}, | ||
@@ -66,3 +66,3 @@ }; | ||
var uiViewName = viewAtContext[0] || '$default'; // default to unnamed view | ||
var uiViewContextAnchor = predicates_1.isString(viewAtContext[1]) ? viewAtContext[1] : '^'; // default to parent context | ||
var uiViewContextAnchor = (0, predicates_1.isString)(viewAtContext[1]) ? viewAtContext[1] : '^'; // default to parent context | ||
// Handle relative view-name sugar syntax. | ||
@@ -104,3 +104,3 @@ // Matches rawViewName "^.^.^.foo.bar" into array: ["^.^.^.foo.bar", "^.^.^", "foo.bar"], | ||
var cfgs = cfgFactory(path, decl); | ||
return predicates_1.isArray(cfgs) ? cfgs : [cfgs]; | ||
return (0, predicates_1.isArray)(cfgs) ? cfgs : [cfgs]; | ||
}; | ||
@@ -117,3 +117,3 @@ /** | ||
trace_1.trace.traceViewServiceEvent('<- Removing', viewConfig); | ||
common_1.removeFrom(this._viewConfigs, viewConfig); | ||
(0, common_1.removeFrom)(this._viewConfigs, viewConfig); | ||
}; | ||
@@ -142,3 +142,3 @@ ViewService.prototype.activateViewConfig = function (viewConfig) { | ||
// Given a depth function, returns a compare function which can return either ascending or descending order | ||
var depthCompare = hof_1.curry(function (depthFn, posNeg, left, right) { return posNeg * (depthFn(left) - depthFn(right)); }); | ||
var depthCompare = (0, hof_1.curry)(function (depthFn, posNeg, left, right) { return posNeg * (depthFn(left) - depthFn(right)); }); | ||
var matchingConfigPair = function (uiView) { | ||
@@ -164,3 +164,3 @@ var matchingConfigs = _this._viewConfigs.filter(ViewService.matches(uiViewsByFqn, uiView)); | ||
var unmatchedConfigTuples = this._viewConfigs | ||
.filter(function (config) { return !common_1.inArray(matchedViewConfigs, config); }) | ||
.filter(function (config) { return !(0, common_1.inArray)(matchedViewConfigs, config); }) | ||
.map(function (viewConfig) { return ({ uiView: undefined, viewConfig: viewConfig }); }); | ||
@@ -202,3 +202,3 @@ uiViewTuples.forEach(configureUIView); | ||
trace_1.trace.traceViewServiceUIViewEvent('<- Deregistering', uiView); | ||
common_1.removeFrom(uiViews)(uiView); | ||
(0, common_1.removeFrom)(uiViews)(uiView); | ||
}; | ||
@@ -212,3 +212,3 @@ }; | ||
ViewService.prototype.available = function () { | ||
return this._uiViews.map(hof_1.prop('fqn')); | ||
return this._uiViews.map((0, hof_1.prop)('fqn')); | ||
}; | ||
@@ -221,3 +221,3 @@ /** | ||
ViewService.prototype.active = function () { | ||
return this._uiViews.filter(hof_1.prop('$config')).map(hof_1.prop('name')); | ||
return this._uiViews.filter((0, hof_1.prop)('$config')).map((0, hof_1.prop)('name')); | ||
}; | ||
@@ -291,3 +291,3 @@ /** | ||
// vc: ["foo", "bar"], uiv fqn: ["$default", "foo", "bar"] | ||
if (!common_1.equals(vcSegments, uivSegments.slice(0 - vcSegments.length))) | ||
if (!(0, common_1.equals)(vcSegments, uivSegments.slice(0 - vcSegments.length))) | ||
return false; | ||
@@ -294,0 +294,0 @@ // Now check if the fqn ending at the first segment of the viewConfig matches the context: |
{ | ||
"name": "@uirouter/core", | ||
"description": "UI-Router Core: Framework agnostic, State-based routing for JavaScript Single Page Apps", | ||
"version": "6.1.0", | ||
"version": "6.1.1", | ||
"scripts": { | ||
@@ -69,8 +69,8 @@ "clean": "shx rm -rf lib lib-esm _bundles .cache _doc", | ||
"devDependencies": { | ||
"@types/jasmine": "^3.3.13", | ||
"@types/jasmine": "^5.1.4", | ||
"@types/jquery": "^3.3.36", | ||
"@uirouter/publish-scripts": "^2.6.0", | ||
"@uirouter/publish-scripts": "^2.6.3", | ||
"bufferutil": "4.0.2", | ||
"dts-downlevel": "^0.4.0", | ||
"fork-ts-checker-webpack-plugin": "^6.0.8", | ||
"fork-ts-checker-webpack-plugin": "^9.0.2", | ||
"husky": "^4.2.5", | ||
@@ -83,4 +83,7 @@ "jasmine-core": "^3.3.0", | ||
"karma-script-launcher": "^1.0.0", | ||
"karma-sourcemap-loader": "^0.3.7", | ||
"karma-webpack": "^4.0.2", | ||
"karma-sourcemap-loader": "^0.4.0", | ||
"karma-webpack": "^5.0.1", | ||
"eslint": "^8.57.0", | ||
"@typescript-eslint/parser": "^7.16.0", | ||
"@typescript-eslint/eslint-plugin": "^7.16.0", | ||
"prettier": "^2.0.5", | ||
@@ -93,7 +96,5 @@ "pretty-quick": "^3.1.0", | ||
"ts-loader": "^8.0.12", | ||
"tslint": "5.20.1", | ||
"tslint-eslint-rules": "^5.3.1", | ||
"typescript": "~3.9", | ||
"typescript": "~5.4.5", | ||
"utf-8-validate": "5.0.3", | ||
"webpack": "^4.34.0" | ||
"webpack": "^5.92.1" | ||
}, | ||
@@ -128,3 +129,4 @@ "resolutions": { | ||
} | ||
} | ||
}, | ||
"packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
4606597
493
42118
28