|
1 | 1 | /** @module params */ /** for typedoc */
|
2 |
| -import {fromJson, toJson, identity, equals, inherit, map, extend} from "../common/common"; |
3 |
| -import {isDefined} from "../common/predicates"; |
4 |
| -import {is, val} from "../common/hof"; |
5 |
| -import {services} from "../common/coreservices"; |
6 |
| -import {ParamType} from "./type"; |
7 |
| -import {ParamTypeDefinition} from "./interface"; |
| 2 | +import { fromJson, toJson, identity, equals, inherit, map, extend } from "../common/common"; |
| 3 | +import { isDefined, isNullOrUndefined } from "../common/predicates"; |
| 4 | +import { is } from "../common/hof"; |
| 5 | +import { services } from "../common/coreservices"; |
| 6 | +import { ParamType } from "./type"; |
| 7 | +import { ParamTypeDefinition } from "./interface"; |
8 | 8 |
|
9 | 9 | // Use tildes to pre-encode slashes.
|
10 | 10 | // If the slashes are simply URLEncoded, the browser can choose to pre-decode them,
|
@@ -35,7 +35,7 @@ export class ParamTypes {
|
35 | 35 | "int": {
|
36 | 36 | encode: valToString,
|
37 | 37 | decode(val: string) { return parseInt(val, 10); },
|
38 |
| - is(val: any) { return isDefined(val) && this.decode(val.toString()) === val; }, |
| 38 | + is(val: any) { return !isNullOrUndefined(val) && this.decode(val.toString()) === val; }, |
39 | 39 | pattern: /-?\d+/
|
40 | 40 | },
|
41 | 41 | "bool": {
|
|
0 commit comments