Skip to content

Commit 74d2950

Browse files
authored
commonUtils.createDocId(): simplify with padStart() (#8795)
1 parent 2b6219a commit 74d2950

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

‎tests/common-utils.js‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,7 @@ commonUtils.safeRandomDBName = function () {
171171
};
172172

173173
commonUtils.createDocId = function (i) {
174-
var intString = i.toString();
175-
while (intString.length < 10) {
176-
intString = '0' + intString;
177-
}
178-
return 'doc_' + intString;
174+
return 'doc_' + i.toString().padStart(10, '0');
179175
};
180176

181177
var PouchForCoverage = require('../packages/node_modules/pouchdb-for-coverage');

0 commit comments

Comments
 (0)