feat(facade): add isType method
This commit is contained in:
parent
15376a6d24
commit
e617ca6323
|
@ -25,6 +25,7 @@ bool isPresent(obj) => obj != null;
|
||||||
bool isBlank(obj) => obj == null;
|
bool isBlank(obj) => obj == null;
|
||||||
bool isString(obj) => obj is String;
|
bool isString(obj) => obj is String;
|
||||||
bool isFunction(obj) => obj is Function;
|
bool isFunction(obj) => obj is Function;
|
||||||
|
bool isType(obj) => obj is Type;
|
||||||
|
|
||||||
String stringify(obj) => obj.toString();
|
String stringify(obj) => obj.toString();
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,10 @@ export function isFunction(obj):boolean {
|
||||||
return typeof obj === "function";
|
return typeof obj === "function";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function isType(obj):boolean {
|
||||||
|
return isFunction(obj);
|
||||||
|
}
|
||||||
|
|
||||||
export function stringify(token):string {
|
export function stringify(token):string {
|
||||||
if (typeof token === 'string') {
|
if (typeof token === 'string') {
|
||||||
return token;
|
return token;
|
||||||
|
|
|
@ -48,6 +48,10 @@ export function isFunction(obj): boolean {
|
||||||
return typeof obj === "function";
|
return typeof obj === "function";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function isType(obj): boolean {
|
||||||
|
return isFunction(obj);
|
||||||
|
}
|
||||||
|
|
||||||
export function stringify(token): string {
|
export function stringify(token): string {
|
||||||
if (typeof token === 'string') {
|
if (typeof token === 'string') {
|
||||||
return token;
|
return token;
|
||||||
|
|
Loading…
Reference in New Issue