← All procedures
optional.some
This function wraps a present value.
CLI- Package
- @procedures/optional · README
- Path
["optional","some"]- CLI
mark optional some --value <any>- As data
{"$proc":["optional","some"],"input":{}}
Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/optional/register"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["optional","some"], { value: "<value>" });
console.log(JSON.stringify(result));From the command line
$ mark optional some --value <any>
As data, in a program
{ "$proc": ["optional", "some"], "input": { "value": "<value>" } }Input
Output
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"value": {}
},
"required": [
"value"
],
"additionalProperties": false
},
"output": {
"type": "object",
"properties": {
"tag": {
"type": "string",
"const": "some"
},
"value": {}
},
"required": [
"tag",
"value"
],
"additionalProperties": {}
}
}