1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.clientOnly = exports.noop = exports.equalRecords = exports.find = undefined;
|
7 |
|
8 | var _platform = require("./platform");
|
9 |
|
10 | var find = function find(f, xs) {
|
11 | return xs.reduce(function (b, x) {
|
12 | return b ? b : f(x) ? x : null;
|
13 | }, null);
|
14 | };
|
15 |
|
16 | var equalRecords = function equalRecords(o1, o2) {
|
17 | for (var key in o1) {
|
18 | if (o1[key] !== o2[key]) return false;
|
19 | }return true;
|
20 | };
|
21 |
|
22 | var noop = function noop() {
|
23 | return undefined;
|
24 | };
|
25 |
|
26 | var clientOnly = function clientOnly(f) {
|
27 | return _platform.isClient ? f : noop;
|
28 | };
|
29 |
|
30 | exports.default = {
|
31 | find: find,
|
32 | equalRecords: equalRecords,
|
33 | noop: noop,
|
34 | clientOnly: clientOnly
|
35 | };
|
36 | exports.find = find;
|
37 | exports.equalRecords = equalRecords;
|
38 | exports.noop = noop;
|
39 | exports.clientOnly = clientOnly; |
\ | No newline at end of file |