diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-09-21 18:11:51 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-09-21 18:11:51 +0200 |
| commit | a810d0248dd9f1099ce15809f8e1e75eedbff8e6 (patch) | |
| tree | 2eeebe5dbbe0e9005b89806a5b9a88d47f54ed1a /StoneIsland/plugins/cordova-plugin-advanced-http/www/js-util.js | |
| parent | d906f7303e70adaa75523d8bfc5b46523ccfffa0 (diff) | |
plugins
Diffstat (limited to 'StoneIsland/plugins/cordova-plugin-advanced-http/www/js-util.js')
| -rw-r--r-- | StoneIsland/plugins/cordova-plugin-advanced-http/www/js-util.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/StoneIsland/plugins/cordova-plugin-advanced-http/www/js-util.js b/StoneIsland/plugins/cordova-plugin-advanced-http/www/js-util.js new file mode 100644 index 00000000..593dcc02 --- /dev/null +++ b/StoneIsland/plugins/cordova-plugin-advanced-http/www/js-util.js @@ -0,0 +1,32 @@ +module.exports = { + // typeof is not working reliably in JS + getTypeOf: function (object) { + switch (Object.prototype.toString.call(object)) { + case '[object Array]': + return 'Array'; + case '[object Blob]': + return 'Blob'; + case '[object Uint8Array]': + return 'Uint8Array'; + case '[object ArrayBuffer]': + return 'ArrayBuffer'; + case '[object Boolean]': + return 'Boolean'; + case '[object Function]': + return 'Function'; + case '[object Null]': + return 'Null'; + case '[object Number]': + return 'Number'; + case '[object Object]': + return 'Object'; + case '[object String]': + return 'String'; + case '[object Undefined]': + return 'Undefined'; + default: + return 'Unknown'; + } + } +} + |
