Node-Red configuration
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.

environment.js 877B

123456789101112131415161718192021
  1. 'use strict';
  2. /* global Bun, Deno -- detection */
  3. var globalThis = require('../internals/global-this');
  4. var userAgent = require('../internals/environment-user-agent');
  5. var classof = require('../internals/classof-raw');
  6. var userAgentStartsWith = function (string) {
  7. return userAgent.slice(0, string.length) === string;
  8. };
  9. module.exports = (function () {
  10. if (userAgentStartsWith('Bun/')) return 'BUN';
  11. if (userAgentStartsWith('Cloudflare-Workers')) return 'CLOUDFLARE';
  12. if (userAgentStartsWith('Deno/')) return 'DENO';
  13. if (userAgentStartsWith('Node.js/')) return 'NODE';
  14. if (globalThis.Bun && typeof Bun.version == 'string') return 'BUN';
  15. if (globalThis.Deno && typeof Deno.version == 'object') return 'DENO';
  16. if (classof(globalThis.process) === 'process') return 'NODE';
  17. if (globalThis.window && globalThis.document) return 'BROWSER';
  18. return 'REST';
  19. })();