-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve some cases of environment detection
- Loading branch information
Showing
31 changed files
with
67 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...es/core-js/internals/engine-ff-version.js → ...re-js/internals/environment-ff-version.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...core-js/internals/engine-is-ie-or-edge.js → ...js/internals/environment-is-ie-or-edge.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
'use strict'; | ||
var UA = require('../internals/engine-user-agent'); | ||
var UA = require('../internals/environment-user-agent'); | ||
|
||
module.exports = /MSIE|Trident/.test(UA); |
2 changes: 1 addition & 1 deletion
2
...core-js/internals/engine-is-ios-pebble.js → ...js/internals/environment-is-ios-pebble.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
'use strict'; | ||
var userAgent = require('../internals/engine-user-agent'); | ||
var userAgent = require('../internals/environment-user-agent'); | ||
|
||
module.exports = /ipad|iphone|ipod/i.test(userAgent) && typeof Pebble != 'undefined'; |
2 changes: 1 addition & 1 deletion
2
packages/core-js/internals/engine-is-ios.js → ...s/core-js/internals/environment-is-ios.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
'use strict'; | ||
var userAgent = require('../internals/engine-user-agent'); | ||
var userAgent = require('../internals/environment-user-agent'); | ||
|
||
// eslint-disable-next-line redos/no-vulnerable -- safe | ||
module.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
'use strict'; | ||
var ENVIRONMENT = require('../internals/environment'); | ||
|
||
module.exports = ENVIRONMENT === 'NODE'; |
2 changes: 1 addition & 1 deletion
2
...re-js/internals/engine-is-webos-webkit.js → .../internals/environment-is-webos-webkit.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
'use strict'; | ||
var userAgent = require('../internals/engine-user-agent'); | ||
var userAgent = require('../internals/environment-user-agent'); | ||
|
||
module.exports = /web0s(?!.*chrome)/i.test(userAgent); |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...es/core-js/internals/engine-v8-version.js → ...re-js/internals/environment-v8-version.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ore-js/internals/engine-webkit-version.js → ...s/internals/environment-webkit-version.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use strict'; | ||
/* global Bun, Deno -- detection */ | ||
var globalThis = require('../internals/global'); | ||
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'; | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
'use strict'; | ||
// https://github.com/zloirock/core-js/issues/280 | ||
var userAgent = require('../internals/engine-user-agent'); | ||
var userAgent = require('../internals/environment-user-agent'); | ||
|
||
module.exports = /Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(userAgent); |
8 changes: 3 additions & 5 deletions
8
packages/core-js/internals/structured-clone-proper-transfer.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters