client.has
Check if object has a value at the specified path
browsernot registered- Package
- @procedures/client · README
- Path
["client","has"]- CLI
- Not a
markcommand: it is not in the default registry. - As data
{"$proc":["client","has"],"input":{}}- Tags
- core, object
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","has"], { object: {}, path: "<path>" });
console.log(JSON.stringify(result));As data, in a program
{
"$proc": ["client", "has"],
"input": { "object": {}, "path": "<path>" }
}Input
| Field | Type | Required |
|---|---|---|
object | Record<string, unknown> | yes |
path | string | yes |
Output
The schema does not list fields (boolean).
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"object": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {},
"description": "The object"
},
"path": {
"type": "string",
"description": "The path of the field, with dots (for example user.name)"
}
},
"required": [
"object",
"path"
]
},
"output": {
"type": "boolean",
"description": "True when the path exists"
}
}