* 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)
| 65 | * @param {any} [value] - The value to check. |
| 66 | */ |
| 67 | function 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 |
no outgoing calls
no test coverage detected
searching dependent graphs…