-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ref-imp): #997 - increment updateCommitment if failed to apply an…
… update patch
- Loading branch information
1 parent
4a3575e
commit 9258b84
Showing
6 changed files
with
175 additions
and
94 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* Class containing JavaScript object operations. | ||
*/ | ||
export default class JsObject { | ||
/** | ||
* Deep copies the given input. | ||
*/ | ||
public static deepCopyObject (input: any): any { | ||
if (typeof input !== 'object') { | ||
return input; | ||
} | ||
|
||
const deepCopy: any = Array.isArray(input) ? [] : {}; | ||
|
||
for (const key in input) { | ||
const value = input[key]; | ||
|
||
// Recursively deep copy properties. | ||
deepCopy[key] = JsObject.deepCopyObject(value); | ||
} | ||
|
||
return deepCopy; | ||
} | ||
|
||
/** | ||
* Clears all the properties in the given object. | ||
*/ | ||
public static clearObject (input: any) { | ||
for (const key in input) { | ||
delete input[key]; | ||
} | ||
} | ||
} |
Oops, something went wrong.