Skip to content

Commit 6e3d353

Browse files
committed
Fix for nested props after required is used #31
1 parent 1a88876 commit 6e3d353

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: node_js
22

33
node_js:
4-
- "11"
4+
- "11.10.1" # tmp workaround https://stackoverflow.com/questions/55059748/travis-jest-typeerror-cannot-assign-to-read-only-property-symbolsymbol-tostr
55
- "10"
66
- "8"

src/BaseSchema.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@
22
const {
33
flat,
44
omit,
5-
hasCombiningKeywords,
65
isFluentSchema,
76
last,
87
patchIdsWithParentId,
9-
valueOf,
10-
FORMATS,
118
REQUIRED,
129
setAttribute,
1310
setComposeType,
@@ -162,7 +159,7 @@ const BaseSchema = (
162159
: [REQUIRED]
163160
return options.factory({
164161
schema: { ...schema, required },
165-
options,
162+
...options,
166163
})
167164
},
168165

src/BaseSchema.test.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,12 @@ describe('BaseSchema', () => {
126126
const prop = 'foo'
127127
expect(
128128
S.object()
129-
.prop(prop, S.string().required())
129+
.prop(
130+
prop,
131+
S.string()
132+
.required()
133+
.minLength(3)
134+
)
130135
.valueOf().required
131136
).toEqual([prop])
132137
})

0 commit comments

Comments
 (0)