functional-models 1.1.20 → 1.2.0
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/.eslintignore +4 -0
- package/.eslintrc +186 -0
- package/.github/workflows/feature.yml +26 -0
- package/.github/workflows/ut.yml +32 -0
- package/.prettierignore +7 -0
- package/.prettierrc.json +14 -0
- package/LICENSE +674 -0
- package/features/arrayFields.feature +52 -0
- package/features/functions.feature +11 -0
- package/features/model.feature +7 -0
- package/features/stepDefinitions/steps.js +193 -0
- package/features/validation.feature +12 -0
- package/index.js +1 -41
- package/package.json +10 -35
- package/src/constants.js +19 -0
- package/src/errors.js +16 -0
- package/src/functions.js +7 -0
- package/src/index.js +10 -0
- package/src/lazy.js +26 -0
- package/src/models.js +152 -0
- package/src/properties.js +313 -0
- package/src/serialization.js +50 -0
- package/src/utils.js +52 -0
- package/src/validation.js +285 -0
- package/test/base/index.test.js +5 -0
- package/test/src/functions.test.js +45 -0
- package/test/src/index.test.js +5 -0
- package/test/src/lazy.test.js +15 -0
- package/test/src/models.test.js +380 -0
- package/test/src/properties.test.js +554 -0
- package/test/src/serialization.test.js +127 -0
- package/test/src/utils.test.js +54 -0
- package/test/src/validation.test.js +614 -0
- package/constants.d.ts +0 -14
- package/constants.js +0 -19
- package/constants.js.map +0 -1
- package/errors.d.ts +0 -9
- package/errors.js +0 -15
- package/errors.js.map +0 -1
- package/index.d.ts +0 -10
- package/index.js.map +0 -1
- package/interfaces.d.ts +0 -160
- package/interfaces.js +0 -4
- package/interfaces.js.map +0 -1
- package/lazy.d.ts +0 -2
- package/lazy.js +0 -37
- package/lazy.js.map +0 -1
- package/methods.d.ts +0 -4
- package/methods.js +0 -18
- package/methods.js.map +0 -1
- package/models.d.ts +0 -3
- package/models.js +0 -129
- package/models.js.map +0 -1
- package/properties.d.ts +0 -16
- package/properties.js +0 -214
- package/properties.js.map +0 -1
- package/serialization.d.ts +0 -3
- package/serialization.js +0 -49
- package/serialization.js.map +0 -1
- package/utils.d.ts +0 -4
- package/utils.js +0 -44
- package/utils.js.map +0 -1
- package/validation.d.ts +0 -29
- package/validation.js +0 -292
- package/validation.js.map +0 -1
package/.eslintignore
ADDED
package/.eslintrc
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": ["eslint:recommended", "prettier"],
|
|
3
|
+
"plugins": ["import", "functional"],
|
|
4
|
+
"env": {
|
|
5
|
+
"browser": true,
|
|
6
|
+
"node": true,
|
|
7
|
+
"mocha": true,
|
|
8
|
+
"es6": true
|
|
9
|
+
},
|
|
10
|
+
"rules": {
|
|
11
|
+
"no-await-in-loop": ["error"],
|
|
12
|
+
"no-console": ["error", { "allow": ["warn", "error", "info"] }],
|
|
13
|
+
"no-constant-condition": ["error"],
|
|
14
|
+
"no-extra-parens": 0,
|
|
15
|
+
"no-extra-semi": ["error"],
|
|
16
|
+
"no-loss-of-precision": ["error"],
|
|
17
|
+
"no-promise-executor-return": ["error"],
|
|
18
|
+
"no-template-curly-in-string": ["error"],
|
|
19
|
+
"no-useless-backreference": ["error"],
|
|
20
|
+
"require-atomic-updates": ["error"],
|
|
21
|
+
|
|
22
|
+
"accessor-pairs": ["error"],
|
|
23
|
+
"array-callback-return": ["error"],
|
|
24
|
+
"block-scoped-var": ["error"],
|
|
25
|
+
"class-methods-use-this": ["error"],
|
|
26
|
+
"complexity": ["error"],
|
|
27
|
+
"consistent-return": ["error"],
|
|
28
|
+
"curly": ["error"],
|
|
29
|
+
"default-case": ["error"],
|
|
30
|
+
"default-case-last": ["error"],
|
|
31
|
+
"default-param-last": 0,
|
|
32
|
+
"dot-location": ["error", "property"],
|
|
33
|
+
"dot-notation": ["error"],
|
|
34
|
+
"eqeqeq": ["error"],
|
|
35
|
+
"grouped-accessor-pairs": ["error"],
|
|
36
|
+
"guard-for-in": ["error"],
|
|
37
|
+
"max-classes-per-file": ["error"],
|
|
38
|
+
"no-alert": ["error"],
|
|
39
|
+
"no-caller": ["error"],
|
|
40
|
+
"no-constructor-return": ["error"],
|
|
41
|
+
"no-div-regex": ["error"],
|
|
42
|
+
"no-else-return": ["error"],
|
|
43
|
+
"no-empty-function": ["error"],
|
|
44
|
+
"no-eq-null": ["error"],
|
|
45
|
+
"no-eval": ["error"],
|
|
46
|
+
"no-extend-native": ["error"],
|
|
47
|
+
"no-extra-bind": ["error"],
|
|
48
|
+
"no-extra-label": ["error"],
|
|
49
|
+
"no-floating-decimal": ["error"],
|
|
50
|
+
"no-implicit-coercion": ["error"],
|
|
51
|
+
"no-implicit-globals": ["error"],
|
|
52
|
+
"no-implied-eval": ["error"],
|
|
53
|
+
"no-invalid-this": ["error"],
|
|
54
|
+
"no-iterator": ["error"],
|
|
55
|
+
"no-labels": ["error"],
|
|
56
|
+
"no-lone-blocks": ["error"],
|
|
57
|
+
"no-loop-func": ["error"],
|
|
58
|
+
"no-magic-numbers": ["error", { "ignore": [1, -1, 0, 2] }],
|
|
59
|
+
"no-multi-spaces": ["error"],
|
|
60
|
+
"no-multi-str": ["error"],
|
|
61
|
+
"no-new": ["error"],
|
|
62
|
+
"no-new-func": ["error"],
|
|
63
|
+
"no-new-wrappers": ["error"],
|
|
64
|
+
"no-octal-escape": ["error"],
|
|
65
|
+
"no-proto": ["error"],
|
|
66
|
+
"no-restricted-properties": ["error"],
|
|
67
|
+
"no-return-assign": ["error"],
|
|
68
|
+
"no-return-await": ["error"],
|
|
69
|
+
"no-script-url": ["error"],
|
|
70
|
+
"no-self-compare": ["error"],
|
|
71
|
+
"no-sequences": ["error"],
|
|
72
|
+
"no-throw-literal": ["error"],
|
|
73
|
+
"no-unmodified-loop-condition": ["error"],
|
|
74
|
+
"no-unused-expressions": ["error"],
|
|
75
|
+
"no-useless-call": ["error"],
|
|
76
|
+
"no-useless-concat": ["error"],
|
|
77
|
+
"no-void": ["error"],
|
|
78
|
+
"no-warning-comments": ["warn"],
|
|
79
|
+
"prefer-named-capture-group": ["error"],
|
|
80
|
+
"prefer-promise-reject-errors": ["error"],
|
|
81
|
+
"prefer-regex-literals": ["error"],
|
|
82
|
+
"radix": ["error"],
|
|
83
|
+
"require-unicode-regexp": ["error"],
|
|
84
|
+
"vars-on-top": ["error"],
|
|
85
|
+
"wrap-iife": ["error"],
|
|
86
|
+
"yoda": ["error"],
|
|
87
|
+
|
|
88
|
+
"arrow-body-style": 0,
|
|
89
|
+
"eol-last": ["error", "always"],
|
|
90
|
+
"comma-dangle": 0,
|
|
91
|
+
"linebreak-style": 0,
|
|
92
|
+
"no-underscore-dangle": 0,
|
|
93
|
+
"no-unused-labels": 0,
|
|
94
|
+
"no-unused-vars": [
|
|
95
|
+
"error",
|
|
96
|
+
{
|
|
97
|
+
"vars": "all",
|
|
98
|
+
"argsIgnorePattern": "(_+)|(action)",
|
|
99
|
+
"args": "after-used",
|
|
100
|
+
"ignoreRestSiblings": false
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"object-shorthand": 0,
|
|
104
|
+
"prefer-rest-params": 0,
|
|
105
|
+
"semi": ["error", "never"],
|
|
106
|
+
|
|
107
|
+
"functional/immutable-data": [
|
|
108
|
+
"error",
|
|
109
|
+
{
|
|
110
|
+
"ignoreAccessorPattern": "module.exports*"
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
"functional/no-let": ["error"],
|
|
114
|
+
"functional/no-method-signature": ["error"],
|
|
115
|
+
"functional/prefer-readonly-type": ["error"],
|
|
116
|
+
"functional/no-class": ["error"],
|
|
117
|
+
"functional/no-mixed-type": ["error"],
|
|
118
|
+
"functional/no-this-expression": ["error"],
|
|
119
|
+
"functional/prefer-type-literal": ["error"],
|
|
120
|
+
"functional/no-conditional-statement": 0,
|
|
121
|
+
"functional/no-expression-statement": 0,
|
|
122
|
+
"functional/no-loop-statement": ["error"],
|
|
123
|
+
"functional/no-return-void": ["error"],
|
|
124
|
+
"functional/no-promise-reject": 0,
|
|
125
|
+
"functional/no-throw-statement": 0,
|
|
126
|
+
"functional/no-try-statement": ["error"],
|
|
127
|
+
"functional/functional-parameters": 0,
|
|
128
|
+
|
|
129
|
+
"import/no-unresolved": ["error"],
|
|
130
|
+
"import/named": ["error"],
|
|
131
|
+
"import/default": ["error"],
|
|
132
|
+
"import/namespace": ["error"],
|
|
133
|
+
"import/no-restricted-paths": ["error"],
|
|
134
|
+
"import/no-absolute-path": ["error"],
|
|
135
|
+
"import/no-dynamic-require": ["error"],
|
|
136
|
+
"import/no-internal-modules": 0,
|
|
137
|
+
"import/no-webpack-loader-syntax": ["error"],
|
|
138
|
+
"import/no-self-import": ["error"],
|
|
139
|
+
"import/no-cycle": ["error"],
|
|
140
|
+
"import/no-useless-path-segments": ["error"],
|
|
141
|
+
"import/no-relative-parent-imports": 0,
|
|
142
|
+
|
|
143
|
+
"import/export": ["error"],
|
|
144
|
+
"import/no-named-as-default": ["error"],
|
|
145
|
+
"import/no-named-as-default-member": ["error"],
|
|
146
|
+
"import/no-deprecated": ["error"],
|
|
147
|
+
"import/no-extraneous-dependencies": ["error"],
|
|
148
|
+
"import/no-mutable-exports": ["error"],
|
|
149
|
+
"import/no-unused-modules": ["error"],
|
|
150
|
+
|
|
151
|
+
"import/unambiguous": ["error"],
|
|
152
|
+
"import/no-commonjs": 0,
|
|
153
|
+
"import/no-amd": ["error"],
|
|
154
|
+
"import/no-nodejs-modules": 0,
|
|
155
|
+
|
|
156
|
+
"import/first": ["error"],
|
|
157
|
+
"import/exports-last": ["error"],
|
|
158
|
+
"import/no-duplicates": ["error"],
|
|
159
|
+
"import/no-namespace": ["error"],
|
|
160
|
+
"import/extensions": ["error"],
|
|
161
|
+
"import/order": ["error"],
|
|
162
|
+
"import/newline-after-import": ["error"],
|
|
163
|
+
"import/prefer-default-export": 0,
|
|
164
|
+
"import/max-dependencies": ["error"],
|
|
165
|
+
"import/no-unassigned-import": ["error"],
|
|
166
|
+
"import/no-named-default": 0,
|
|
167
|
+
"import/no-named-export": 0,
|
|
168
|
+
"import/no-anonymous-default-export": 0,
|
|
169
|
+
"import/group-exports": ["error"],
|
|
170
|
+
"import/dynamic-import-chuckname": 0
|
|
171
|
+
},
|
|
172
|
+
"settings": {
|
|
173
|
+
"import/ignore": ["node_modules"],
|
|
174
|
+
"import/resolver": {
|
|
175
|
+
"node": {
|
|
176
|
+
"extensions": [".js", ".jsx", ".ts", ".tsx"]
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
"parserOptions": {
|
|
181
|
+
"ecmaFeatures": {
|
|
182
|
+
"jsx": true
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
"parser": "babel-eslint"
|
|
186
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: Feature Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [master]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
strategy:
|
|
14
|
+
matrix:
|
|
15
|
+
node-version: [12.x, 14.x, 15.x]
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v2
|
|
19
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
20
|
+
uses: actions/setup-node@v2
|
|
21
|
+
with:
|
|
22
|
+
node-version: ${{ matrix.node-version }}
|
|
23
|
+
- name: Install dependencies
|
|
24
|
+
run: npm install
|
|
25
|
+
- name: Run Cucumber Tests
|
|
26
|
+
run: npm run feature-tests
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: Unit Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [master]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
strategy:
|
|
14
|
+
matrix:
|
|
15
|
+
node-version: [12.x, 14.x, 15.x]
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v2
|
|
19
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
20
|
+
uses: actions/setup-node@v2
|
|
21
|
+
with:
|
|
22
|
+
node-version: ${{ matrix.node-version }}
|
|
23
|
+
- name: Install dependencies
|
|
24
|
+
run: npm install
|
|
25
|
+
- name: Run Unit Tests
|
|
26
|
+
run: npm test
|
|
27
|
+
- run: npm run coverage
|
|
28
|
+
|
|
29
|
+
- name: Coveralls
|
|
30
|
+
uses: coverallsapp/github-action@master
|
|
31
|
+
with:
|
|
32
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
package/.prettierignore
ADDED
package/.prettierrc.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tabWidth": 2,
|
|
3
|
+
"semi": false,
|
|
4
|
+
"singleQuote": true,
|
|
5
|
+
"quoteProps": "as-needed",
|
|
6
|
+
"jsxSingleQuote": false,
|
|
7
|
+
"trailingComma": "es5",
|
|
8
|
+
"bracketSpacing": true,
|
|
9
|
+
"jsxBracketSameLine": true,
|
|
10
|
+
"arrowParens": "avoid",
|
|
11
|
+
"requirePragma": false,
|
|
12
|
+
"proseWrap": "preserve",
|
|
13
|
+
"endOfLine": "lf"
|
|
14
|
+
}
|