1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.isDone = exports.isDirty = exports.isPending = exports.isInProgress = exports.by = exports.and = void 0;
|
4 | const node_1 = require("./node");
|
5 | function and(...criteria) {
|
6 | return (node) => criteria.every(c => c(node));
|
7 | }
|
8 | exports.and = and;
|
9 | function by(criteria) {
|
10 | function fn(args) {
|
11 | return criteria(args);
|
12 | }
|
13 | fn['and'] = function (args) {
|
14 | return and(criteria, args);
|
15 | };
|
16 | return fn;
|
17 | }
|
18 | exports.by = by;
|
19 | function isInProgress(node) {
|
20 | return node.state === node_1.STATE_IN_PROGRESS;
|
21 | }
|
22 | exports.isInProgress = isInProgress;
|
23 | function isPending(node) {
|
24 | return node.state === node_1.STATE_PENDING;
|
25 | }
|
26 | exports.isPending = isPending;
|
27 | function isDirty(node) {
|
28 | return node.state === node_1.STATE_DIRTY;
|
29 | }
|
30 | exports.isDirty = isDirty;
|
31 | function isDone(node) {
|
32 | return node.state === node_1.STATE_DONE;
|
33 | }
|
34 | exports.isDone = isDone;
|
35 |
|
\ | No newline at end of file |