UNPKG

z-deduper

Version:

This library will allow you to build a Custom Zapier deduper for your advanced polling triggers use cases in your Zapier app.

26 lines 809 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.toFixedLengthChunks = exports.generateKey = void 0; const uuid_by_string_1 = __importDefault(require("uuid-by-string")); function generateKey(input) { return uuid_by_string_1.default(input); } exports.generateKey = generateKey; function toFixedLengthChunks(str, size) { let i = 0; let line = ""; const lines = []; do { line = str.substr(i, size); if (line) { lines.push(line); } i += size; } while (line !== ""); return lines; } exports.toFixedLengthChunks = toFixedLengthChunks; //# sourceMappingURL=utils.js.map