Home Reference Source Test

Function

Static Public Summary
public

dataView(obj: *): DataView

Wrap binary data in DataView

public

Checks if environment provides a feature

public

isArray(n: *): boolean

Check if given object is an array

public

isBlob(n: *): boolean

Check if given object is a Uint8Array

public

Check if given object is a boolean

public

isDate(n: *): boolean

Check if given object is a Date

public

isFloat(n: *): boolean

Check if given object is a float number

public

Check if given object is a function

public

Check if given object is infinity constant

public

isInt(n: *): boolean

Check if given object is an integer number

public

isNull(n: *): boolean

Check if given object is null

public

isNumber(n: *): boolean

Check if given object is a number

public

isObject(n: *): boolean

Check if given object is an object

public

isString(n: *): boolean

Check if given object is a string

public

Check if given object is undefined

public

pad(n: number): *

Return the next multiple of four

public

Sanitizes an OSC-ready Address Pattern

public

Make an OSC address pattern javascript-regex-ready

public

typeTag(item: *): string

Checks type of given object and returns the regarding OSC Type tag character

Static Public

public dataView(obj: *): DataView source

import {dataView} from 'osc-js/src/common/utils.js'

Wrap binary data in DataView

Params:

NameTypeAttributeDescription
obj *

Return:

DataView

public hasProperty(name: string): boolean source

import {hasProperty} from 'osc-js/src/common/utils.js'

Checks if environment provides a feature

Params:

NameTypeAttributeDescription
name string

Name of needed feature

Return:

boolean

public isArray(n: *): boolean source

import {isArray} from 'osc-js/src/common/utils.js'

Check if given object is an array

Params:

NameTypeAttributeDescription
n *

Return:

boolean

public isBlob(n: *): boolean source

import {isBlob} from 'osc-js/src/common/utils.js'

Check if given object is a Uint8Array

Params:

NameTypeAttributeDescription
n *

Return:

boolean

public isBoolean(n: *): boolean source

import {isBoolean} from 'osc-js/src/common/utils.js'

Check if given object is a boolean

Params:

NameTypeAttributeDescription
n *

Return:

boolean

public isDate(n: *): boolean source

import {isDate} from 'osc-js/src/common/utils.js'

Check if given object is a Date

Params:

NameTypeAttributeDescription
n *

Return:

boolean

public isFloat(n: *): boolean source

import {isFloat} from 'osc-js/src/common/utils.js'

Check if given object is a float number

Params:

NameTypeAttributeDescription
n *

Return:

boolean

public isFunction(n: *): boolean source

import {isFunction} from 'osc-js/src/common/utils.js'

Check if given object is a function

Params:

NameTypeAttributeDescription
n *

Return:

boolean

public isInfinity(n: *): boolean source

import {isInfinity} from 'osc-js/src/common/utils.js'

Check if given object is infinity constant

Params:

NameTypeAttributeDescription
n *

Return:

boolean

public isInt(n: *): boolean source

import {isInt} from 'osc-js/src/common/utils.js'

Check if given object is an integer number

Params:

NameTypeAttributeDescription
n *

Return:

boolean

public isNull(n: *): boolean source

import {isNull} from 'osc-js/src/common/utils.js'

Check if given object is null

Params:

NameTypeAttributeDescription
n *

Return:

boolean

Test:

public isNumber(n: *): boolean source

import {isNumber} from 'osc-js/src/common/utils.js'

Check if given object is a number

Params:

NameTypeAttributeDescription
n *

Return:

boolean

public isObject(n: *): boolean source

import {isObject} from 'osc-js/src/common/utils.js'

Check if given object is an object

Params:

NameTypeAttributeDescription
n *

Return:

boolean

public isString(n: *): boolean source

import {isString} from 'osc-js/src/common/utils.js'

Check if given object is a string

Params:

NameTypeAttributeDescription
n *

Return:

boolean

public isUndefined(n: *): boolean source

import {isUndefined} from 'osc-js/src/common/utils.js'

Check if given object is undefined

Params:

NameTypeAttributeDescription
n *

Return:

boolean

Test:

public pad(n: number): * source

import {pad} from 'osc-js/src/common/utils.js'

Return the next multiple of four

Params:

NameTypeAttributeDescription
n number

Return:

*

Test:

public prepareAddress(obj: string[] | string): string source

import {prepareAddress} from 'osc-js/src/common/helpers.js'

Sanitizes an OSC-ready Address Pattern

Params:

NameTypeAttributeDescription
obj string[] | string

Address as string or array of strings

Return:

string

Corrected address string

Example:

// all calls return '/test/path' string:
prepareAddress('test/path')
prepareAddress('/test/path/')
prepareAddress([test, path])

Test:

public prepareRegExPattern(str: string): string source

import {prepareRegExPattern} from 'osc-js/src/common/helpers.js'

Make an OSC address pattern javascript-regex-ready

Params:

NameTypeAttributeDescription
str string

OSC address pattern

Return:

string

Javascript RegEx string

public typeTag(item: *): string source

import {typeTag} from 'osc-js/src/common/helpers.js'

Checks type of given object and returns the regarding OSC Type tag character

Params:

NameTypeAttributeDescription
item *

Any object

Return:

string

OSC Type tag character

Test: