← All procedures

client.arrOmit

Remove specified properties from all array items

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

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","arrOmit"], { items: [], keys: [] });
console.log(JSON.stringify(result));

As data, in a program

{ "$proc": ["client", "arrOmit"], "input": { "items": [], "keys": [] } }

Input

FieldTypeRequired
itemsunknown[]yes
keysstring[]yes

Output

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

JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "items": {
        "type": "array",
        "items": {},
        "description": "Array of objects"
      },
      "keys": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Properties to remove"
      }
    },
    "required": [
      "items",
      "keys"
    ]
  },
  "output": {
    "type": "array",
    "items": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {}
    },
    "description": "Each item without the given fields"
  }
}