Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ClientSession.prototype.translateBrowsePath = function (browsePath, callback) {
assert(_.isFunction(callback));
const self = this;
const isArray = _.isArray(browsePath);
browsePath = isArray ? browsePath :[browsePath];
const request = new translate_service.TranslateBrowsePathsToNodeIdsRequest({
browsePath: browsePath
});
self.performMessageTransaction(request, function (err, response) {
/* istanbul ignore next */
if (err) {
return callback(err, response);
}
assert(response instanceof translate_service.TranslateBrowsePathsToNodeIdsResponse);
callback(null, isArray ? response.results : response.results[0]);
});
};