hojas/node_modules/@marp-team/marpit/lib/helpers/wrap_array.js

21 lines
501 B
JavaScript
Raw Normal View History

2026-05-14 10:56:04 +02:00
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.wrapArray = exports.default = void 0;
/** @module */
/**
* Wrap value in array if it is not an array.
*
* @function wrapArray
* @param {*} valOrArr
* @return {Array}
*/
const wrapArray = valOrArr => {
if (valOrArr == null || valOrArr === false) return [];
if (valOrArr instanceof Array) return valOrArr;
return [valOrArr];
};
exports.wrapArray = wrapArray;
var _default = exports.default = wrapArray;