Skip to content

Commit 548f3dd

Browse files
committed
feat(facade): add isMap method
1 parent d5195d4 commit 548f3dd

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

modules/angular2/src/facade/lang.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ bool isBlank(obj) => obj == null;
2626
bool isString(obj) => obj is String;
2727
bool isFunction(obj) => obj is Function;
2828
bool isType(obj) => obj is Type;
29+
bool isMap(obj) => obj is Map;
2930

3031
String stringify(obj) => obj.toString();
3132

modules/angular2/src/facade/lang.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ export function isType(obj): boolean {
7575
return isFunction(obj);
7676
}
7777

78+
export function isMap(obj): boolean {
79+
return typeof obj === 'object' && obj !== null;
80+
}
81+
7882
export function stringify(token): string {
7983
if (typeof token === 'string') {
8084
return token;

0 commit comments

Comments
 (0)