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

Method maxByteLength

source/predicates/array-buffer.ts:44–50  ·  view source on GitHub ↗

Test an array buffer to have a minimum byte length. @param length - The minimum byte length of the array buffer.

(byteLength: number)

Source from the content-addressed store, hash-verified

42 @param length - The minimum byte length of the array buffer.
43 */
44 maxByteLength(byteLength: number): this {
45 return this.addValidator({
46 message: (value, label) => `Expected ${label} to have a maximum byte length of \`${byteLength}\`, got \`${value.byteLength}\``,
47 validator: value => value.byteLength <= byteLength,
48 negatedMessage: (value, label) => `Expected ${label} to have a minimum byte length of \`${byteLength + 1}\`, got \`${value.byteLength}\``,
49 });
50 }
51
52 /**
53 @hidden

Callers

nothing calls this directly

Calls 1

addValidatorMethod · 0.80

Tested by

no test coverage detected