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

Function expectWorkspaceDescription

yarn.config.cjs:88–102  ·  view source on GitHub ↗

* Expect that the workspace has a description, and that it is a non-null * string. If the description is not present, or is null, this will log an * error, and cause the constraint to fail. * * This will also verify that the description does not end with a period. * * @param {Workspace} worksp

(workspace)

Source from the content-addressed store, hash-verified

86 * @param {Workspace} workspace - The workspace to check.
87 */
88function expectWorkspaceDescription(workspace) {
89 expectWorkspaceField(workspace, 'description');
90
91 const { description } = workspace.manifest;
92 if (typeof description !== 'string') {
93 workspace.error(
94 `Expected description to be a string, but got ${typeof description}.`,
95 );
96 return;
97 }
98
99 if (description.endsWith('.')) {
100 workspace.set('description', description.slice(0, -1));
101 }
102}
103
104/**
105 * Expect that if a dependency is listed under "dependencies", it is not also

Callers 1

constraintsFunction · 0.85

Calls 1

expectWorkspaceFieldFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…