Skip to content

Commit 8a250c5

Browse files
committed
replace rest custom each and map functions with native
1 parent 0413c7c commit 8a250c5

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

packages/devextreme/js/__internal/ui/map/m_provider.dynamic.azure.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import Color from '@js/color';
44
import $ from '@js/core/renderer';
55
import ajax from '@js/core/utils/ajax';
66
import { noop } from '@js/core/utils/common';
7-
import { map } from '@js/core/utils/iterator';
87
import { isDefined } from '@js/core/utils/type';
98
import { getWindow } from '@js/core/utils/window';
109
import type { MapType, RouteMode } from '@js/ui/map';
@@ -403,8 +402,9 @@ class AzureProvider extends DynamicProvider {
403402
}
404403

405404
_renderRoute(options: RouteOptions): Promise<RouteObject> {
405+
const routeLocations = options.locations ?? [];
406406
return Promise.all(
407-
map(options.locations, (point) => this._resolveLocation(point)),
407+
routeLocations.map((point) => this._resolveLocation(point)),
408408
).then((locations) => new Promise((resolve) => {
409409
const routeColor = new Color(options.color || this._defaultRouteColor()).toHex();
410410
const routeOpacity = options.opacity || this._defaultRouteOpacity();

packages/devextreme/js/__internal/ui/map/m_provider.dynamic.bing.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import Color from '@js/color';
44
import ajax from '@js/core/utils/ajax';
55
import { noop } from '@js/core/utils/common';
66
import { extend } from '@js/core/utils/extend';
7-
import { each, map } from '@js/core/utils/iterator';
87
import { getHeight, getWidth } from '@js/core/utils/size';
98
import { isDefined } from '@js/core/utils/type';
109
import { getWindow } from '@js/core/utils/window';
@@ -371,8 +370,8 @@ class BingProvider extends DynamicProvider {
371370
}
372371

373372
_renderRoute(options: RouteOptions): Promise<RouteObject> {
374-
// const locations = options.locations ?? [];
375-
return Promise.all(map(options.locations, (point) => this._resolveLocation(point)))
373+
const routeLocations = options.locations ?? [];
374+
return Promise.all(routeLocations.map((point) => this._resolveLocation(point)))
376375
.then((locations) => new Promise((resolve) => {
377376
const direction = new Microsoft.Maps.Directions.DirectionsManager(this._map);
378377
const color = new Color(options.color || this._defaultRouteColor()).toHex();
@@ -398,7 +397,7 @@ class BingProvider extends DynamicProvider {
398397
routeDraggable: false,
399398
});
400399

401-
each(locations, (_, location) => {
400+
locations.forEach((location) => {
402401
const waypoint = new Microsoft.Maps.Directions.Waypoint({ location });
403402
direction.addWaypoint(waypoint);
404403
});

0 commit comments

Comments
 (0)