Editor.Utils
Methods
Editor.Utils.padLeft (text, width, ch)
- textstring
- widthnumber
- chstring - The character used to pad
Editor.Utils.toFixed (value, precision, optionals)
- valuenumber
- precisionnumber
- optionalsnumber
Implementation of toFixed() that treats floats more like decimals
Fixes binary rounding issues (eg. (0.615).toFixed(2) === '0.61') that present problems for accounting- and finance-related software.
Editor.Utils.formatFrame (frame, frameRate)
- framenumber
- frameRatenumber
Editor.Utils.smoothScale (curScale, delta)
- curScalenumber
- deltanumber
Editor.Utils.wrapError (curScale, delta)
- errError
Editor.Utils.arrayCmpFilter (items, func)
- itemsarray
- funcfunction
Editor.Utils.fitSize (srcWidth, srcHeight, destWidth, destHeight)
- srcWidthnumber
- srcHeightnumber
- destWidthnumber
- destHeightnumber
Editor.Utils.prettyBytes (num)
- numnumber
Convert bytes to a human readable string: 1337 → 1.34 kB. Reference: https://github.com/sindresorhus/pretty-bytes
Editor.Utils.run (execFile, ...args)
- execFilestring
- ...args...
run execFile with args.
