@projectcaluma/ember-core 11.0.0-beta.1 → 11.0.0-beta.25

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/addon/utils/or.js DELETED
@@ -1,40 +0,0 @@
1
- import { isPromise } from "validated-changeset";
2
-
3
- function isTrue(value) {
4
- return value === true;
5
- }
6
-
7
- function handleResult(result) {
8
- if (isTrue(result)) throw true;
9
- return result;
10
- }
11
-
12
- /**
13
- * Copied and updated from nucleartide/ember-changeset-hofs
14
- * @module or
15
- */
16
- export default function or(...validators) {
17
- return (key, newValue, oldValue, changes, object) => {
18
- let validation;
19
-
20
- for (let i = 0; i < validators.length; i++) {
21
- validation = validators[i](key, newValue, oldValue, changes, object);
22
-
23
- if (isPromise(validation)) {
24
- let promise = validation.then(handleResult);
25
-
26
- for (let j = i + 1; j < validators.length; j++) {
27
- promise = promise
28
- .then(() => validators[j](key, newValue, oldValue, changes, object))
29
- .then(handleResult);
30
- }
31
-
32
- return promise.catch((err) => err);
33
- }
34
-
35
- if (isTrue(validation)) return true;
36
- }
37
-
38
- return validation;
39
- };
40
- }
@@ -1 +0,0 @@
1
- export { default } from "@projectcaluma/ember-core/services/validator";
package/app/utils/and.js DELETED
@@ -1 +0,0 @@
1
- export { default } from "@projectcaluma/ember-core/utils/and";
package/app/utils/or.js DELETED
@@ -1 +0,0 @@
1
- export { default } from "@projectcaluma/ember-core/utils/or";