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

Method minByteLength

source/predicates/array-buffer.ts:31–37  ·  view source on GitHub ↗

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

(byteLength: number)

Source from the content-addressed store, hash-verified

29 @param byteLength - The minimum byte length of the array buffer.
30 */
31 minByteLength(byteLength: number): this {
32 return this.addValidator({
33 message: (value, label) => `Expected ${label} to have a minimum byte length of \`${byteLength}\`, got \`${value.byteLength}\``,
34 validator: value => value.byteLength >= byteLength,
35 negatedMessage: (value, label) => `Expected ${label} to have a maximum byte length of \`${byteLength - 1}\`, got \`${value.byteLength}\``,
36 });
37 }
38
39 /**
40 Test an array buffer to have a minimum byte length.

Callers

nothing calls this directly

Calls 1

addValidatorMethod · 0.80

Tested by

no test coverage detected