Skip to content

Commit

Permalink
add guard clause for utils.wrapPropertyMethod()
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalouin authored and lbalmaceda committed Jun 19, 2020
1 parent 64165a6 commit 2f41322
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ utils.generateClientInfo = function() {
*/
utils.wrapPropertyMethod = function(Parent, name, propertyMethod) {
var path = propertyMethod.split('.');
if (path.length > 2) {
throw new Error('wrapPropertyMethod() only supports one level of nesting for propertyMethod');
}
var property = path.shift();
var method = path.pop();

Expand Down

0 comments on commit 2f41322

Please # to comment.