UNPKG

x-query-string

Version:

A query string encoder and decoder. Can be used to encode arrays and objects.

25 lines (21 loc) 571 B
var toString = Object.prototype.toString; /** * Check whether the variable is an array * * @param {any} it The variable to check * @returns {boolean} Returns `true` if it is an array */ var isArray = function (it) { return '[object Array]' === toString.call(it); }; /** * Check whether the variable is an object * * @param {any} it The variable to check * @returns {boolean} Returns `true` if it is an object */ var isObject = function (it) { return '[object Object]' === toString.call(it); }; exports.isArray = isArray; exports.isObject = isObject;