You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
662 B

'use strict';
exports.isNode = 'undefined' != typeof process
&& 'object' == typeof module
&& 'object' == typeof global
&& 'function' == typeof Buffer
&& process.argv;
exports.isMongo = !exports.isNode
&& 'function' == typeof printjson
&& 'function' == typeof ObjectId
&& 'function' == typeof rs
&& 'function' == typeof sh;
exports.isBrowser = !exports.isNode
&& !exports.isMongo
&& 'undefined' != typeof window;
exports.type = exports.isNode ? 'node'
: exports.isMongo ? 'mongo'
: exports.isBrowser ? 'browser'
: 'unknown';