andreypopp / andreypopp/validated
Incompatible with Flow 100
- Lingua principale
- JavaScript
- Stelle
- 91
- Fork
- 14
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
```
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ node_modules/validated/lib/schema.js.flow:165:14
Cannot return context.unwrap(...) because mixed [1] is incompatible with V [2] in type argument V [3].
[3] 26│ export type ValidateResult = {
:
[1] 58│ unwrap(_validate: (value: mixed) => V): ValidateResult {
:
157│
158│ export class AnyNode extends Node<$NonMaybeType> {
[2] 159│ validate(context: Context): ValidateResult<$NonMaybeType> {
160│ return context.unwrap(value => {
161│ if (value == null) {
162│ let repr = value === null ? 'null' : 'undefined';
163│ throw context.error(`Expected a value but got ${repr}`);
164│ }
165│ return value;
166│ });
167│ }
168│ }
169│
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ node_modules/validated/lib/schema.js.flow:186:23
Cannot coerce JSON.stringify(...) to string because undefined [1] should not be coerced.
node_modules/validated/lib/schema.js.flow
183│ return context.unwrap(value => {
184│ if (!this.eq(value, this.value)) {
185│ throw context.error(
186│ `Expected ${JSON.stringify(this.value)} but got ${JSON.stringify(value)}`,
187│ );
188│ }
189│ return (value: any);
/private/tmp/flow/flowlib_389356b1/core.js
[1] 509│ ): string | void;
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ node_modules/validated/lib/schema.js.flow:186:61
Cannot coerce JSON.stringify(...) to string because undefined [1] should not be coerced.
node_modules/validated/lib/schema.js.flow
183│ return context.unwrap(value => {
184│ if (!this.eq(value, this.value)) {
185│ throw context.error(
186│ `Expected ${JSON.stringify(this.value)} but got ${JSON.stringify(value)}`,
187│ );
188│ }
189│ return (value: any);
/private/tmp/flow/flowlib_389356b1/core.js
[1] 509│ ): string | void;
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ node_modules/validated/lib/schema.js.flow:378:81
Cannot coerce repr to string because undefined [1] should not be coerced.
node_modules/validated/lib/schema.js.flow
375│ }
376│ let expectation = this.values.map(v => JSON.stringify(v)).join(', ');
377│ let repr = JSON.stringify(value);
378│ throw context.error(`Expected value to be one of ${expectation} but got ${repr}`);
379│ });
380│ }
381│ }
/private/tmp/flow/flowlib_389356b1/core.js
[1] 509│ ): string | void;
```
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.