UNPKG

syphonx-core

Version:

SyphonX is a template-driven solution for extracting data from HTML in a highly efficient way. It combines the power of jQuery, Regular Expressions, and Javascript into a declarative template-driven format that extracts and reshapes HTML data into JSON.

18 lines 553 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.cut = void 0; function cut(text, splitter, n, limit) { if (typeof text === "string") { var a = text .split(splitter, limit) .map(function (value) { return value.trim(); }) .filter(function (value) { return value.length > 0; }); var i = n >= 0 ? n : a.length + n; return i >= 0 && i < a.length ? a[i] : null; } else { return null; } } exports.cut = cut; //# sourceMappingURL=cut.js.map