@orioro/util 0.0.0 → 0.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/README.md +1 -0
- package/babel.config.cjs +13 -0
- package/coverage/clover.xml +488 -45
- package/coverage/coverage-final.json +28 -2
- package/coverage/lcov-report/ValidationError.ts.html +184 -0
- package/coverage/lcov-report/base.css +19 -7
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +248 -58
- package/coverage/lcov-report/prettify.js +1 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +52 -14
- package/coverage/lcov-report/src/debug/deepFreeze.ts.html +157 -0
- package/coverage/lcov-report/src/debug/index.html +146 -0
- package/coverage/lcov-report/src/debug/index.ts.html +91 -0
- package/coverage/lcov-report/src/debug/wait.ts.html +127 -0
- package/coverage/lcov-report/src/index.html +131 -0
- package/coverage/lcov-report/src/interpolate/index.html +116 -0
- package/coverage/lcov-report/src/interpolate/index.ts.html +277 -0
- package/coverage/lcov-report/src/maybeFn.ts.html +94 -0
- package/coverage/lcov-report/src/promise/index.html +146 -0
- package/coverage/lcov-report/src/promise/index.ts.html +91 -0
- package/coverage/lcov-report/src/promise/promiseReduce.ts.html +130 -0
- package/coverage/lcov-report/src/promise/resolveNestedPromises.ts.html +271 -0
- package/coverage/lcov-report/src/switchValue.ts.html +253 -0
- package/coverage/lcov-report/src/typeOf.ts.html +328 -0
- package/coverage/lcov-report/src/validate/ValidationError.ts.html +184 -0
- package/coverage/lcov-report/src/validate/async/index.html +131 -0
- package/coverage/lcov-report/src/validate/async/index.ts.html +241 -0
- package/coverage/lcov-report/src/validate/async/parseValidator.ts.html +136 -0
- package/coverage/lcov-report/src/validate/async/validateAsyncFn.ts.html +208 -0
- package/coverage/lcov-report/src/validate/async/validators/and.ts.html +154 -0
- package/coverage/lcov-report/src/validate/async/validators/index.html +146 -0
- package/coverage/lcov-report/src/validate/async/validators/index.ts.html +91 -0
- package/coverage/lcov-report/src/validate/async/validators/logical.ts.html +253 -0
- package/coverage/lcov-report/src/validate/async/validators/or.ts.html +151 -0
- package/coverage/lcov-report/src/validate/async/validators/shape.ts.html +565 -0
- package/coverage/lcov-report/src/validate/common/ValidationError.ts.html +184 -0
- package/coverage/lcov-report/src/validate/common/index.html +116 -0
- package/coverage/lcov-report/src/validate/common/util/defaultErrorMessage.ts.html +163 -0
- package/coverage/lcov-report/src/validate/common/util/index.html +161 -0
- package/coverage/lcov-report/src/validate/common/util/index.ts.html +94 -0
- package/coverage/lcov-report/src/validate/common/util/parseValidator.ts.html +316 -0
- package/coverage/lcov-report/src/validate/common/util/parseValidatorInput.ts.html +316 -0
- package/coverage/lcov-report/src/validate/common/util/resolveValidationResult.ts.html +277 -0
- package/coverage/lcov-report/src/validate/common/util/validatorParser.ts.html +316 -0
- package/coverage/lcov-report/src/validate/common/validators/index.html +131 -0
- package/coverage/lcov-report/src/validate/common/validators/index.ts.html +88 -0
- package/coverage/lcov-report/src/validate/common/validators/type.ts.html +388 -0
- package/coverage/lcov-report/src/validate/fmtValidationResult.ts.html +268 -0
- package/coverage/lcov-report/src/validate/index.html +116 -0
- package/coverage/lcov-report/src/validate/index.ts.html +94 -0
- package/coverage/lcov-report/src/validate/makeValidate.ts.html +634 -0
- package/coverage/lcov-report/src/validate/specUtil/commonTests.js.html +1324 -0
- package/coverage/lcov-report/src/validate/specUtil/index.html +116 -0
- package/coverage/lcov-report/src/validate/sync/index.html +131 -0
- package/coverage/lcov-report/src/validate/sync/index.ts.html +244 -0
- package/coverage/lcov-report/src/validate/sync/parseValidator.ts.html +136 -0
- package/coverage/lcov-report/src/validate/sync/validateSyncFn.ts.html +223 -0
- package/coverage/lcov-report/src/validate/sync/validators/and.ts.html +148 -0
- package/coverage/lcov-report/src/validate/sync/validators/index.html +146 -0
- package/coverage/lcov-report/src/validate/sync/validators/index.ts.html +91 -0
- package/coverage/lcov-report/src/validate/sync/validators/logical.ts.html +226 -0
- package/coverage/lcov-report/src/validate/sync/validators/or.ts.html +130 -0
- package/coverage/lcov-report/src/validate/sync/validators/shape.ts.html +523 -0
- package/coverage/lcov-report/src/validate/sync/validators/type.ts.html +154 -0
- package/coverage/lcov-report/src/validate/syncValidators/and.ts.html +157 -0
- package/coverage/lcov-report/src/validate/syncValidators/index.html +176 -0
- package/coverage/lcov-report/src/validate/syncValidators/index.ts.html +97 -0
- package/coverage/lcov-report/src/validate/syncValidators/or.ts.html +127 -0
- package/coverage/lcov-report/src/validate/syncValidators/shape.ts.html +559 -0
- package/coverage/lcov-report/src/validate/syncValidators/string.ts.html +163 -0
- package/coverage/lcov-report/src/validate/syncValidators/type.ts.html +154 -0
- package/coverage/lcov-report/src/validate/util/defaultErrorMessage.ts.html +169 -0
- package/coverage/lcov-report/src/validate/util/index.html +146 -0
- package/coverage/lcov-report/src/validate/util/index.ts.html +91 -0
- package/coverage/lcov-report/src/validate/util/resolveValidationResult.ts.html +253 -0
- package/coverage/lcov-report/src/validate/validate.ts.html +220 -0
- package/coverage/lcov-report/src/validate/validateAsync.ts.html +220 -0
- package/coverage/lcov-report/src/validate/validators/and.ts.html +157 -0
- package/coverage/lcov-report/src/validate/validators/index.html +176 -0
- package/coverage/lcov-report/src/validate/validators/index.ts.html +97 -0
- package/coverage/lcov-report/src/validate/validators/or.ts.html +127 -0
- package/coverage/lcov-report/src/validate/validators/shape.ts.html +541 -0
- package/coverage/lcov-report/src/validate/validators/type.ts.html +154 -0
- package/coverage/lcov-report/src/validate_/ValidationError.ts.html +184 -0
- package/coverage/lcov-report/src/validate_/fmtValidationResult.ts.html +268 -0
- package/coverage/lcov-report/src/validate_/index.html +161 -0
- package/coverage/lcov-report/src/validate_/makeValidate.ts.html +634 -0
- package/coverage/lcov-report/src/validate_/validate.ts.html +220 -0
- package/coverage/lcov-report/switchValue.ts.html +253 -0
- package/coverage/lcov-report/typeOf.ts.html +331 -0
- package/coverage/lcov-report/validate.ts.html +757 -0
- package/coverage/lcov.info +1045 -74
- package/dist/index.mjs +1437 -73
- package/jest.config.js +6 -0
- package/package.json +27 -27
- package/rollup.config.mjs +6 -0
- package/src/PromiseLikeEventEmitter/index.ts +35 -0
- package/src/array/arrayChunk.ts +7 -0
- package/src/array/index.ts +1 -0
- package/src/debug/debugFn/index.ts +48 -0
- package/src/debug/debugFn/util.ts +27 -0
- package/src/debug/deepFreeze.ts +26 -0
- package/src/debug/index.ts +3 -0
- package/src/debug/wait.ts +14 -0
- package/src/index.ts +9 -0
- package/src/interpolate/index.spec.ts +20 -0
- package/src/interpolate/index.ts +64 -0
- package/src/maybeFn.ts +3 -0
- package/src/promise/batchFn.spec.ts +92 -0
- package/src/promise/batchFn.ts +176 -0
- package/src/promise/index.ts +3 -0
- package/src/promise/promiseReduce.ts +15 -0
- package/src/promise/resolveNestedPromises.spec.ts +205 -0
- package/src/promise/resolveNestedPromises.ts +83 -0
- package/src/promise/types.ts +2 -0
- package/src/resolvePaths/index.spec.ts +42 -0
- package/src/resolvePaths/index.ts +21 -0
- package/src/switchValue.spec.ts +30 -0
- package/src/switchValue.ts +59 -0
- package/src/typeOf.spec.ts +47 -0
- package/src/typeOf.ts +81 -0
- package/src/validate/__snapshots__/index.spec.ts.snap +9 -0
- package/src/validate/async/index.spec.ts +236 -0
- package/src/validate/async/index.ts +52 -0
- package/src/validate/async/validateAsyncFn.ts +41 -0
- package/src/validate/async/validators/index.ts +2 -0
- package/src/validate/async/validators/logical.ts +56 -0
- package/src/validate/async/validators/shape.ts +160 -0
- package/src/validate/async/validators/tmpand.ts +24 -0
- package/src/validate/async/validators/tmpor.ts +21 -0
- package/src/validate/common/ValidationError.ts +33 -0
- package/src/validate/common/util/defaultErrorMessage.ts +26 -0
- package/src/validate/common/util/index.ts +3 -0
- package/src/validate/common/util/parseValidatorInput.ts +77 -0
- package/src/validate/common/util/resolveValidationResult.ts +64 -0
- package/src/validate/common/validators/index.ts +1 -0
- package/src/validate/common/validators/type.ts +101 -0
- package/src/validate/index.spec.ts +5 -0
- package/src/validate/index.ts +3 -0
- package/src/validate/specUtil/commonTests.js +413 -0
- package/src/validate/sync/index.spec.ts +81 -0
- package/src/validate/sync/index.ts +53 -0
- package/src/validate/sync/validateSyncFn.ts +46 -0
- package/src/validate/sync/validators/index.ts +2 -0
- package/src/validate/sync/validators/logical.ts +47 -0
- package/src/validate/sync/validators/shape.ts +146 -0
- package/src/validate/types/async.ts +20 -0
- package/src/validate/types/common.ts +70 -0
- package/src/validate/types/index.ts +3 -0
- package/src/validate/types/sync.ts +20 -0
- package/tsconfig.json +11 -0
- package/array/index.js +0 -11
- package/coverage/lcov-report/array/index.html +0 -93
- package/coverage/lcov-report/array/index.js.html +0 -98
- package/coverage/lcov-report/coverage/coverage-final.json.html +0 -95
- package/coverage/lcov-report/coverage/index.html +0 -93
- package/coverage/lcov-report/coverage/lcov-report/index.html +0 -106
- package/coverage/lcov-report/coverage/lcov-report/prettify.js.html +0 -68
- package/coverage/lcov-report/coverage/lcov-report/sorter.js.html +0 -539
- package/coverage/lcov-report/fn/index.html +0 -93
- package/coverage/lcov-report/fn/index.js.html +0 -215
- package/dist/index.js +0 -116
- package/fn/index.js +0 -50
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
|
|
2
|
+
<!doctype html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
|
|
5
|
+
<head>
|
|
6
|
+
<title>Code coverage report for src/validate/validators/or.ts</title>
|
|
7
|
+
<meta charset="utf-8" />
|
|
8
|
+
<link rel="stylesheet" href="../../../prettify.css" />
|
|
9
|
+
<link rel="stylesheet" href="../../../base.css" />
|
|
10
|
+
<link rel="shortcut icon" type="image/x-icon" href="../../../favicon.png" />
|
|
11
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
12
|
+
<style type='text/css'>
|
|
13
|
+
.coverage-summary .sorter {
|
|
14
|
+
background-image: url(../../../sort-arrow-sprite.png);
|
|
15
|
+
}
|
|
16
|
+
</style>
|
|
17
|
+
</head>
|
|
18
|
+
|
|
19
|
+
<body>
|
|
20
|
+
<div class='wrapper'>
|
|
21
|
+
<div class='pad1'>
|
|
22
|
+
<h1><a href="../../../index.html">All files</a> / <a href="index.html">src/validate/validators</a> or.ts</h1>
|
|
23
|
+
<div class='clearfix'>
|
|
24
|
+
|
|
25
|
+
<div class='fl pad1y space-right2'>
|
|
26
|
+
<span class="strong">100% </span>
|
|
27
|
+
<span class="quiet">Statements</span>
|
|
28
|
+
<span class='fraction'>4/4</span>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
<div class='fl pad1y space-right2'>
|
|
33
|
+
<span class="strong">100% </span>
|
|
34
|
+
<span class="quiet">Branches</span>
|
|
35
|
+
<span class='fraction'>0/0</span>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
<div class='fl pad1y space-right2'>
|
|
40
|
+
<span class="strong">100% </span>
|
|
41
|
+
<span class="quiet">Functions</span>
|
|
42
|
+
<span class='fraction'>3/3</span>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
<div class='fl pad1y space-right2'>
|
|
47
|
+
<span class="strong">100% </span>
|
|
48
|
+
<span class="quiet">Lines</span>
|
|
49
|
+
<span class='fraction'>4/4</span>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
<p class="quiet">
|
|
55
|
+
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
|
+
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input oninput="onInput()" type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
63
|
+
</div>
|
|
64
|
+
<div class='status-line high'></div>
|
|
65
|
+
<pre><table class="coverage">
|
|
66
|
+
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
67
|
+
<a name='L2'></a><a href='#L2'>2</a>
|
|
68
|
+
<a name='L3'></a><a href='#L3'>3</a>
|
|
69
|
+
<a name='L4'></a><a href='#L4'>4</a>
|
|
70
|
+
<a name='L5'></a><a href='#L5'>5</a>
|
|
71
|
+
<a name='L6'></a><a href='#L6'>6</a>
|
|
72
|
+
<a name='L7'></a><a href='#L7'>7</a>
|
|
73
|
+
<a name='L8'></a><a href='#L8'>8</a>
|
|
74
|
+
<a name='L9'></a><a href='#L9'>9</a>
|
|
75
|
+
<a name='L10'></a><a href='#L10'>10</a>
|
|
76
|
+
<a name='L11'></a><a href='#L11'>11</a>
|
|
77
|
+
<a name='L12'></a><a href='#L12'>12</a>
|
|
78
|
+
<a name='L13'></a><a href='#L13'>13</a>
|
|
79
|
+
<a name='L14'></a><a href='#L14'>14</a>
|
|
80
|
+
<a name='L15'></a><a href='#L15'>15</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
81
|
+
<span class="cline-any cline-neutral"> </span>
|
|
82
|
+
<span class="cline-any cline-neutral"> </span>
|
|
83
|
+
<span class="cline-any cline-neutral"> </span>
|
|
84
|
+
<span class="cline-any cline-neutral"> </span>
|
|
85
|
+
<span class="cline-any cline-neutral"> </span>
|
|
86
|
+
<span class="cline-any cline-yes">2x</span>
|
|
87
|
+
<span class="cline-any cline-yes">6x</span>
|
|
88
|
+
<span class="cline-any cline-yes">10x</span>
|
|
89
|
+
<span class="cline-any cline-neutral"> </span>
|
|
90
|
+
<span class="cline-any cline-neutral"> </span>
|
|
91
|
+
<span class="cline-any cline-yes">6x</span>
|
|
92
|
+
<span class="cline-any cline-neutral"> </span>
|
|
93
|
+
<span class="cline-any cline-neutral"> </span>
|
|
94
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { ValidateFnSync, ValidatorFnSync } from '../types'
|
|
95
|
+
|
|
96
|
+
//
|
|
97
|
+
// Or operator (serial)
|
|
98
|
+
//
|
|
99
|
+
export function or(validators: ValidatorFnSync[]) {
|
|
100
|
+
return function validateOr(input: any, validate: ValidateFnSync) {
|
|
101
|
+
const someIsValid = validators.some(
|
|
102
|
+
(validator) => validate(validator, input) === true,
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
return someIsValid
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
</pre></td></tr></table></pre>
|
|
109
|
+
|
|
110
|
+
<div class='push'></div><!-- for sticky footer -->
|
|
111
|
+
</div><!-- /wrapper -->
|
|
112
|
+
<div class='footer quiet pad2 space-top1 center small'>
|
|
113
|
+
Code coverage generated by
|
|
114
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
115
|
+
at 2024-05-02T02:01:52.775Z
|
|
116
|
+
</div>
|
|
117
|
+
<script src="../../../prettify.js"></script>
|
|
118
|
+
<script>
|
|
119
|
+
window.onload = function () {
|
|
120
|
+
prettyPrint();
|
|
121
|
+
};
|
|
122
|
+
</script>
|
|
123
|
+
<script src="../../../sorter.js"></script>
|
|
124
|
+
<script src="../../../block-navigation.js"></script>
|
|
125
|
+
</body>
|
|
126
|
+
</html>
|
|
127
|
+
|