Skip to content

Commit 0ce418e

Browse files
committed
Style.
1 parent 20ed351 commit 0ce418e

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -308,39 +308,39 @@ The following methods will call `s.string` with additional constraints added:
308308
```
309309
* s.uuidString
310310
```javascript
311-
const schema = s.uuidString();
312-
s.parse(schema, '0ff5d941-f46a-4f4a-aec8-1d1ec117e2a3'); // '0ff5d941-f46a-4f4a-aec8-1d1ec117e2a3'
313-
s.parse(schema, '0ff5d941'); // ERROR
311+
const uuidSchema = s.uuidString();
312+
uuidSchema('0ff5d941-f46a-4f4a-aec8-1d1ec117e2a3'); // '0ff5d941-f46a-4f4a-aec8-1d1ec117e2a3'
313+
uuidSchema('0ff5d941'); // ERROR
314314
```
315315
* s.urlString
316316
```javascript
317-
const schema = s.urlString();
318-
s.parse(schema, 'https://example.com'); // 'https://example.com'
319-
s.parse(schema, 'not a url'); // ERROR
317+
const urlSchema = s.urlString();
318+
urlSchema('https://example.com'); // 'https://example.com'
319+
urlSchema('not a url'); // ERROR
320320
```
321321
* s.emailString
322322
```javascript
323-
const schema = s.emailString();
324-
s.parse(schema, '[email protected]'); // 'https://example.com'
325-
s.parse(schema, 'not an email'); // ERROR
323+
const emailSchema = s.emailString();
324+
emailSchema('[email protected]'); // 'https://example.com'
325+
emailSchema('not an email'); // ERROR
326326
```
327327
* s.regexString
328328
```javascript
329-
const schema = s.regexString();
330-
s.parse(schema, '.+?'); // 'https://example.com'
331-
s.parse(schema, '+++'); // ERROR
329+
const regexSchema = s.regexString();
330+
regexSchema('.+?'); // 'https://example.com'
331+
regexSchema('+++'); // ERROR
332332
```
333333
* s.base64String
334334
```javascript
335-
const schema = s.base64String();
336-
s.parse(schema, 'RXhhbXBsZSBzdHJpbmc='); // 'RXhhbXBsZSBzdHJpbmc=';
337-
s.parse(schema, 'notbase64'); // ERROR;
335+
const base64Schema = s.base64String();
336+
base64Schema('RXhhbXBsZSBzdHJpbmc='); // 'RXhhbXBsZSBzdHJpbmc=';
337+
base64Schema('notbase64'); // ERROR;
338338
```
339339
* s.jsonString
340340
```javascript
341-
const schema = s.jsonString();
342-
s.parse(schema, '[0, 1, 2]'); // '[0, 1, 2]';
343-
s.parse(schema, 'not json'); // ERROR;
341+
const jsonSchema = s.jsonString();
342+
jsonSchema('[0, 1, 2]'); // '[0, 1, 2]';
343+
jsonSchema('not json'); // ERROR;
344344
```
345345

346346
</details>

0 commit comments

Comments
 (0)