mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-19 02:21:24 +01:00
refactor(es modules): modulize utils
This commit is contained in:
parent
12e1c9f334
commit
7ccebec048
54 changed files with 168 additions and 134 deletions
7
src/utils/nodeUtils.ts
Normal file
7
src/utils/nodeUtils.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import {byId} from "./shorthands";
|
||||
|
||||
// get next unused id
|
||||
export function getNextId(core: string, index = 1) {
|
||||
while (byId(core + index)) index++;
|
||||
return core + index;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue