Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note

Desk Phone API features described in this section are deprecated and supported only on the following models: D40, d45, d50, d60, d62, d65, d70

util

Contains 'helper' functions useful for development.

Require Extended Library: 

Code Block
var util = require('util');

Methods

Name 

Description 

util.debug

Prints the supplied message to the standard output.  Use the App Development web page for your phone to view the output from debugging. For debugging objects, use the JSON.stringify function.

util.defaults

Merges two objects and returns the result. For each key provided, the target object is checked for a corresponding key. If none is found, it will be created with the provided value. Keys in target that are defined will not be overwritten.

util.forceArray

Returns an array.

util.formatDuration

Takes a number of seconds and returns a formatted string representing that amount of time in hours and seconds. There are two possible formats: long and short.

util.isDef

Returns true if the supplied variable is defined, false if it is not defined (undefined).

util.isUndef

Returns true if the supplied variable is undefined, false if it is defined.

...