Skip to content

Commit daf027c

Browse files
committed
verstion upgrade, readme update
1 parent af4d723 commit daf027c

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,26 +35,29 @@ const INPUT_JSON = {
3535
}
3636
};
3737

38-
const replacedJSONValue = jnestedReplace(INPUT_JSON, 'json-nested-replace', 'jnested-replace');
38+
const replacedJSONValue = jnestedReplace(INPUT_JSON, 'json-nested-replace', 'jnested-replace', ['url']);
3939
console.log(replacedJSONValue);
4040
// Output
4141
/** {
4242
* 'name': 'jnested-replace',
4343
* 'author': 'Arshad Kazmi',
4444
* 'repository': {
45-
* 'url': 'https://github.com/arshadkazmi42/jnested-replace',
45+
* 'url': 'https://github.com/arshadkazmi42/json-nested-replace',
4646
* 'language': 'js'
4747
* }
4848
* }
4949
**/
5050

51+
```
5152

52-
const replacedStringValue = jnestedReplace('json-nested-replace', 'json-nested', 'jnested');
53-
console.log(replacedStringValue)
54-
// Output
55-
// jnested-replace
53+
## Function Parameters
5654

57-
```
55+
Function `jnestedReplace` takes following parameters respectively
56+
57+
- `input`: Object/Array on which nested replace to apply
58+
- `searchValue`: Value which needs to be replaced in the JSON
59+
- `newValue`: New Value which needs to be added in place of searchValue
60+
- `skipKeys`: Optinal field, if any key needs to be skipped from this replacing
5861

5962
## Contributing
6063

0 commit comments

Comments
 (0)