epubavocado
Version:
I am an EPUB object model aspiring to be standards compliant.
19 lines (18 loc) • 547 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.splitRelAttribute = exports.toArray = void 0;
var toArray = function (valueOrArray) {
if (!valueOrArray) {
return [];
}
if (Array.isArray(valueOrArray)) {
return valueOrArray;
}
return [valueOrArray];
};
exports.toArray = toArray;
var splitRelAttribute = function (rel) {
// normalize spaces and split space separated words
return rel.replace(/\s+/g, ' ').split(' ');
};
exports.splitRelAttribute = splitRelAttribute;