Built-in utilities
ArcOS comes with several utility functions built-in that may come in handy for you when you're developing your app. These functions range from array chunking to path manipulation and concatenation.
Global utilities
Waits for ms
milliseconds. That's it.
Creates a message box with m
as the message.
The util
object
util
objectAll of these functions are properties of the util
global object.
Makes the input HTML-safe to prevent XSS attacks.
Appends an s
to the input if the x
argument is 0 or above 1.
Converts an array of items into equally sized chunks.
Returns a hex string representation of the input, optionally specifying a length to make the resulting string. The output will be padded with zeroes as per the maxLength
parameter.
Generates an SHA256 hash for the input.
Counts how many times search
is found in input
.
A web-based path.join
implementation for joining path parts together, with support for the ArcOS Filesystem kernel module.
Returns the file or folder name from a path. For example: U:/Documents/test.txt
becomes test.txt
.
Parses the parent directory of a path. For example: U:/Applications/Minesweeper
becomes U:/Applications
.
Returns the drive letter of a path. It will only allow drive UUIDs if specified. Returns undefined
if the drive letter cannot be parsed.
Converts the input bytes to a human-readable format. Supports up to the YB size unit (excessive, I know)
Takes an ArrayBuffer, filename and optional mimetype, and queries the browser to download that file to the user's computer.
The following functions are of dubious reliability and should not be used regularly.
Watches the SystemDispatch kernel module for file changes broadcasted by the Filesystem kernel module.
Watches the SystemDispatch kernel module for folder changes broadcasted by the Filesystem kernel module.
Last updated