← All procedures

client.between

Check if value is between min and max (inclusive by default)

browsernot registered
Package
@procedures/client · README
Path
["client","between"]
CLI
Not a mark command: it is not in the default registry.
As data
{"$proc":["client","between"],"input":{}}
Tags
core, comparison

Try it in the Composer →

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY, allCoreProcedures } from "@procedures/client";

for (const procedure of allCoreProcedures) {
  if (!PROCEDURE_REGISTRY.has(procedure.path)) PROCEDURE_REGISTRY.register(procedure);
}

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["client","between"], { value: 1, min: 1, max: 1 });
console.log(JSON.stringify(result));

As data, in a program

{
  "$proc": ["client", "between"],
  "input": { "value": 1, "min": 1, "max": 1 }
}

Input

FieldTypeRequired
valuenumberyes
minnumberyes
maxnumberyes
inclusivebooleanno

Output

The schema does not list fields (boolean).

JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "value": {
        "type": "number",
        "description": "The value"
      },
      "min": {
        "type": "number",
        "description": "The lower bound"
      },
      "max": {
        "type": "number",
        "description": "The upper bound"
      },
      "inclusive": {
        "description": "Include the bounds (default: true)",
        "type": "boolean"
      }
    },
    "required": [
      "value",
      "min",
      "max"
    ]
  },
  "output": {
    "type": "boolean",
    "description": "True when the value is in the range"
  }
}