d240840d4e
- reverting 1.3.3 - Added: - `helpers/stringMethods`: Added the function `varifyString` - Modified: - `dispatcher/instanceManager/InstanceManager`: Adapting the name of the instance to use a valid instance name. - `dispatcher/rpcManager/rpcManager`: Adapting the name of the service to use a valid service name. - `cli/runNopeBackend`: Adapting the name of the service to use a valid service name. # 1.3.6 - Added: - `cli/runNopeBackend`: Added the a helper to add varify the `name`. (see modifications in `dispatcher/InstanceManager/InstanceManager`, `dispatcher/RpcManager/NopeRpcManager`) - Modified: - `helpers/stringMethods`: added function `union` and `difference`. - `helpers/setMethods`: added function `varifyString`. - `types/nope/nopeDispatcher.interface`: Added option `forceUsingValidVarNames` - Fixes: - `types/nope/nopeInstanceManager.interface`: Fixed the typing of `getInstancesOfType` and `createInstance` # 1.3.7 - Fixes: - `helpers/mapMethods`: Fixing `tranformMap`. Now correctly assigning `onlyValidProps`
40 lines
648 B
TypeScript
40 lines
648 B
TypeScript
/**
|
|
* @author Martin Karkowski
|
|
* @email m.karkowski@zema.de
|
|
* @desc [description]
|
|
*/
|
|
|
|
import { v4 } from "uuid";
|
|
import { varifyString } from "./stringMethods";
|
|
|
|
/**
|
|
* Generates an ID.
|
|
*
|
|
* @author M.Karkowski
|
|
* @export
|
|
* @param {{
|
|
* prestring?: string,
|
|
* useAsVar?: boolean
|
|
* }} [options={}]
|
|
* @return {string}
|
|
*/
|
|
export function generateId(
|
|
options: {
|
|
// PreString for the Var.
|
|
prestring?: string;
|
|
useAsVar?: boolean;
|
|
} = {}
|
|
): string {
|
|
let id = v4();
|
|
|
|
if (typeof options.prestring === "string") {
|
|
id = options.prestring + id;
|
|
}
|
|
|
|
if (options.useAsVar) {
|
|
id = varifyString(id);
|
|
}
|
|
|
|
return id;
|
|
}
|