BLUE
PHP 7.4.33
Path:
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/any-promise
Run
Logout
Edit File
Size: 2.84 KB
Close
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/any-promise/register.js
Text
Base64
"use strict" module.exports = require('./loader')(global, loadImplementation); /** * Node.js version of loadImplementation. * * Requires the given implementation and returns the registration * containing {Promise, implementation} * * If implementation is undefined or global.Promise, loads it * Otherwise uses require */ function loadImplementation(implementation){ var impl = null if(shouldPreferGlobalPromise(implementation)){ // if no implementation or env specified use global.Promise impl = { Promise: global.Promise, implementation: 'global.Promise' } } else if(implementation){ // if implementation specified, require it var lib = require(implementation) impl = { Promise: lib.Promise || lib, implementation: implementation } } else { // try to auto detect implementation. This is non-deterministic // and should prefer other branches, but this is our last chance // to load something without throwing error impl = tryAutoDetect() } if(impl === null){ throw new Error('Cannot find any-promise implementation nor'+ ' global.Promise. You must install polyfill or call'+ ' require("any-promise/register") with your preferred'+ ' implementation, e.g. require("any-promise/register/bluebird")'+ ' on application load prior to any require("any-promise").') } return impl } /** * Determines if the global.Promise should be preferred if an implementation * has not been registered. */ function shouldPreferGlobalPromise(implementation){ if(implementation){ return implementation === 'global.Promise' } else if(typeof global.Promise !== 'undefined'){ // Load global promise if implementation not specified // Versions < 0.11 did not have global Promise // Do not use for version < 0.12 as version 0.11 contained buggy versions var version = (/v(\d+)\.(\d+)\.(\d+)/).exec(process.version) return !(version && +version[1] == 0 && +version[2] < 12) } // do not have global.Promise or another implementation was specified return false } /** * Look for common libs as last resort there is no guarantee that * this will return a desired implementation or even be deterministic. * The priority is also nearly arbitrary. We are only doing this * for older versions of Node.js <0.12 that do not have a reasonable * global.Promise implementation and we the user has not registered * the preference. This preserves the behavior of any-promise <= 0.1 * and may be deprecated or removed in the future */ function tryAutoDetect(){ var libs = [ "es6-promise", "promise", "native-promise-only", "bluebird", "rsvp", "when", "q", "pinkie", "lie", "vow"] var i = 0, len = libs.length for(; i < len; i++){ try { return loadImplementation(libs[i]) } catch(e){} } return null }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 14
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
register
DIR
-
drwxr-xr-x
2025-03-28 11:04:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
.jshintrc
35 B
lrw-r--r--
2025-03-28 11:04:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
.npmignore
60 B
lrw-r--r--
2025-03-28 11:04:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
implementation.d.ts
62 B
lrw-r--r--
2025-03-28 11:04:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
implementation.js
56 B
lrw-r--r--
2025-03-28 11:04:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.d.ts
5.23 KB
lrw-r--r--
2025-03-28 11:04:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.js
49 B
lrw-r--r--
2025-03-28 11:04:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
LICENSE
1.04 KB
lrw-r--r--
2025-03-28 11:04:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
loader.js
2.52 KB
lrw-r--r--
2025-03-28 11:04:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
optional.js
118 B
lrw-r--r--
2025-03-28 11:04:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
package.json
1017 B
lrw-r--r--
2025-03-28 11:04:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
README.md
6.90 KB
lrw-r--r--
2025-03-28 11:04:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
register-shim.js
545 B
lrw-r--r--
2025-03-28 11:04:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
register.d.ts
362 B
lrw-r--r--
2025-03-28 11:04:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
register.js
2.84 KB
lrw-r--r--
2025-03-28 11:04:31
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).