MCPcopy Create free account
hub / github.com/MetaMask/rpc-errors / expectWorkspaceField

Function expectWorkspaceField

yarn.config.cjs:67–77  ·  view source on GitHub ↗

* Expect that the workspace has the given field, and that it is a non-null * value. If the field is not present, or is null, this will log an error, and * cause the constraint to fail. * * If a value is provided, this will also verify that the field is equal to the * given value. * * @param {

(workspace, field, value)

Source from the content-addressed store, hash-verified

65 * @param {any} [value] - The value to check.
66 */
67function expectWorkspaceField(workspace, field, value) {
68 const fieldValue = workspace.manifest[field];
69 if (fieldValue === null) {
70 workspace.error(`Missing required field "${field}".`);
71 return;
72 }
73
74 if (value) {
75 workspace.set(field, value);
76 }
77}
78
79/**
80 * Expect that the workspace has a description, and that it is a non-null

Callers 2

constraintsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…