utils

Various utilities.

Source:

Methods

(static) dataUriToBlobSync(dataURI) → {Blob}

Source:
Parameters:
Name Type Description
dataURI string

dataURI

Returns:

dataURI converted to a Blob

Type
Blob

(static) getFilename(file, postfix) → {string}

Source:
Parameters:
Name Type Description
file object

File instance

postfix string

postfix for filename

Returns:

new filename

Type
string

(static) getPasteData(event) → {string|null}

Source:
Parameters:
Name Type Description
event Event

a paste event

Returns:

clipboard data text value contained in event or null

Type
string | null

(static) isNumber(n) → {boolean}

Source:
Parameters:
Name Type Description
n *

value

Returns:

whether it is a number value

Type
boolean

(static) parseFunctionFromExpression(expr, func) → {Array.<Array.<string, any>>}

Source:

Parses an Expression to extract all function calls and their argument arrays.

Parameters:
Name Type Description
expr string

The expression to search

func string

The function name to search for

Returns:

The result array, where each result is an array containing the function call and array of arguments.

Type
Array.<Array.<string, any>>

(static) readCookie(name) → {string|undefined}

Source:
Parameters:
Name Type Description
name string

a cookie to look for

Returns:

the value of the cookie

Type
string | undefined

(static) resizeImage(file, maxPixels) → {Promise.<Blob>}

Source:
Parameters:
Name Type Description
file File

Image file to be resized

maxPixels number

Maximum pixels of resized image

Returns:

Promise of resized image blob

Type
Promise.<Blob>

(static) stripQuotes(str) → {string}

Source:
Parameters:
Name Type Description
str string

original string

Returns:

stripped string

Type
string

(inner) joinPath()

Source:

Copied from: https://gist.github.com/creationix/7435851 Joins path segments. Preserves initial "/" and resolves ".." and "." Does not support using ".." to go above/outside the root. This means that join("foo", "../../bar") will not resolve to "../bar"