Skip to content

Commit 8d930c3

Browse files
committed
fix: use isListLikeIterable local to source
1 parent f433127 commit 8d930c3

File tree

4 files changed

+247
-234
lines changed

4 files changed

+247
-234
lines changed

package.json

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -35,47 +35,47 @@
3535
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s"
3636
},
3737
"dependencies": {
38-
"@angular/animations": "15.2.1",
39-
"@angular/common": "15.2.1",
40-
"@angular/compiler": "15.2.1",
41-
"@angular/core": "15.2.1",
42-
"@angular/forms": "15.2.1",
43-
"@angular/platform-browser": "15.2.1",
44-
"@angular/platform-browser-dynamic": "15.2.1",
45-
"@angular/router": "15.2.1",
38+
"@angular/animations": "15.2.2",
39+
"@angular/common": "15.2.2",
40+
"@angular/compiler": "15.2.2",
41+
"@angular/core": "15.2.2",
42+
"@angular/forms": "15.2.2",
43+
"@angular/platform-browser": "15.2.2",
44+
"@angular/platform-browser-dynamic": "15.2.2",
45+
"@angular/router": "15.2.2",
4646
"@nativescript/core": "~8.4.0",
4747
"@nativescript/theme": "~3.0.2",
4848
"@ngx-translate/core": "~14.0.0",
49-
"@nrwl/nx-cloud": "15.1.1",
49+
"@nrwl/nx-cloud": "15.2.1",
5050
"nativescript-ngx-fonticon": "~7.0.0",
5151
"rxjs": "^7.5.6",
5252
"zone.js": "0.12.0"
5353
},
5454
"devDependencies": {
55-
"@angular-devkit/build-angular": "15.2.1",
56-
"@angular-devkit/core": "15.2.1",
57-
"@angular-devkit/schematics": "15.2.1",
55+
"@angular-devkit/build-angular": "15.2.2",
56+
"@angular-devkit/core": "15.2.2",
57+
"@angular-devkit/schematics": "15.2.2",
5858
"@angular-eslint/eslint-plugin": "15.2.1",
5959
"@angular-eslint/eslint-plugin-template": "15.2.1",
6060
"@angular-eslint/template-parser": "15.2.1",
61-
"@angular/compiler-cli": "15.2.1",
61+
"@angular/compiler-cli": "15.2.2",
6262
"@jsdevtools/coverage-istanbul-loader": "3.0.5",
6363
"@nativescript/types": "~8.4.0",
6464
"@nativescript/unit-test-runner": "^3.0.4",
6565
"@nativescript/webpack": "~5.0.12",
66-
"@nrwl/angular": "15.8.5",
67-
"@nrwl/cli": "15.8.5",
68-
"@nrwl/eslint-plugin-nx": "15.8.5",
69-
"@nrwl/jest": "15.8.5",
70-
"@nrwl/js": "15.8.5",
71-
"@nrwl/linter": "15.8.5",
72-
"@nrwl/node": "15.8.5",
73-
"@nrwl/workspace": "15.8.5",
66+
"@nrwl/angular": "15.8.6",
67+
"@nrwl/cli": "15.8.6",
68+
"@nrwl/eslint-plugin-nx": "15.8.6",
69+
"@nrwl/jest": "15.8.6",
70+
"@nrwl/js": "15.8.6",
71+
"@nrwl/linter": "15.8.6",
72+
"@nrwl/node": "15.8.6",
73+
"@nrwl/workspace": "15.8.6",
7474
"@nstudio/angular": "15.0.3",
7575
"@nstudio/nativescript": "15.0.3",
7676
"@nstudio/nativescript-angular": "15.0.3",
7777
"@nstudio/xplat": "15.0.3",
78-
"@schematics/angular": "15.2.1",
78+
"@schematics/angular": "15.2.2",
7979
"@types/jasmine": "4.3.0",
8080
"@types/jest": "29.4.0",
8181
"@types/node": "^18.7.13",
@@ -98,7 +98,7 @@
9898
"karma-sinon": "^1.0.5",
9999
"lint-staged": "^13.0.3",
100100
"ng-packagr": "15.2.2",
101-
"nx": "15.8.5",
101+
"nx": "15.8.6",
102102
"nyc": "15.1.0",
103103
"postcss": "^8.4.16",
104104
"postcss-import": "14.1.0",
@@ -123,3 +123,4 @@
123123
]
124124
}
125125
}
126+

packages/angular/src/lib/cdk/list-view/list-view.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import { AfterContentInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChild, Directive, DoCheck, ElementRef, EmbeddedViewRef, EventEmitter, forwardRef, Host, HostListener, inject, Inject, InjectionToken, Input, IterableDiffer, IterableDiffers, NgZone, OnDestroy, Output, TemplateRef, ViewChild, ViewContainerRef, ɵisListLikeIterable as isListLikeIterable } from '@angular/core';
1+
import { AfterContentInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChild, Directive, DoCheck, ElementRef, EmbeddedViewRef, EventEmitter, forwardRef, Host, HostListener, inject, Inject, InjectionToken, Input, IterableDiffer, IterableDiffers, NgZone, OnDestroy, Output, TemplateRef, ViewChild, ViewContainerRef } from '@angular/core';
22
import { ItemEventData, KeyedTemplate, LayoutBase, ListView, ObservableArray, profile, View } from '@nativescript/core';
33

44
import { extractSingleViewRecursive } from '../../element-registry/registry';
55
import { NativeScriptDebug } from '../../trace';
66
import { NgViewTemplate } from '../../view-refs';
7+
import { isListLikeIterable } from '../../utils/general';
78

89
const NG_VIEW = '_ngViewRef';
910

packages/angular/src/lib/utils/general.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,14 @@ export function once(fn: Function) {
3232
export interface ComponentType<T> {
3333
new (...args: any[]): T;
3434
}
35+
36+
export function isListLikeIterable(obj: any): boolean {
37+
if (!isJsObject(obj)) return false;
38+
return Array.isArray(obj) ||
39+
(!(obj instanceof Map) && // JS Map are iterables but return entries as [k, v]
40+
Symbol.iterator in obj); // JS Iterable have a Symbol.iterator prop
41+
}
42+
43+
export function isJsObject(o: any): boolean {
44+
return o !== null && (typeof o === 'function' || typeof o === 'object');
45+
}

0 commit comments

Comments
 (0)