Global

Members


<constant> getAllDnsMethods

Function to get all methods on DNS instance.

Source:

<constant> memoizeDnsMethods

Function to accept a list of DNS method names and call @func memoize The DNS methods are overridden by their memoized version.

Source:

Methods


createCacheStore( [ttl] [, config])

Function to create a new instance of Cache Store.

Parameters:
Name Type Argument Description
ttl number <optional>

TTL value for cache items in minutes.

config object <optional>

Config / Options object.

Properties
Name Type Argument Description
maxSize number <optional>

Maximum number of items to be stored in cache.

Source:
Returns:

Instance of CacheStore class.

Type
object

dnsCached(ttl, config)

Function to create a new instance of CachedDNS class.

Parameters:
Name Type Description
ttl number

TTL value for cache items in minutes.

config object

Config / Options object.

Properties
Name Type Description
maxSize number

Maximum number of items to be stored in cache.

Source:
Returns:

Instance of CachedDNS class.

Type
object

isNumeric(n)

Utility function to check for valid numbers.

Parameters:
Name Type Description
n number

The number to be validated.

Source:
Returns:
Type
true | false

memoize(method, fn, cacheObj)

Function to accept a DNS method and memoize it.

Parameters:
Name Type Description
method string

Function name to be memoized.

fn function

Function to be memoized.

cacheObj object

The cache object. Instance of CacheStore Class.

Source:
Returns:

Memoized DNS Method.

Type
function

pick(obj, pathArr)

Utility function to safely access deeply nested properties of an object

Parameters:
Name Type Description
obj object

Object to pick property from.

pathArr array
Source:
Returns:

Object property value or undefined.

Type
object | undefined