← All procedures

statistics.sorted

A new list with the values from the smallest to the largest.

CLI
Package
@procedures/statistics · README
Path
["statistics","sorted"]
CLI
mark statistics sorted --values <number[]>
As data
{"$proc":["statistics","sorted"],"input":{}}

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/statistics/register"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["statistics","sorted"], { values: [] });
console.log(JSON.stringify(result));

From the command line

$ mark statistics sorted --values <number[]>

As data, in a program

{ "$proc": ["statistics", "sorted"], "input": { "values": [] } }

Input

FieldTypeRequiredDefaultDescription
valuesnumber[]yes

Output

The schema does not list fields (number[]).

JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "values": {
        "type": "array",
        "items": {
          "type": "number"
        }
      }
    },
    "required": [
      "values"
    ],
    "additionalProperties": false
  },
  "output": {
    "type": "array",
    "items": {
      "type": "number"
    }
  }
}