1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.assertIsString = exports.assertIsArray = exports.assertIsBuffer = exports.assertIsHexString = void 0;
|
4 | const internal_1 = require("./internal");
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | const assertIsHexString = function (input) {
|
10 | if (!(0, internal_1.isHexString)(input)) {
|
11 | const msg = `This method only supports 0x-prefixed hex strings but input was: ${input}`;
|
12 | throw new Error(msg);
|
13 | }
|
14 | };
|
15 | exports.assertIsHexString = assertIsHexString;
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | const assertIsBuffer = function (input) {
|
21 | if (!Buffer.isBuffer(input)) {
|
22 | const msg = `This method only supports Buffer but input was: ${input}`;
|
23 | throw new Error(msg);
|
24 | }
|
25 | };
|
26 | exports.assertIsBuffer = assertIsBuffer;
|
27 |
|
28 |
|
29 |
|
30 |
|
31 | const assertIsArray = function (input) {
|
32 | if (!Array.isArray(input)) {
|
33 | const msg = `This method only supports number arrays but input was: ${input}`;
|
34 | throw new Error(msg);
|
35 | }
|
36 | };
|
37 | exports.assertIsArray = assertIsArray;
|
38 |
|
39 |
|
40 |
|
41 |
|
42 | const assertIsString = function (input) {
|
43 | if (typeof input !== 'string') {
|
44 | const msg = `This method only supports strings but input was: ${input}`;
|
45 | throw new Error(msg);
|
46 | }
|
47 | };
|
48 | exports.assertIsString = assertIsString;
|
49 |
|
\ | No newline at end of file |