loopback-datasource-juggler/test/helpers/uid-generator.js

22 lines
409 B
JavaScript
Raw Normal View History

2016-04-12 12:32:34 +00:00
// Copyright IBM Corp. 2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
2016-08-22 19:55:22 +00:00
'use strict';
2016-04-12 12:32:34 +00:00
var lastId = 0;
exports.next = function() {
lastId++;
return exports.last();
};
exports.last = function() {
return '' + lastId;
};
exports.reset = function() {
lastId = 0;
};