@envelop/core 3.0.0 → 3.0.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/cjs/orchestrator.js
CHANGED
|
@@ -150,9 +150,6 @@ function createEnvelopOrchestrator({ plugins, }) {
|
|
|
150
150
|
validateFn,
|
|
151
151
|
addValidationRule: rule => {
|
|
152
152
|
if (!actualRules) {
|
|
153
|
-
// Ideally we should provide default validation rules here.
|
|
154
|
-
// eslint-disable-next-line no-console
|
|
155
|
-
console.warn('No default validation rules provided.');
|
|
156
153
|
actualRules = [];
|
|
157
154
|
}
|
|
158
155
|
actualRules.push(rule);
|
|
@@ -13,10 +13,11 @@ const useEngine = (engine) => {
|
|
|
13
13
|
setParseFn(engine.parse);
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
|
-
onValidate: ({ setValidationFn }) => {
|
|
16
|
+
onValidate: ({ setValidationFn, addValidationRule }) => {
|
|
17
17
|
if (engine.validate) {
|
|
18
18
|
setValidationFn(engine.validate);
|
|
19
19
|
}
|
|
20
|
+
engine.specifiedRules?.map(addValidationRule);
|
|
20
21
|
},
|
|
21
22
|
onSubscribe: ({ setSubscribeFn }) => {
|
|
22
23
|
if (engine.subscribe) {
|
package/esm/orchestrator.js
CHANGED
|
@@ -147,9 +147,6 @@ export function createEnvelopOrchestrator({ plugins, }) {
|
|
|
147
147
|
validateFn,
|
|
148
148
|
addValidationRule: rule => {
|
|
149
149
|
if (!actualRules) {
|
|
150
|
-
// Ideally we should provide default validation rules here.
|
|
151
|
-
// eslint-disable-next-line no-console
|
|
152
|
-
console.warn('No default validation rules provided.');
|
|
153
150
|
actualRules = [];
|
|
154
151
|
}
|
|
155
152
|
actualRules.push(rule);
|
|
@@ -10,10 +10,11 @@ export const useEngine = (engine) => {
|
|
|
10
10
|
setParseFn(engine.parse);
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
|
-
onValidate: ({ setValidationFn }) => {
|
|
13
|
+
onValidate: ({ setValidationFn, addValidationRule }) => {
|
|
14
14
|
if (engine.validate) {
|
|
15
15
|
setValidationFn(engine.validate);
|
|
16
16
|
}
|
|
17
|
+
engine.specifiedRules?.map(addValidationRule);
|
|
17
18
|
},
|
|
18
19
|
onSubscribe: ({ setSubscribeFn }) => {
|
|
19
20
|
if (engine.subscribe) {
|
package/package.json
CHANGED