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

Method byteLength

source/predicates/array-buffer.ts:19–24  ·  view source on GitHub ↗

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

(byteLength: number)

Source from the content-addressed store, hash-verified

17 @param byteLength - The byte length of the array buffer.
18 */
19 byteLength(byteLength: number): this {
20 return this.addValidator({
21 message: (value, label) => `Expected ${label} to have byte length of \`${byteLength}\`, got \`${value.byteLength}\``,
22 validator: value => value.byteLength === byteLength,
23 });
24 }
25
26 /**
27 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