molstar
Version:
A comprehensive macromolecular library.
21 lines • 712 B
JavaScript
/**
* Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.idFactory = void 0;
/** Builds id function returning ids within [firstId, maxId) */
function idFactory(firstId, maxId) {
if (firstId === void 0) { firstId = 0; }
if (maxId === void 0) { maxId = Number.MAX_SAFE_INTEGER; }
var _nextId = firstId;
return function () {
var ret = _nextId;
_nextId = (_nextId + 1) % maxId;
return ret;
};
}
exports.idFactory = idFactory;
//# sourceMappingURL=id-factory.js.map
;