MCPcopy
hub / github.com/sindresorhus/ow / equals

Method equals

source/predicates/string.ts:165–170  ·  view source on GitHub ↗

Test a string to be equal to a specified string. @param expected - Expected value to match.

(expected: S)

Source from the content-addressed store, hash-verified

163 @param expected - Expected value to match.
164 */
165 equals<S extends string>(expected: S): Predicate<S> {
166 return this.addValidator({
167 message: (value, label) => `Expected ${label} to be equal to \`${expected}\`, got \`${value}\``,
168 validator: value => value === expected,
169 }) as unknown as Predicate<S>;
170 }
171
172 /**
173 Test a string to be alphanumeric.

Callers 4

string.tsFile · 0.80
validateExactStringFunction · 0.80
validateStatusAnyFunction · 0.80
validateFoodFunction · 0.80

Calls 1

addValidatorMethod · 0.80

Tested by

no test coverage detected