{Ext}=require('flatnet')
Utility functions
Ext.Timer()
- Unit of measurement = milliseconds
- Returns truncated
('perf_hooks').performance.now()
Ext.Flatten(any_var,out=[])
- Flattens any variable type to a 1D integer array
- Coverts string characters to char codes including object keys
- Returns the optional
out
array parameter
Ext.ParseInt(arr=[])
- Parses string array using
parseInt()
on each element - Returns a new array of non-NAN integer numbers
Ext.PTRCount(args=[])
- For command line usage
- Searches string args for the flag '
ptr_count=
+ integer' - If found, splices the flag out of the args array
- Returns the parsed integer ptr_count variable
Ext.Random.Float(max=1,min=0)
- Returns float number from max ~ min
Ext.Random.Integer(max=1,min=0)
- Returns integer number from max ~ min
Ext.Sort.Sort(arr=[],prop='')
- Sorts an array of objects into descending order by the property value
- arr[0] = highest value
- Returns existing array
Ext.Sort.Reverse(arr=[])
- Reverses array order in-place
- Returns existing array