PromoCursed/node_modules/core-js/internals/environment.js
2024-08-20 23:25:37 +04:00

22 lines
877 B
JavaScript

'use strict';
/* global Bun, Deno -- detection */
var globalThis = require('../internals/global-this');
var userAgent = require('../internals/environment-user-agent');
var classof = require('../internals/classof-raw');
var userAgentStartsWith = function (string) {
return userAgent.slice(0, string.length) === string;
};
module.exports = (function () {
if (userAgentStartsWith('Bun/')) return 'BUN';
if (userAgentStartsWith('Cloudflare-Workers')) return 'CLOUDFLARE';
if (userAgentStartsWith('Deno/')) return 'DENO';
if (userAgentStartsWith('Node.js/')) return 'NODE';
if (globalThis.Bun && typeof Bun.version == 'string') return 'BUN';
if (globalThis.Deno && typeof Deno.version == 'object') return 'DENO';
if (classof(globalThis.process) === 'process') return 'NODE';
if (globalThis.window && globalThis.document) return 'BROWSER';
return 'REST';
})();