HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /proc/1784574/root/usr/share/nodejs/has-dynamic-import/
Upload File :
Current File : //proc/1784574/root/usr/share/nodejs/has-dynamic-import/browser.js
'use strict';

var callBound = require('call-bind/callBound');
var $then = callBound('Promise.prototype.then', true);

var pFalse = $then && Promise.resolve(false);
var thunkFalse = function () {
	return false;
};
var thunkTrue = function () {
	return true;
};

module.exports = function hasFunctionality() {
	if (!$then) {
		return {
			then: function (resolve) {
				resolve(false);
			}
		};
	}

	try {
		var promise = Function('return import("data:text/javascript,")')(); // eslint-disable-line no-new-func

		return $then(promise, thunkTrue, thunkFalse);
	} catch (e) {
		return pFalse;
	}
};