# 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
| Param | Type |
|---|---|
| value | number |
# 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
| Param | Type | Description |
|---|---|---|
| min | number | first value |
| max | number | last value |
| genText | toText | returns a string representation of value |
| genAltText | toText | returns an alternative string representation of value |
# pad(n, width) ⇒ string
pads numbers
Kind: global function
Returns: string - the padded number
| Param | Type | Description |
|---|---|---|
| n | number | number to pad |
| width | number |
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
| Param | Type |
|---|---|
| value | any |
# deepMerge(target, ...sources) ⇒ object
copies (deep copy) all properties from each source to target
Kind: global function
Returns: object - target
| Param | Type |
|---|---|
| target | object |
| ...sources | object |