@modernpoacher/rules-runner 2.2.2 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{babel.config.js → babel.config.cjs} +1 -15
- package/package.json +17 -22
- package/src/common/{index.js → index.mjs} +1 -1
- package/src/comparators/{all-of.js → all-of.mjs} +1 -1
- package/src/comparators/{any-of.js → any-of.mjs} +1 -1
- package/src/comparators/{between.js → between.mjs} +2 -2
- package/src/comparators/{boolean.js → boolean.mjs} +2 -2
- package/src/comparators/{contains.js → contains.mjs} +2 -2
- package/src/comparators/{equals.js → equals.mjs} +1 -1
- package/src/comparators/{greater-than.js → greater-than.mjs} +2 -2
- package/src/comparators/index.mjs +11 -0
- package/src/comparators/{less-than.js → less-than.mjs} +2 -2
- package/src/comparators/{matches.js → matches.mjs} +2 -2
- package/src/comparators/{not.js → not.mjs} +1 -1
- package/src/comparators/{one-of.js → one-of.mjs} +1 -1
- package/src/{index.js → index.mjs} +4 -2
- package/.husky/post-commit +0 -4
- package/.husky/post-commit.cjs +0 -8
- package/.husky/post-commit.mjs +0 -5
- package/.husky/pre-commit +0 -5
- package/index.js +0 -1
- package/src/comparators/index.js +0 -11
- /package/{index.d.ts → src/index.d.mts} +0 -0
|
@@ -30,24 +30,10 @@ const presets = [
|
|
|
30
30
|
]
|
|
31
31
|
]
|
|
32
32
|
|
|
33
|
-
const plugins = [
|
|
34
|
-
'@babel/proposal-export-default-from',
|
|
35
|
-
[
|
|
36
|
-
'module-resolver', {
|
|
37
|
-
alias: {
|
|
38
|
-
'@modernpoacher/rules-runner': './src'
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
]
|
|
42
|
-
]
|
|
43
|
-
|
|
44
33
|
module.exports = (api) => {
|
|
45
34
|
if (api) api.cache.using(env)
|
|
46
35
|
|
|
47
36
|
return {
|
|
48
|
-
|
|
49
|
-
comments: false,
|
|
50
|
-
presets,
|
|
51
|
-
plugins
|
|
37
|
+
presets
|
|
52
38
|
}
|
|
53
39
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modernpoacher/rules-runner",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "A business rules engine for Node",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"business rules",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"rules engine",
|
|
11
11
|
"business rules engine"
|
|
12
12
|
],
|
|
13
|
-
"main": "./index.
|
|
14
|
-
"
|
|
13
|
+
"main": "./src/index.mjs",
|
|
14
|
+
"type": "module",
|
|
15
15
|
"author": "Jonathan Perry for Modern Poacher Limited <modernpoacher@modernpoacher.com>",
|
|
16
16
|
"contributors": [
|
|
17
17
|
{
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
],
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"engines": {
|
|
30
|
-
"node": ">=
|
|
30
|
+
"node": ">=18.5.0"
|
|
31
31
|
},
|
|
32
32
|
"repository": {
|
|
33
33
|
"type": "git",
|
|
@@ -38,40 +38,35 @@
|
|
|
38
38
|
"url": "http://github.com/modernpoacher/rules-runner/issues"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
|
-
"
|
|
42
|
-
"prebuild": "npm run clean",
|
|
43
|
-
"build": "npm run babel",
|
|
44
|
-
"build:watch": "npm run babel:watch",
|
|
45
|
-
"clean": "rimraf lib",
|
|
46
|
-
"babel": "babel src -d lib",
|
|
47
|
-
"babel:watch": "npm run babel -- -w",
|
|
48
|
-
"lint": "eslint src test *.js",
|
|
41
|
+
"lint": "eslint src test --ext .mjs --ext .cjs --ext .mts --ext .cts",
|
|
49
42
|
"lint:fix": "npm run lint -- --fix",
|
|
50
|
-
"test": "cross-env NODE_ENV=test mocha test --recursive
|
|
43
|
+
"test": "cross-env NODE_ENV=test mocha test --recursive",
|
|
44
|
+
"prepare": "npx husky install"
|
|
51
45
|
},
|
|
52
46
|
"dependencies": {
|
|
53
47
|
"debug": "^4.3.4",
|
|
54
48
|
"object-path": "^0.11.8"
|
|
55
49
|
},
|
|
56
50
|
"devDependencies": {
|
|
57
|
-
"@babel/cli": "^7.21.5",
|
|
58
51
|
"@babel/core": "^7.21.8",
|
|
59
52
|
"@babel/eslint-parser": "^7.21.8",
|
|
60
|
-
"@babel/plugin-proposal-export-default-from": "^7.18.10",
|
|
61
53
|
"@babel/preset-env": "^7.21.5",
|
|
62
|
-
"@
|
|
63
|
-
"@
|
|
64
|
-
"
|
|
54
|
+
"@modernpoacher/hooks": "^1.0.401",
|
|
55
|
+
"@typescript-eslint/eslint-plugin": "^5.59.5",
|
|
56
|
+
"@typescript-eslint/parser": "^5.59.5",
|
|
65
57
|
"chai": "^4.3.7",
|
|
66
58
|
"cross-env": "^7.0.3",
|
|
67
|
-
"eslint": "^8.
|
|
59
|
+
"eslint": "^8.40.0",
|
|
68
60
|
"eslint-config-standard": "^17.0.0",
|
|
69
|
-
"eslint-
|
|
61
|
+
"eslint-config-standard-with-typescript": "^34.0.1",
|
|
70
62
|
"eslint-plugin-import": "^2.27.5",
|
|
71
63
|
"eslint-plugin-node": "^11.1.0",
|
|
72
64
|
"eslint-plugin-promise": "^6.1.1",
|
|
73
65
|
"husky": "^8.0.3",
|
|
74
|
-
"mocha": "^10.2.0"
|
|
75
|
-
|
|
66
|
+
"mocha": "^10.2.0"
|
|
67
|
+
},
|
|
68
|
+
"imports": {
|
|
69
|
+
"#rules-runner/common": "./src/common/index.mjs",
|
|
70
|
+
"#rules-runner": "./src/index.mjs"
|
|
76
71
|
}
|
|
77
72
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import debug from 'debug'
|
|
2
2
|
|
|
3
|
-
import { toNumber } from '
|
|
3
|
+
import { toNumber } from '#rules-runner/common'
|
|
4
4
|
|
|
5
|
-
const log = debug('@modernpoacher/rules-runner
|
|
5
|
+
const log = debug('@modernpoacher/rules-runner/comparators/between')
|
|
6
6
|
|
|
7
7
|
log('`between` is awake')
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import debug from 'debug'
|
|
2
2
|
|
|
3
|
-
import { toBoolean } from '
|
|
3
|
+
import { toBoolean } from '#rules-runner/common'
|
|
4
4
|
|
|
5
|
-
const log = debug('@modernpoacher/rules-runner
|
|
5
|
+
const log = debug('@modernpoacher/rules-runner/comparators/boolean')
|
|
6
6
|
|
|
7
7
|
log('`boolean` is awake')
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import debug from 'debug'
|
|
2
2
|
|
|
3
|
-
import { toString } from '
|
|
3
|
+
import { toString } from '#rules-runner/common'
|
|
4
4
|
|
|
5
|
-
const log = debug('@modernpoacher/rules-runner
|
|
5
|
+
const log = debug('@modernpoacher/rules-runner/comparators/contains')
|
|
6
6
|
|
|
7
7
|
log('`contains` is awake')
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import debug from 'debug'
|
|
2
2
|
|
|
3
|
-
import { toNumber } from '
|
|
3
|
+
import { toNumber } from '#rules-runner/common'
|
|
4
4
|
|
|
5
|
-
const log = debug('@modernpoacher/rules-runner
|
|
5
|
+
const log = debug('@modernpoacher/rules-runner/comparators/greater-than')
|
|
6
6
|
|
|
7
7
|
log('`greaterThan` is awake')
|
|
8
8
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { default as between } from './between.mjs'
|
|
2
|
+
export { default as boolean } from './boolean.mjs'
|
|
3
|
+
export { default as contains } from './contains.mjs'
|
|
4
|
+
export { default as equals } from './equals.mjs'
|
|
5
|
+
export { default as anyOf } from './any-of.mjs'
|
|
6
|
+
export { default as allOf } from './all-of.mjs'
|
|
7
|
+
export { default as oneOf } from './one-of.mjs'
|
|
8
|
+
export { default as greaterThan } from './greater-than.mjs'
|
|
9
|
+
export { default as lessThan } from './less-than.mjs'
|
|
10
|
+
export { default as matches } from './matches.mjs'
|
|
11
|
+
export { default as not } from './not.mjs'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import debug from 'debug'
|
|
2
2
|
|
|
3
|
-
import { toNumber } from '
|
|
3
|
+
import { toNumber } from '#rules-runner/common'
|
|
4
4
|
|
|
5
|
-
const log = debug('@modernpoacher/rules-runner
|
|
5
|
+
const log = debug('@modernpoacher/rules-runner/comparators/less-than')
|
|
6
6
|
|
|
7
7
|
log('`lessThan` is awake')
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import debug from 'debug'
|
|
2
2
|
|
|
3
|
-
import { toRegExp, toString } from '
|
|
3
|
+
import { toRegExp, toString } from '#rules-runner/common'
|
|
4
4
|
|
|
5
|
-
const log = debug('@modernpoacher/rules-runner
|
|
5
|
+
const log = debug('@modernpoacher/rules-runner/comparators/matches')
|
|
6
6
|
|
|
7
7
|
log('`matches` is awake')
|
|
8
8
|
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import debug from 'debug'
|
|
2
2
|
|
|
3
3
|
import objectPath from 'object-path'
|
|
4
|
+
|
|
4
5
|
import {
|
|
5
6
|
isBoolean,
|
|
6
7
|
isObject
|
|
7
|
-
} from './common'
|
|
8
|
-
|
|
8
|
+
} from './common/index.mjs'
|
|
9
|
+
|
|
10
|
+
import * as comparators from './comparators/index.mjs'
|
|
9
11
|
|
|
10
12
|
const log = debug('@modernpoacher/rules-runner')
|
|
11
13
|
|
package/.husky/post-commit
DELETED
package/.husky/post-commit.cjs
DELETED
package/.husky/post-commit.mjs
DELETED
package/.husky/pre-commit
DELETED
package/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('./lib')
|
package/src/comparators/index.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export { default as between } from './between'
|
|
2
|
-
export { default as boolean } from './boolean'
|
|
3
|
-
export { default as contains } from './contains'
|
|
4
|
-
export { default as equals } from './equals'
|
|
5
|
-
export { default as anyOf } from './any-of'
|
|
6
|
-
export { default as allOf } from './all-of'
|
|
7
|
-
export { default as oneOf } from './one-of'
|
|
8
|
-
export { default as greaterThan } from './greater-than'
|
|
9
|
-
export { default as lessThan } from './less-than'
|
|
10
|
-
export { default as matches } from './matches'
|
|
11
|
-
export { default as not } from './not'
|
|
File without changes
|