forked from eversign/eversign-node-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Nested fields were not changing cases while making API call and …
…receiving the response. fixes eversign#67
- Loading branch information
1 parent
1ab0618
commit 681bbb9
Showing
6 changed files
with
24 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
var _ = require('lodash'); | ||
|
||
/** | ||
* Replace given object keys recursively | ||
* @param {Object} object Object to change keys of | ||
* @param {Function} transformer A callback which receives a key | ||
* @returns Copy of the object with `transformer` applied to each key | ||
*/ | ||
function mapKeysDeep(object, transformer) { | ||
return _.transform(object, function (result, value, key) { | ||
if (_.isFunction(value)) return; | ||
result[transformer(key)] = _.isObject(value) ? mapKeysDeep(value, transformer) : value; | ||
}); | ||
} | ||
|
||
module.exports = { mapKeysDeep }; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters