UNPKG

crawlerzzz

Version:

34 lines 1.16 kB
"use strict"; var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; Object.defineProperty(exports, "__esModule", { value: true }); var R = require("ramda"); var propArraySelector = R.curry(function ( //@ts-ignore $, contextArraySelector, propsConfig) { return $(contextArraySelector) .toArray() .map(function (context) { if (typeof propsConfig === 'string') { return $(propsConfig, context); } if (typeof propsConfig === 'function') { return propsConfig(context); } return R.keys(propsConfig).reduce(function (acc, cur) { var _a; return (__assign({}, acc, (_a = {}, _a[cur] = propsConfig[cur](context), _a))); }, {}); }); }); exports.propArraySelector = propArraySelector; //# sourceMappingURL=htmlSelector.js.map