util

Usage

import core from '@vue-js-cron/core'
const { util } = core

Functions

toText(value)string

type definition

genItems(min, max, genText, genAltText)Array.<{value:number, text:string, alt:string}>

generate items for fields

pad(n, width)string

pads numbers

isObject(value)Boolean

determines whether the passed value is an object

deepMerge(target, ...sources)object

copies (deep copy) all properties from each source to target

toText(value) ⇒ string

type definition

Kind: global function

ParamType
valuenumber

genItems(min, max, genText, genAltText) ⇒ Array.<{value:number, text:string, alt:string}>

generate items for fields

Kind: global function
Returns: Array.<{value:number, text:string, alt:string}> - array of items

ParamTypeDescription
minnumberfirst value
maxnumberlast value
genTexttoTextreturns a string representation of value
genAltTexttoTextreturns an alternative string representation of value

pad(n, width) ⇒ string

pads numbers

Kind: global function
Returns: string - the padded number

ParamTypeDescription
nnumbernumber to pad
widthnumber

Example

//returns "001"
util.pad(1,3) 

isObject(value) ⇒ Boolean

determines whether the passed value is an object

Kind: global function
Returns: Boolean - true if value is an object, otherwise false

ParamType
valueany

deepMerge(target, ...sources) ⇒ object

copies (deep copy) all properties from each source to target

Kind: global function
Returns: object - target

ParamType
targetobject
...sourcesobject
Contributors: Andreas Bichinger