Skip to content

Commit 00f85b8

Browse files
committed
typos
1 parent f29ed33 commit 00f85b8

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

README.md

+17-17
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ json separate from validating it, via the `cast` method.
8888

8989
You define and create schema objects. Schema objects are immutable, so each call of a method returns a _new_ schema object.
9090

91+
__try it out using tonicdev! https://tonicdev.com/570c52590a85f71200eb09ba/yup__
9192
```js
9293
var yup = require('yup')
9394

@@ -142,7 +143,7 @@ yup.addMethod
142143
yup.ValidationError
143144
```
144145

145-
#### `.reach(schema: Schema, path: string, value: ?object, context: ?object): Schema`
146+
#### `yup.reach(schema: Schema, path: string, value: ?object, context: ?object): Schema`
146147

147148
For nested schema's `yup.reach` will retrieve a nested schema based on the provided path.
148149

@@ -164,7 +165,7 @@ reach(schema, 'nested.arr[1].num')
164165
reach(schema, 'nested["arr"][1].num')
165166
```
166167

167-
#### `.addMethod(schemaType: Schema, name: string, method: ()=> Schema): void`
168+
#### `yup.addMethod(schemaType: Schema, name: string, method: ()=> Schema): void`
168169

169170
Adds a new method to the core schema types. A friendlier convenience method for `schemaType.prototype[name] = method`.
170171

@@ -182,17 +183,7 @@ Adds a new method to the core schema types. A friendlier convenience method for
182183
})
183184
```
184185

185-
#### `ValidationError(errors: string | Array<string>, value: any, path: string)`
186-
187-
Thrown on failed validations, with the following properties
188-
- `name`: "ValidationError"
189-
- `path`: a string, indicating where there error was thrown. `path` is empty at the root level.
190-
- `errors`: array of error messages
191-
- `inner`: in the case of aggregate errors, inner is an array of `ValidationErrors` throw earlier in the
192-
validation chain. When the `abortEarly` option is `false` this is where you can inspect each error thrown,
193-
alternatively `errors` will have all the of the messages from each inner error.
194-
195-
#### `ref(path: string, options: { contextPrefix: string }): Ref`
186+
#### `yup.ref(path: string, options: { contextPrefix: string }): Ref`
196187

197188
Creates a reference to another sibling or sibling descendant field. Ref's are resolved
198189
at _run time_ and supported where specified. Ref's are evaluated in in the proper order so that
@@ -211,6 +202,15 @@ inst.cast({ foo: { bar: 'boom' } }, { context: { x: 5 } })
211202
// { baz: 'boom', x: 5, { foo: { bar: 'boom' } }, }
212203
```
213204

205+
#### `ValidationError(errors: string | Array<string>, value: any, path: string)`
206+
207+
Thrown on failed validations, with the following properties
208+
- `name`: "ValidationError"
209+
- `path`: a string, indicating where there error was thrown. `path` is empty at the root level.
210+
- `errors`: array of error messages
211+
- `inner`: in the case of aggregate errors, inner is an array of `ValidationErrors` throw earlier in the
212+
validation chain. When the `abortEarly` option is `false` this is where you can inspect each error thrown,
213+
alternatively `errors` will have all the of the messages from each inner error.
214214

215215
### mixed
216216

@@ -701,7 +701,7 @@ Value must be a negative number.
701701
Transformation that coerces the value into an integer via truncation
702702
` value | 0`. If `strict()` is set it will only validate that the value is an integer.
703703
704-
#### `round(type: 'floor' | 'ceil' | 'round' = 'round'): Schema`
704+
#### `number.round(type: 'floor' | 'ceil' | 'round' = 'round'): Schema`
705705
706706
Rounds the value by the specified method (defaults to 'round').
707707
@@ -758,7 +758,7 @@ array().of(number())
758758
array(number())
759759
```
760760
761-
### `array.of(type: Schema): Schema`
761+
#### `array.of(type: Schema): Schema`
762762
763763
Specify the schema of array elements. `of()` is optional and when omitted the array schema will
764764
not validate its contents.
@@ -776,7 +776,7 @@ Set an minimum length limit for the array. The `${min}` interpolation can be use
776776
777777
Set an maximum length limit for the array. The `${max}` interpolation can be used in the `message` argument.
778778
779-
### `array.ensure(): Schema`
779+
#### `array.ensure(): Schema`
780780
781781
Ensures that the value is an array, by setting the default to `[]` and transforming `null` and `undefined`
782782
values to an empty array as well. Any non-empty, non-array value will be wrapped in an array.
@@ -787,7 +787,7 @@ array().ensure().cast(1) // -> [1]
787787
array().ensure().cast([1]) // -> [1]
788788
```
789789
790-
### `array.compact(rejector: (value) => boolean): Schema`
790+
#### `array.compact(rejector: (value) => boolean): Schema`
791791
792792
Removes falsey values from the array. Providing a rejecter function lets you specify the rejection criteria yourself.
793793

0 commit comments

Comments
 (0)