File: index.d.ts

package info (click to toggle)
node-buffer-equal 1.0.1%2B~1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 188 kB
  • sloc: javascript: 65; makefile: 2
file content (28 lines) | stat: -rwxr-xr-x 697 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Type definitions for buffer-equal 1.0
// Project: https://github.com/substack/node-buffer-equal
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <reference types="node" />

export = bufferEqual;

/**
 * @return Whether the two buffers are equal.
 *
 * @example
 * import bufferEqual = require('buffer-equal');
 *
 * console.dir(bufferEqual(
 *     Buffer.from([253,254,255]),
 *     Buffer.from([253,254,255])
 * ));
 * // -> true
 *
 * console.dir(bufferEqual(
 *     Buffer.from('abc'),
 *     Buffer.from('abcd')
 * ));
 * // -> false
 */
declare function bufferEqual(a: Buffer, b: Buffer): boolean;