1.1.0 • Published 7 years ago
@gunawanwijaya/utils v1.1.0
upils
Collection of native progressive (es6) utility library
all-platform
is
- type checking (Boolean)merge
- object deep mergeobjectToQueryString
- QueryString builderqueryStringToObject
- QueryString parserval
- get native value from string
browser only
- DOM specific
allDOM
- selector of many DOM (Array)oneDOM
- selector of only one DOMremoveDOM
- remove only one DOM, can be joined witheachDOM
eachDOM
- iterate many DOM with callbackwrapDOM
- wrap only one DOM with a new DOMxmlToObject
- parse xml to Object, useful for reading xml like format, e.g. rss feed (modified from https://github.com/metatribal/xmlToJSON)stringToDOM
- make a DOM from string
- DOM class specific
hasClass
- check if a DOM has a className, can be joined witheachDOM
addClass
- add className to all of DOM within the queryremoveClass
- remove className to all of DOM within the querytoggleClass
- toggle className to all of DOM within the query
- event specific
on
- addEventListener with passive event as default, non passive addfalse
after callbackoff
- removeEventListener
- injection
insertScript
- script injection (JSONP like)insertStyle
- style injection