@coolon/angular-ui-powerups 0.0.44 → 0.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/coolon-angular-ui-powerups.umd.js +489 -167
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/coolon-angular-ui-powerups.js +2 -2
- package/esm2015/index.js +2 -2
- package/esm2015/lib/interaction/abstract-activity.js +3 -9
- package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +17 -12
- package/esm2015/lib/place/guards/place-route.guard.js +4 -4
- package/esm2015/lib/place/index.js +1 -2
- package/esm2015/lib/place/place-component.js +2 -2
- package/esm2015/lib/place/place-history.js +29 -6
- package/esm2015/lib/place/place-router.js +29 -22
- package/esm2015/lib/place/route/parameter-decorators.js +1 -1
- package/esm2015/lib/place/route/parameter-definition.class.js +92 -9
- package/esm2015/lib/place/route/parameter-sanitiser.js +4 -3
- package/esm2015/lib/place/route/parameter-snapshot.js +214 -23
- package/esm2015/lib/place/route/route-parameter-sanitiser.js +4 -9
- package/esm2015/lib/place/visit.js +3 -3
- package/esm2015/public_api.js +2 -2
- package/esm5/coolon-angular-ui-powerups.js +2 -2
- package/esm5/index.js +2 -2
- package/esm5/lib/interaction/abstract-activity.js +14 -10
- package/esm5/lib/place/components/place-outlet/place-outlet.component.js +17 -12
- package/esm5/lib/place/guards/place-route.guard.js +4 -4
- package/esm5/lib/place/index.js +1 -2
- package/esm5/lib/place/place-component.js +2 -2
- package/esm5/lib/place/place-history.js +39 -6
- package/esm5/lib/place/place-router.js +39 -27
- package/esm5/lib/place/route/parameter-decorators.js +1 -1
- package/esm5/lib/place/route/parameter-definition.class.js +104 -9
- package/esm5/lib/place/route/parameter-sanitiser.js +4 -3
- package/esm5/lib/place/route/parameter-snapshot.js +273 -24
- package/esm5/lib/place/route/route-parameter-sanitiser.js +8 -10
- package/esm5/lib/place/visit.js +3 -3
- package/esm5/public_api.js +2 -2
- package/fesm2015/coolon-angular-ui-powerups.js +388 -153
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +491 -168
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/place/components/place-outlet/place-outlet.component.d.ts +0 -1
- package/lib/place/index.d.ts +0 -1
- package/lib/place/place-history.d.ts +3 -0
- package/lib/place/place-router.d.ts +4 -3
- package/lib/place/route/parameter-definition.class.d.ts +12 -2
- package/lib/place/route/parameter-sanitiser.d.ts +3 -2
- package/lib/place/route/parameter-snapshot.d.ts +11 -8
- package/lib/place/visit.d.ts +2 -2
- package/package.json +1 -1
- package/esm2015/lib/place/route/default-parameter-sanitiser.js +0 -66
- package/esm5/lib/place/route/default-parameter-sanitiser.js +0 -73
- package/lib/place/route/default-parameter-sanitiser.d.ts +0 -11
|
@@ -21,7 +21,6 @@ export declare class PlaceOutletComponent extends DisposableComponent implements
|
|
|
21
21
|
private readonly _inOutletUpdate;
|
|
22
22
|
private readonly _activatedRouteModel;
|
|
23
23
|
private readonly _placeDefinition;
|
|
24
|
-
private readonly _paramMap;
|
|
25
24
|
readonly _resolvedParameters: MutableValueModel<ParameterSnapshot>;
|
|
26
25
|
private placeConfigured;
|
|
27
26
|
constructor(router: PlaceRouter, placeHistory: PlaceHistory);
|
package/lib/place/index.d.ts
CHANGED
|
@@ -18,7 +18,6 @@ export * from "./components/place-outlet/route-animations";
|
|
|
18
18
|
export * from "./components/tabbed-place-navigation/tabbed-place-navigation.component";
|
|
19
19
|
export * from "./guards/leave-place.guard";
|
|
20
20
|
export * from "./guards/place-route.guard";
|
|
21
|
-
export * from "./route/default-parameter-sanitiser";
|
|
22
21
|
export * from "./route/json-types";
|
|
23
22
|
export * from "./route/parameter-decorators";
|
|
24
23
|
export * from "./route/parameter-definition.class";
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { Router } from '@angular/router';
|
|
2
|
+
import { PlaceDefinition } from './place-definition';
|
|
2
3
|
import { ParameterSnapshot } from './route/parameter-snapshot';
|
|
3
4
|
export declare class PlaceHistory {
|
|
4
5
|
private readonly router;
|
|
5
6
|
private _history;
|
|
6
7
|
constructor(router: Router);
|
|
7
8
|
add(state: ParameterSnapshot): void;
|
|
9
|
+
getHistory(placeDef: PlaceDefinition): ParameterSnapshot[];
|
|
10
|
+
private setHistory;
|
|
8
11
|
}
|
|
9
12
|
export declare namespace VisitHistory {
|
|
10
13
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { ActivatedRoute, ActivatedRouteSnapshot, Router } from '@angular/router';
|
|
1
|
+
import { ActivatedRoute, ActivatedRouteSnapshot, Router, UrlTree } from '@angular/router';
|
|
2
2
|
import { ParameterSnapshot } from './route/parameter-snapshot';
|
|
3
3
|
export declare class PlaceRouter {
|
|
4
4
|
private readonly router;
|
|
5
5
|
constructor(router: Router);
|
|
6
6
|
pushParameterChangesToRoute(activatedRoute: ActivatedRoute, previous: ParameterSnapshot, next: ParameterSnapshot): void;
|
|
7
|
-
|
|
8
|
-
protected
|
|
7
|
+
getRedirectUrlTree(activatedRoute: ActivatedRouteSnapshot, sanitised: ParameterSnapshot): UrlTree;
|
|
8
|
+
protected getChildPath(activatedRoute: ActivatedRouteSnapshot): any[];
|
|
9
|
+
protected createRouteParameters(parameters: ParameterSnapshot): any[];
|
|
9
10
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Injector } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { PlaceHistory } from '../place-history';
|
|
3
|
+
import { Visit } from '../visit';
|
|
3
4
|
import { ParameterSanitiser } from './parameter-sanitiser';
|
|
4
5
|
import { ParameterType } from './parameter-type';
|
|
5
6
|
export declare abstract class ParameterDefinition<T, S = T> {
|
|
@@ -8,7 +9,8 @@ export declare abstract class ParameterDefinition<T, S = T> {
|
|
|
8
9
|
abstract readonly isRouteId: boolean;
|
|
9
10
|
abstract readonly isArray: boolean;
|
|
10
11
|
readonly name: string;
|
|
11
|
-
|
|
12
|
+
private remember;
|
|
13
|
+
private defaultValue;
|
|
12
14
|
constructor(propertyName: string, type: ParameterType<T>, options: ParameterDefinition.Options<S>);
|
|
13
15
|
getSanitiser(injector: Injector): ParameterSanitiser<S>;
|
|
14
16
|
}
|
|
@@ -31,4 +33,12 @@ export declare namespace ParameterDefinition {
|
|
|
31
33
|
readonly isRouteId = false;
|
|
32
34
|
readonly isArray = true;
|
|
33
35
|
}
|
|
36
|
+
class DefaultParameterSanitiser<T, S> implements ParameterSanitiser<S> {
|
|
37
|
+
readonly remember: boolean;
|
|
38
|
+
readonly defaultValue: S;
|
|
39
|
+
readonly placeHistory: PlaceHistory;
|
|
40
|
+
constructor(remember: boolean, defaultValue: S, placeHistory: PlaceHistory);
|
|
41
|
+
sanitise(parameterDef: ParameterDefinition<T, S>, value: S, visit?: Visit): Promise<S> | S;
|
|
42
|
+
private isBlank;
|
|
43
|
+
}
|
|
34
44
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Visit } from '../visit';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { ParameterDefinition } from './parameter-definition.class';
|
|
3
|
+
export interface ParameterSanitiser<S> {
|
|
4
|
+
sanitise(parameterDef: ParameterDefinition<any, S>, value: S, visit?: Visit): Promise<S> | S;
|
|
4
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Injector } from '@angular/core';
|
|
2
|
-
import { ParamMap } from '@angular/router';
|
|
2
|
+
import { ParamMap, UrlSegment } from '@angular/router';
|
|
3
3
|
import { PlaceDefinition } from '../place-definition';
|
|
4
4
|
import { Visit } from '../visit';
|
|
5
5
|
import { ParameterDefinition } from './parameter-definition.class';
|
|
@@ -7,20 +7,22 @@ export declare class ParameterSnapshot implements Visit {
|
|
|
7
7
|
readonly placeDefinition: PlaceDefinition;
|
|
8
8
|
private readonly resolved;
|
|
9
9
|
constructor(placeDefinition: PlaceDefinition, resolved: ParameterSnapshot.ResolvedParameter<any, any>[]);
|
|
10
|
-
hasChanged(other: ParameterSnapshot): boolean;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
private
|
|
10
|
+
hasChanged(other: ParameterSnapshot, debug?: boolean): boolean;
|
|
11
|
+
getParameter<T, S>(parameterDef: ParameterDefinition<T, S>): ParameterSnapshot.ResolvedParameter<T, S>;
|
|
12
|
+
getValueOf<T, S>(parameterDef: ParameterDefinition<T, S>): S;
|
|
13
|
+
getRouteIdValue(): any;
|
|
14
|
+
getParameterValue(name: string): any;
|
|
15
|
+
private getRouteIdParameter;
|
|
16
|
+
private getRouteParameters;
|
|
16
17
|
hasRouteId(): boolean;
|
|
17
18
|
getFormattedRouteId(): string;
|
|
18
19
|
getFormattedParameters(): {};
|
|
20
|
+
getAllFormattedParameters(): {};
|
|
19
21
|
replace<T, S>(parameter: ParameterDefinition<T, S>, value: S): ParameterSnapshot;
|
|
20
22
|
sanitise(injector: Injector): Promise<ParameterSnapshot>;
|
|
21
23
|
}
|
|
22
24
|
export declare namespace ParameterSnapshot {
|
|
23
|
-
function create(placeDef: PlaceDefinition,
|
|
25
|
+
function create(placeDef: PlaceDefinition, params: ParamMap, urlSegments: UrlSegment[]): ParameterSnapshot;
|
|
24
26
|
abstract class ResolvedParameter<T, S = T> {
|
|
25
27
|
readonly parameterDef: ParameterDefinition<T, S>;
|
|
26
28
|
readonly value: S;
|
|
@@ -30,6 +32,7 @@ export declare namespace ParameterSnapshot {
|
|
|
30
32
|
isRouteId(): boolean;
|
|
31
33
|
abstract formattedValue(): string | string[];
|
|
32
34
|
abstract replace(value: S): ResolvedParameter<T, S>;
|
|
35
|
+
sanitise(visit: Visit, injector: Injector): Promise<S>;
|
|
33
36
|
}
|
|
34
37
|
class ResolvedValueParameter<T> extends ResolvedParameter<T, T> {
|
|
35
38
|
isSame(otherValue: T): boolean;
|
package/lib/place/visit.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview added by tsickle
|
|
3
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4
|
-
*/
|
|
5
|
-
import * as tslib_1 from "tslib";
|
|
6
|
-
import { Trace } from '@coolon/pectin';
|
|
7
|
-
import _ from 'lodash';
|
|
8
|
-
/**
|
|
9
|
-
* @template T, S
|
|
10
|
-
*/
|
|
11
|
-
export class DefaultParameterSanitiser {
|
|
12
|
-
/**
|
|
13
|
-
* @param {?} def
|
|
14
|
-
* @param {?} remember
|
|
15
|
-
* @param {?} defaultValue
|
|
16
|
-
*/
|
|
17
|
-
constructor(def, remember, defaultValue) {
|
|
18
|
-
this.def = def;
|
|
19
|
-
this.remember = remember;
|
|
20
|
-
this.defaultValue = defaultValue;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* @param {?} value
|
|
24
|
-
* @param {?} visit
|
|
25
|
-
* @return {?}
|
|
26
|
-
*/
|
|
27
|
-
sanitise(value, visit) {
|
|
28
|
-
if (this.isBlank(value)) {
|
|
29
|
-
if (this.remember) {
|
|
30
|
-
// value = null;
|
|
31
|
-
}
|
|
32
|
-
return this.isBlank(value) && !_.isNil(this.defaultValue) ? this.defaultValue : value;
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
return value;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* @private
|
|
40
|
-
* @param {?} value
|
|
41
|
-
* @return {?}
|
|
42
|
-
*/
|
|
43
|
-
isBlank(value) {
|
|
44
|
-
/** @type {?} */
|
|
45
|
-
const isNil = _.isNil(value);
|
|
46
|
-
return this.def.isArray ? !isNil || value['length'] < 1 : isNil;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
tslib_1.__decorate([
|
|
50
|
-
Trace(),
|
|
51
|
-
tslib_1.__metadata("design:type", Function),
|
|
52
|
-
tslib_1.__metadata("design:paramtypes", [Object, Object]),
|
|
53
|
-
tslib_1.__metadata("design:returntype", Object)
|
|
54
|
-
], DefaultParameterSanitiser.prototype, "sanitise", null);
|
|
55
|
-
if (false) {
|
|
56
|
-
/**
|
|
57
|
-
* @type {?}
|
|
58
|
-
* @private
|
|
59
|
-
*/
|
|
60
|
-
DefaultParameterSanitiser.prototype.def;
|
|
61
|
-
/** @type {?} */
|
|
62
|
-
DefaultParameterSanitiser.prototype.remember;
|
|
63
|
-
/** @type {?} */
|
|
64
|
-
DefaultParameterSanitiser.prototype.defaultValue;
|
|
65
|
-
}
|
|
66
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVmYXVsdC1wYXJhbWV0ZXItc2FuaXRpc2VyLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQGNvb2xvbi9hbmd1bGFyLXVpLXBvd2VydXBzLyIsInNvdXJjZXMiOlsibGliL3BsYWNlL3JvdXRlL2RlZmF1bHQtcGFyYW1ldGVyLXNhbml0aXNlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLE9BQU8sRUFBRSxLQUFLLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUN2QyxPQUFPLENBQUMsTUFBTSxRQUFRLENBQUM7Ozs7QUFLdkIsTUFBTSxPQUFPLHlCQUF5Qjs7Ozs7O0lBRXBDLFlBQW9CLEdBQThCLEVBQVcsUUFBZ0IsRUFBVyxZQUFjO1FBQWxGLFFBQUcsR0FBSCxHQUFHLENBQTJCO1FBQVcsYUFBUSxHQUFSLFFBQVEsQ0FBUTtRQUFXLGlCQUFZLEdBQVosWUFBWSxDQUFFO0lBQ3RHLENBQUM7Ozs7OztJQUdELFFBQVEsQ0FBQyxLQUFRLEVBQUUsS0FBWTtRQUM3QixJQUFJL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YXJhbWV0ZXItc2FuaXRpc2VyJztcblxuZXhwb3J0IGNsYXNzIERlZmF1bHRQYXJhbWV0ZXJTYW5pdGlzZXI8VCwgUz4gaW1wbGVtZW50cyBQYXJhbWV0ZXJTYW5pdGlzZXI8Uz4ge1xuXG4gIGNvbnN0cnVjdG9yKHByaXZhdGUgZGVmOiBQYXJhbWV0ZXJEZWZpbml0aW9uPFQsIFM+LCByZWFkb25seSByZW1lbWJlcjpib29sZWFuLCByZWFkb25seSBkZWZhdWx0VmFsdWU6Uykge1xuICB9XG5cbiAgQFRyYWNlKClcbiAgc2FuaXRpc2UodmFsdWU6IFMsIHZpc2l0OiBWaXNpdCk6IFByb21pc2U8Uz4gfCBTIHtcbiAgICBpZiAodGhpcy5pc0JsYW5rKHZhbHVlKSkge1xuICAgICAgaWYgKHRoaXMucmVtZW1iZXIpIHtcbiAgICAgICAgLy8gdmFsdWUgPSBudWxsO1xuICAgICAgfVxuICAgICAgcmV0dXJuIHRoaXMuaXNCbGFuayh2YWx1ZSkgJiYgIV8uaXNOaWwodGhpcy5kZWZhdWx0VmFsdWUpID8gdGhpcy5kZWZhdWx0VmFsdWUgOiB2YWx1ZTtcblxuICAgIH0gZWxzZSB7XG4gICAgICByZXR1cm4gdmFsdWU7XG4gICAgfVxuICB9XG5cbiAgcHJpdmF0ZSBpc0JsYW5rKHZhbHVlOiBTKSB7XG4gICAgY29uc3QgaXNOaWwgPSBfLmlzTmlsKHZhbHVlKTtcbiAgICByZXR1cm4gdGhpcy5kZWYuaXNBcnJheSA/ICFpc05pbCB8fCB2YWx1ZVsnbGVuZ3RoJ10gPCAxIDogaXNOaWw7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview added by tsickle
|
|
3
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4
|
-
*/
|
|
5
|
-
import * as tslib_1 from "tslib";
|
|
6
|
-
import { Trace } from '@coolon/pectin';
|
|
7
|
-
import _ from 'lodash';
|
|
8
|
-
/**
|
|
9
|
-
* @template T, S
|
|
10
|
-
*/
|
|
11
|
-
var DefaultParameterSanitiser = /** @class */ (function () {
|
|
12
|
-
function DefaultParameterSanitiser(def, remember, defaultValue) {
|
|
13
|
-
this.def = def;
|
|
14
|
-
this.remember = remember;
|
|
15
|
-
this.defaultValue = defaultValue;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* @param {?} value
|
|
19
|
-
* @param {?} visit
|
|
20
|
-
* @return {?}
|
|
21
|
-
*/
|
|
22
|
-
DefaultParameterSanitiser.prototype.sanitise = /**
|
|
23
|
-
* @param {?} value
|
|
24
|
-
* @param {?} visit
|
|
25
|
-
* @return {?}
|
|
26
|
-
*/
|
|
27
|
-
function (value, visit) {
|
|
28
|
-
if (this.isBlank(value)) {
|
|
29
|
-
if (this.remember) {
|
|
30
|
-
// value = null;
|
|
31
|
-
}
|
|
32
|
-
return this.isBlank(value) && !_.isNil(this.defaultValue) ? this.defaultValue : value;
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
return value;
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* @private
|
|
40
|
-
* @param {?} value
|
|
41
|
-
* @return {?}
|
|
42
|
-
*/
|
|
43
|
-
DefaultParameterSanitiser.prototype.isBlank = /**
|
|
44
|
-
* @private
|
|
45
|
-
* @param {?} value
|
|
46
|
-
* @return {?}
|
|
47
|
-
*/
|
|
48
|
-
function (value) {
|
|
49
|
-
/** @type {?} */
|
|
50
|
-
var isNil = _.isNil(value);
|
|
51
|
-
return this.def.isArray ? !isNil || value['length'] < 1 : isNil;
|
|
52
|
-
};
|
|
53
|
-
tslib_1.__decorate([
|
|
54
|
-
Trace(),
|
|
55
|
-
tslib_1.__metadata("design:type", Function),
|
|
56
|
-
tslib_1.__metadata("design:paramtypes", [Object, Object]),
|
|
57
|
-
tslib_1.__metadata("design:returntype", Object)
|
|
58
|
-
], DefaultParameterSanitiser.prototype, "sanitise", null);
|
|
59
|
-
return DefaultParameterSanitiser;
|
|
60
|
-
}());
|
|
61
|
-
export { DefaultParameterSanitiser };
|
|
62
|
-
if (false) {
|
|
63
|
-
/**
|
|
64
|
-
* @type {?}
|
|
65
|
-
* @private
|
|
66
|
-
*/
|
|
67
|
-
DefaultParameterSanitiser.prototype.def;
|
|
68
|
-
/** @type {?} */
|
|
69
|
-
DefaultParameterSanitiser.prototype.remember;
|
|
70
|
-
/** @type {?} */
|
|
71
|
-
DefaultParameterSanitiser.prototype.defaultValue;
|
|
72
|
-
}
|
|
73
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVmYXVsdC1wYXJhbWV0ZXItc2FuaXRpc2VyLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQGNvb2xvbi9hbmd1bGFyLXVpLXBvd2VydXBzLyIsInNvdXJjZXMiOlsibGliL3BsYWNlL3JvdXRlL2RlZmF1bHQtcGFyYW1ldGVyLXNhbml0aXNlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLE9BQU8sRUFBRSxLQUFLLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUN2QyxPQUFPLENBQUMsTUFBTSxRQUFRLENBQUM7Ozs7QUFLdkI7SUFFRSxtQ0FBb0IsR0FBOEIsRUFBVyxRQUFnQixFQUFXLFlBQWM7UUFBbEYsUUFBRyxHQUFILEdBQUcsQ0FBMkI7UUFBVyxhQUFRLEdBQVIsUUFBUSxDQUFRO1FBQVcsaUJBQVksR0FBWixZQUFZLENBQUU7SUFDdEcsQ0FBQzs7Ozs7O0lBR0QsNENBQVE7Ozs7O0lBQVIsVUFBUyxLQUFRLEVBQUUsS0FBWTtRQUM3QixJQUFJLElBQUksQ0FBQyxPQUFPLENBQUMsS0FBSyxDQUFDLEVBQUU7WUFDdkIsSUFBSSxJ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Bmcm9tICcuL3BhcmFtZXRlci1zYW5pdGlzZXInO1xuXG5leHBvcnQgY2xhc3MgRGVmYXVsdFBhcmFtZXRlclNhbml0aXNlcjxULCBTPiBpbXBsZW1lbnRzIFBhcmFtZXRlclNhbml0aXNlcjxTPiB7XG5cbiAgY29uc3RydWN0b3IocHJpdmF0ZSBkZWY6IFBhcmFtZXRlckRlZmluaXRpb248VCwgUz4sIHJlYWRvbmx5IHJlbWVtYmVyOmJvb2xlYW4sIHJlYWRvbmx5IGRlZmF1bHRWYWx1ZTpTKSB7XG4gIH1cblxuICBAVHJhY2UoKVxuICBzYW5pdGlzZSh2YWx1ZTogUywgdmlzaXQ6IFZpc2l0KTogUHJvbWlzZTxTPiB8IFMge1xuICAgIGlmICh0aGlzLmlzQmxhbmsodmFsdWUpKSB7XG4gICAgICBpZiAodGhpcy5yZW1lbWJlcikge1xuICAgICAgICAvLyB2YWx1ZSA9IG51bGw7XG4gICAgICB9XG4gICAgICByZXR1cm4gdGhpcy5pc0JsYW5rKHZhbHVlKSAmJiAhXy5pc05pbCh0aGlzLmRlZmF1bHRWYWx1ZSkgPyB0aGlzLmRlZmF1bHRWYWx1ZSA6IHZhbHVlO1xuXG4gICAgfSBlbHNlIHtcbiAgICAgIHJldHVybiB2YWx1ZTtcbiAgICB9XG4gIH1cblxuICBwcml2YXRlIGlzQmxhbmsodmFsdWU6IFMpIHtcbiAgICBjb25zdCBpc05pbCA9IF8uaXNOaWwodmFsdWUpO1xuICAgIHJldHVybiB0aGlzLmRlZi5pc0FycmF5ID8gIWlzTmlsIHx8IHZhbHVlWydsZW5ndGgnXSA8IDEgOiBpc05pbDtcbiAgfVxufVxuIl19
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Visit } from '../visit';
|
|
2
|
-
import { ParameterDefinition } from './parameter-definition.class';
|
|
3
|
-
import { ParameterSanitiser } from './parameter-sanitiser';
|
|
4
|
-
export declare class DefaultParameterSanitiser<T, S> implements ParameterSanitiser<S> {
|
|
5
|
-
private def;
|
|
6
|
-
readonly remember: boolean;
|
|
7
|
-
readonly defaultValue: S;
|
|
8
|
-
constructor(def: ParameterDefinition<T, S>, remember: boolean, defaultValue: S);
|
|
9
|
-
sanitise(value: S, visit: Visit): Promise<S> | S;
|
|
10
|
-
private isBlank;
|
|
11
|
-
}
|