A JavaScript Util Toolbox.
In a browser:
<script src="trois.js"></script>
Using npm:
$ npm install trois --save
// in browser
let components = trois.url.getUrlComponents(url);
// es2015
import trois from 'trois';
let components = trois.url.getUrlComponents(url);
camelize obj
Parameters
obj: *
, camelize obj
Returns: *
test if value
is an array.
Parameters
value: *
, test if value
is an array.
Returns: boolean
test if value
is an instance of RegExp.
Parameters
value: *
, test if value
is an instance of RegExp.
Returns: boolean
test if value
is an instance of Date.
Parameters
value: *
, test if value
is an instance of Date.
Returns: boolean
Escape HTML special characters
Parameters
str: string
, Escape HTML special characters
Returns: string
Unescape HTML special characters
Parameters
str: string
, Unescape HTML special characters
Returns: string
Convert url
to an object with its components
Parameters
url: string
, Convert url
to an object with its components
Returns: object
Convert args
to a query string.
The args
parameter should be an object
like {key1: value1, key2: value2}
.
Parameters
args: object
, Convert args
to a query string.
The args
parameter should be an object
like {key1: value1, key2: value2}.
Returns: string
Convert qs
to an object.
The qs
parameter should be a string.
Parameters
qs: string
, Convert qs
to an object.
The qs
parameter should be a string.
Returns: object