UNPKG

boats

Version:

Beautiful Open / Async Template System - Write less yaml with BOATS and Nunjucks.

20 lines (19 loc) 688 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const fs_extra_1 = tslib_1.__importDefault(require("fs-extra")); const upath_1 = tslib_1.__importDefault(require("upath")); /** * Breaks strings on = sign and returns as a key value object into the arr arg * @param val The value to parse * @param arr Always an array is given * @returns {*} */ exports.default = (val, arr) => { const filePath = upath_1.default.join(process.cwd(), val); if (!fs_extra_1.default.pathExistsSync(filePath)) { throw new Error('Helper function could not be found: ' + filePath); } arr.push(filePath); return arr; };