Skip to content

Commit 496c72a

Browse files
committed
refactor: remove unnecessary lang/collection facades
1 parent 1138955 commit 496c72a

File tree

3 files changed

+1
-185
lines changed

3 files changed

+1
-185
lines changed

Diff for: nativescript-angular/collection-facade.ts

-134
This file was deleted.

Diff for: nativescript-angular/directives/list-view-comp.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
TemplateRef,
1919
ViewChild,
2020
ViewContainerRef,
21+
ɵisListLikeIterable as isListLikeIterable,
2122
} from "@angular/core";
2223
import { ListView, ItemEventData } from "tns-core-modules/ui/list-view";
2324
import { View, KeyedTemplate } from "tns-core-modules/ui/core/view";
@@ -26,7 +27,6 @@ import { ObservableArray } from "tns-core-modules/data/observable-array";
2627
import { profile } from "tns-core-modules/profiling";
2728

2829
import { getSingleViewRecursive } from "../element-registry";
29-
import { isListLikeIterable } from "../collection-facade";
3030
import { listViewLog, listViewError } from "../trace";
3131

3232
const NG_VIEW = "_ngViewRef";

Diff for: nativescript-angular/lang-facade.ts

-50
Original file line numberDiff line numberDiff line change
@@ -11,57 +11,7 @@ export function isBlank(obj: any): boolean {
1111
return obj === undefined || obj === null;
1212
}
1313

14-
export function isDate(obj: any): obj is Date {
15-
return obj instanceof Date && !isNaN(obj.valueOf());
16-
}
17-
1814
export function print(obj: Error | Object) {
1915
console.log(obj);
2016
}
2117

22-
export function isJsObject(o: any): boolean {
23-
return o !== null && (typeof o === 'function' || typeof o === 'object');
24-
}
25-
26-
export function isArray(obj: any): boolean {
27-
return Array.isArray(obj);
28-
}
29-
30-
// When Symbol.iterator doesn't exist, retrieves the key used in es6-shim
31-
declare var Symbol: any;
32-
let _symbolIterator: any = null;
33-
export function getSymbolIterator(): string|symbol {
34-
if (isBlank(_symbolIterator)) {
35-
if (isPresent((<any>globalScope).Symbol) && isPresent(Symbol.iterator)) {
36-
_symbolIterator = Symbol.iterator;
37-
} else {
38-
// es6-shim specific logic
39-
let keys = Object.getOwnPropertyNames(Map.prototype);
40-
for (let i = 0; i < keys.length; ++i) {
41-
let key = keys[i];
42-
if (key !== 'entries' && key !== 'size' &&
43-
(Map as any).prototype[key] === Map.prototype['entries']) {
44-
_symbolIterator = key;
45-
}
46-
}
47-
}
48-
}
49-
return _symbolIterator;
50-
}
51-
52-
export function setValueOnPath(global: any, path: string, value: any) {
53-
let parts = path.split('.');
54-
let obj: any = global;
55-
while (parts.length > 1) {
56-
let name = parts.shift();
57-
if (obj.hasOwnProperty(name) && isPresent(obj[name])) {
58-
obj = obj[name];
59-
} else {
60-
obj = obj[name] = {};
61-
}
62-
}
63-
if (obj === undefined || obj === null) {
64-
obj = {};
65-
}
66-
obj[parts.shift()] = value;
67-
}

0 commit comments

Comments
 (0)