Skip to content

Commit e1bef9a

Browse files
docs: fix dox parsing issue by using RegExp object
1 parent a5e8543 commit e1bef9a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/datastore/dataset.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,9 @@ function Dataset(options) {
115115
options.apiEndpoint = 'http://' + options.apiEndpoint;
116116
}
117117

118+
var trailingSlashes = new RegExp('/*$');
118119
this.apiEndpoint = options.apiEndpoint || 'https://www.googleapis.com';
119-
this.apiEndpoint = this.apiEndpoint.replace(/\/*$/, '');
120+
this.apiEndpoint = this.apiEndpoint.replace(trailingSlashes, '');
120121

121122
this.namespace = options.namespace;
122123
this.projectId = options.projectId;
@@ -134,6 +135,7 @@ nodeutil.inherits(Dataset, DatastoreRequest);
134135
* @param {object=} options - Configuration object.
135136
* @param {...*=} options.path - Key path.
136137
* @param {string=} options.namespace - Optional namespace.
138+
* @return {Key} A newly created Key from the options given.
137139
*
138140
* @example
139141
* var key;
@@ -153,8 +155,6 @@ nodeutil.inherits(Dataset, DatastoreRequest);
153155
* namespace: 'My-NS',
154156
* path: ['Company', 123]
155157
* });
156-
*
157-
* @return {Key} A newly created Key from the options given.
158158
*/
159159
Dataset.prototype.key = function(options) {
160160
options = util.is(options, 'object') ? options : {

0 commit comments

Comments
 (0)