Function
Static Public Summary | ||
public |
Set default options where some option was not specified. |
|
public |
Loop over each item in an array-like value. |
|
public |
Loop over each key/value pair in a hash. |
|
public |
Determine if the thing is not undefined and not null. |
|
public |
isFunction(x: *): boolean Is this a function? |
|
public |
Test if token is a script tag. |
|
public |
Test if token is a style tag. |
|
public |
Test if token is a script tag. |
|
public |
Get the last item in an array |
|
public |
postscribe(el: *, html: *, options: *): * |
|
public |
Convert value (e.g., a NodeList) to an array. |
Static Public
public defaults(options: Object, _defaults: Object): Object source
import {defaults} from 'postscribe/src/utils.js'
Set default options where some option was not specified.
public each(arr: Array<*>, fn: Function, target: Object) source
import {each} from 'postscribe/src/utils.js'
Loop over each item in an array-like value.
public eachKey(obj: Object, fn: Function, target: Object) source
import {eachKey} from 'postscribe/src/utils.js'
Loop over each key/value pair in a hash.
public existy(thing: *): boolean source
import {existy} from 'postscribe/src/utils.js'
Determine if the thing is not undefined and not null.
Params:
Name | Type | Attribute | Description |
thing | * | The thing to test |
public isFunction(x: *): boolean source
import {isFunction} from 'postscribe/src/utils.js'
Is this a function?
Params:
Name | Type | Attribute | Description |
x | * | The variable to test |
public isScript(tok: Object): boolean source
import {isScript} from 'postscribe/src/utils.js'
Test if token is a script tag.
Params:
Name | Type | Attribute | Description |
tok | Object | The token |
public isStyle(tok: Object): boolean source
import {isStyle} from 'postscribe/src/utils.js'
Test if token is a style tag.
Params:
Name | Type | Attribute | Description |
tok | Object | The token |
public isTag(tok: Object, tag: String): boolean source
import {isTag} from 'postscribe/src/utils.js'
Test if token is a script tag.
public last(array: Array<*>): * source
import {last} from 'postscribe/src/utils.js'
Get the last item in an array
Params:
Name | Type | Attribute | Description |
array | Array<*> | The array |
Return:
* | The last item in the array |
public postscribe(el: *, html: *, options: *): * source
import postscribe from 'postscribe/src/postscribe.js'
Params:
Name | Type | Attribute | Description |
el | * | ||
html | * | ||
options | * |
Return:
* |
public toArray(obj: *): Array<*> source
import {toArray} from 'postscribe/src/utils.js'
Convert value (e.g., a NodeList) to an array.
Params:
Name | Type | Attribute | Description |
obj | * | The object |