@mixtape/core
Version:
Supercharged fixture library for organizing and generating test data
27 lines • 818 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var uuid = require("uuid/v4");
/**
* The class makes it easy to generate random strings.
* Strings generated by this class are UUIDs.
* @implements {ValueGenerator}
*/
var StringGenerator = /** @class */ (function () {
/**
* Create a new `StringGenerator`
* @param prefix - prefix for all generated strings (optional)
*/
function StringGenerator(prefix) {
this._prefix = !prefix ? '' : prefix;
}
/**
* Create string with random value
* @returns `string`
*/
StringGenerator.prototype.generate = function () {
return "" + this._prefix + uuid();
};
return StringGenerator;
}());
exports.StringGenerator = StringGenerator;
//# sourceMappingURL=string-generator.js.map