From 32f69339a5ea02280f47bfad73e53bf2821d9bde Mon Sep 17 00:00:00 2001 From: Aaron Jensen Date: Sun, 9 Aug 2015 22:10:11 -0700 Subject: [PATCH] Update README --- README.md | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4197a5a..95d47fd 100644 --- a/README.md +++ b/README.md @@ -263,7 +263,14 @@ expect(result).toEqual({ user: { email: 'john@aol.com', username: 'john123' } }) ``` ```js -var user = { user: { email: 'john@aol.com', username: 'john123', authToken: '1211..', SSN: 5551234 } }; +var user = { + user: { + email: 'john@aol.com', + username: 'john123', + authToken: '1211..', + SSN: 5551234 + } +}; var result = u({ user: u.omit(['authToken', 'SSN']) }, user); @@ -314,9 +321,22 @@ expect(result).toEqual(true); ``` ```js -var person = { person: { name: { first: 'Jen', last: 'Matthews' } } }; +var person = { + person: { + name: { + first: 'Jen', + last: 'Matthews' + } + } +}; -var result = u({ person: u.if(u.is('name.first', 'Jen'), u.updateIn('name.last', 'Simpson')) }); +// Update person's last name to Simpson if their first name is Jen +var result = u({ + person: u.if( + u.is('name.first', 'Jen'), + u.updateIn('name.last', 'Simpson') + ) +}); expect(result).toEqual({ person: { name: { first: 'Jen', last: 'Simpson' } } }); ```