aoijs / aoi.js

aoi.js - The most advanced string-based package to create a Discord Bot fast and powerful.
https://aoi.js.org
Apache License 2.0
329 stars 130 forks source link

Bug: $createArray creates an index when the input is empty (the version is 6.8.0) #612

Closed yungheheh closed 2 months ago

yungheheh commented 2 months ago

Bug Type

Function

Bugged Function

$getArray[test]      returns [""]
$createArray[test;]

Version of aoi.js

v6.7.1

Version of Node.js

v21.4.0 (Current)

Excepted Output

[]

Relevant log output

No response

Code of Conduct

Faf4a commented 2 months ago

can reproduce

USERSATOSHI commented 2 months ago

@yungheheh that is expected cause you are telling the function to create an array with 1 element which is an empty string

if u want to create an empty array $createArray[test] would do this

yungheheh commented 2 months ago

@yungheheh that is expected cause you are telling the function to create an array with 1 element which is an empty string

if u want to create an empty array $createArray[test] would do this

Then I suggest to make docs Say that the elements field isnt required