Skip to content

Latest commit

 

History

History

ext

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Ext

flatnet license

{Ext}=require('flatnet')

Utility functions


Timer

  • Ext.Timer()
  • Unit of measurement = milliseconds
  • Returns truncated ('perf_hooks').performance.now()

Flatten

  • 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

ParseInt

  • Ext.ParseInt(arr=[])
  • Parses string array using parseInt() on each element
  • Returns a new array of non-NAN integer numbers

PTRCount

  • 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

Random.Float

  • Ext.Random.Float(max=1,min=0)
  • Returns float number from max ~ min

Random.Integer

  • Ext.Random.Integer(max=1,min=0)
  • Returns integer number from max ~ min

Sort.Sort

  • Ext.Sort.Sort(arr=[],prop='')
  • Sorts an array of objects into descending order by the property value
  • arr[0] = highest value
  • Returns existing array

Sort.Reverse

  • Ext.Sort.Reverse(arr=[])
  • Reverses array order in-place
  • Returns existing array