mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 18:11:24 +01:00
refactor: define globals
This commit is contained in:
parent
22903fcb71
commit
7c2c624417
26 changed files with 939 additions and 245 deletions
|
|
@ -21,12 +21,10 @@ interface ICreateTypesArrayFrom {
|
|||
export function createTypedArray(params: ICreateTypesArrayLength | ICreateTypesArrayFrom) {
|
||||
const typedArray = getTypedArray(params.maxValue);
|
||||
if ("from" in params) {
|
||||
typedArray.from(params.from);
|
||||
} else if ("length" in params) {
|
||||
return new typedArray(params.length);
|
||||
return typedArray.from(params.from);
|
||||
}
|
||||
|
||||
return typedArray;
|
||||
return new typedArray(params.length);
|
||||
}
|
||||
|
||||
function getTypedArray(maxValue: number) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue