quantity.whyNotConvertible
This function gives the reason that `from` cannot become `to`, or undefined when it can.
CLI- Package
- @procedures/quantity · README
- Path
["quantity","whyNotConvertible"]- CLI
mark quantity whyNotConvertible --from <string> --to <string>- As data
{"$proc":["quantity","whyNotConvertible"],"input":{}}
Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/quantity/register"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["quantity","whyNotConvertible"], { from: "<from>", to: "<to>" });
console.log(JSON.stringify(result));From the command line
$ mark quantity whyNotConvertible --from <string> --to <string>
As data, in a program
{
"$proc": ["quantity", "whyNotConvertible"],
"input": { "from": "<from>", "to": "<to>" }
}Input
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
from | string | yes | ||
to | string | yes |
Output
The schema does not list fields (string | null).
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"from": {
"type": "string"
},
"to": {
"type": "string"
}
},
"required": [
"from",
"to"
],
"additionalProperties": false
},
"output": {
"type": [
"string",
"null"
]
}
}