@okxweb3/coin-ethereum
Version:
An Ethereum SDK for building Web3 wallets and applications.
33 lines • 1.24 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.assertIsString = exports.assertIsArray = exports.assertIsBuffer = exports.assertIsHexString = void 0;
const util_1 = require("./util");
const assertIsHexString = function (input) {
if (!(0, util_1.isHexString)(input)) {
const msg = `This method only supports 0x-prefixed hex strings but input was: ${input}`;
throw new Error(msg);
}
};
exports.assertIsHexString = assertIsHexString;
const assertIsBuffer = function (input) {
if (!Buffer.isBuffer(input)) {
const msg = `This method only supports Buffer but input was: ${input}`;
throw new Error(msg);
}
};
exports.assertIsBuffer = assertIsBuffer;
const assertIsArray = function (input) {
if (!Array.isArray(input)) {
const msg = `This method only supports number arrays but input was: ${input}`;
throw new Error(msg);
}
};
exports.assertIsArray = assertIsArray;
const assertIsString = function (input) {
if (typeof input !== 'string') {
const msg = `This method only supports strings but input was: ${input}`;
throw new Error(msg);
}
};
exports.assertIsString = assertIsString;
//# sourceMappingURL=helpers.js.map