UNPKG

barro

Version:

Flexible barrel file generation for Javascript and Typescript with watching built-in.

15 lines 619 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.parseStringArray = void 0; function parseStringArray(value, name) { if (!Array.isArray(value)) { throw new Error(`Expected ${name} to be an array. Got ${typeof value}.`); } const invalidIndex = value.findIndex((value) => typeof value !== "string"); if (invalidIndex !== -1) { throw new Error(`Expected ${name}[${invalidIndex}] value to be a string. Got ${typeof value[invalidIndex]}.`); } return value; } exports.parseStringArray = parseStringArray; //# sourceMappingURL=parseStringArray.js.map