Skip to main content

moveStop

The stops with one moved a place earlier (-1) or later (1). Returns the same list when there is no such stop or it is already at that end.

This is a function exported by @mapcairn/core, checked against version 0.2.0.

Signature​

import { moveStop } from "@mapcairn/core";

function moveStop(stops: readonly DirectionStop[], id: string, direction: -1 | 1): readonly DirectionStop[];

Parameters​

  • stops (readonly DirectionStop[])
  • id (string)
  • direction (-1 | 1)

Returns​

readonly DirectionStop[]

See also​

Source: packages/core/src/directions/directions.ts:86