Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

unload

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unload - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

1242

dist/browserify.js
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
'use strict';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
value: true
});
exports["default"] = void 0;
/* global WorkerGlobalScope */
function add(fn) {
if (typeof WorkerGlobalScope === 'function' && self instanceof WorkerGlobalScope) {
// this is run inside of a webworker
} else {
/**
* for normal browser-windows, we use the beforeunload-event
*/
window.addEventListener('beforeunload', function () {
fn();
}, true);
if (typeof WorkerGlobalScope === 'function' && self instanceof WorkerGlobalScope) {// this is run inside of a webworker
} else {
/**
* for normal browser-windows, we use the beforeunload-event
*/
window.addEventListener('beforeunload', function () {
fn();
}, true);
/**
* for iframes, we have to use the unload-event
* @link https://stackoverflow.com/q/47533670/3443137
*/
/**
* for iframes, we have to use the unload-event
* @link https://stackoverflow.com/q/47533670/3443137
*/
window.addEventListener('unload', function () {
fn();
}, true);
}
window.addEventListener('unload', function () {
fn();
}, true);
}
/**
* TODO add fallback for safari-mobile
* @link https://stackoverflow.com/a/26193516/3443137
*/
/**
* TODO add fallback for safari-mobile
* @link https://stackoverflow.com/a/26193516/3443137
*/
}
exports['default'] = {
add: add
var _default = {
add: add
};
exports["default"] = _default;
},{}],2:[function(require,module,exports){
'use strict';
"use strict";
var unload = require('./index.js');
window['unload'] = unload;
},{"./index.js":3}],3:[function(require,module,exports){
'use strict';
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
value: true
});
var _typeof2 = require('babel-runtime/helpers/typeof');
var _typeof3 = _interopRequireDefault(_typeof2);
exports.add = add;

@@ -58,1157 +57,94 @@ exports.runAll = runAll;

exports.getSize = getSize;
exports["default"] = void 0;
var _detectNode = require('detect-node');
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
var _detectNode2 = _interopRequireDefault(_detectNode);
var _detectNode = _interopRequireDefault(require("detect-node"));
var _browser = require('./browser.js');
var _browser = _interopRequireDefault(require("./browser.js"));
var _browser2 = _interopRequireDefault(_browser);
var _node = _interopRequireDefault(require("./node.js"));
var _node = require('./node.js');
var _node2 = _interopRequireDefault(_node);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var USE_METHOD = _detectNode2['default'] ? _node2['default'] : _browser2['default'];
var USE_METHOD = _detectNode["default"] ? _node["default"] : _browser["default"];
var LISTENERS = new Set();
var startedListening = false;
var startedListening = false;
function startListening() {
if (startedListening) return;
startedListening = true;
USE_METHOD.add(runAll);
if (startedListening) return;
startedListening = true;
USE_METHOD.add(runAll);
}
function add(fn) {
startListening();
if (typeof fn !== 'function') throw new Error('The "listener" argument must be of type Function. Received type ' + (typeof fn === 'undefined' ? 'undefined' : (0, _typeof3['default'])(fn)));
LISTENERS.add(fn);
var addReturn = {
remove: function remove() {
return LISTENERS['delete'](fn);
},
run: function run() {
LISTENERS['delete'](fn);
return fn();
}
};
return addReturn;
startListening();
if (typeof fn !== 'function') throw new Error('The "listener" argument must be of type Function. Received type ' + (0, _typeof2["default"])(fn));
LISTENERS.add(fn);
var addReturn = {
remove: function remove() {
return LISTENERS["delete"](fn);
},
run: function run() {
LISTENERS["delete"](fn);
return fn();
}
};
return addReturn;
}
function runAll() {
var promises = [];
LISTENERS.forEach(function (fn) {
promises.push(fn());
LISTENERS['delete'](fn);
});
return Promise.all(promises);
var promises = [];
LISTENERS.forEach(function (fn) {
promises.push(fn());
LISTENERS["delete"](fn);
});
return Promise.all(promises);
}
function removeAll() {
LISTENERS.clear();
LISTENERS.clear();
}
function getSize() {
return LISTENERS.size;
return LISTENERS.size;
}
exports['default'] = {
add: add,
runAll: runAll,
removeAll: removeAll,
getSize: getSize
var _default = {
add: add,
runAll: runAll,
removeAll: removeAll,
getSize: getSize
};
},{"./browser.js":1,"./node.js":7,"babel-runtime/helpers/typeof":6,"detect-node":72}],4:[function(require,module,exports){
module.exports = { "default": require("core-js/library/fn/symbol"), __esModule: true };
},{"core-js/library/fn/symbol":8}],5:[function(require,module,exports){
module.exports = { "default": require("core-js/library/fn/symbol/iterator"), __esModule: true };
},{"core-js/library/fn/symbol/iterator":9}],6:[function(require,module,exports){
"use strict";
exports.__esModule = true;
var _iterator = require("../core-js/symbol/iterator");
var _iterator2 = _interopRequireDefault(_iterator);
var _symbol = require("../core-js/symbol");
var _symbol2 = _interopRequireDefault(_symbol);
var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) {
return typeof obj === "undefined" ? "undefined" : _typeof(obj);
} : function (obj) {
return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj);
};
},{"../core-js/symbol":4,"../core-js/symbol/iterator":5}],7:[function(require,module,exports){
},{}],8:[function(require,module,exports){
require('../../modules/es6.symbol');
require('../../modules/es6.object.to-string');
require('../../modules/es7.symbol.async-iterator');
require('../../modules/es7.symbol.observable');
module.exports = require('../../modules/_core').Symbol;
},{"../../modules/_core":15,"../../modules/es6.object.to-string":66,"../../modules/es6.symbol":68,"../../modules/es7.symbol.async-iterator":69,"../../modules/es7.symbol.observable":70}],9:[function(require,module,exports){
require('../../modules/es6.string.iterator');
require('../../modules/web.dom.iterable');
module.exports = require('../../modules/_wks-ext').f('iterator');
},{"../../modules/_wks-ext":63,"../../modules/es6.string.iterator":67,"../../modules/web.dom.iterable":71}],10:[function(require,module,exports){
module.exports = function (it) {
if (typeof it != 'function') throw TypeError(it + ' is not a function!');
return it;
};
},{}],11:[function(require,module,exports){
module.exports = function () { /* empty */ };
},{}],12:[function(require,module,exports){
var isObject = require('./_is-object');
module.exports = function (it) {
if (!isObject(it)) throw TypeError(it + ' is not an object!');
return it;
};
},{"./_is-object":31}],13:[function(require,module,exports){
// false -> Array#indexOf
// true -> Array#includes
var toIObject = require('./_to-iobject');
var toLength = require('./_to-length');
var toAbsoluteIndex = require('./_to-absolute-index');
module.exports = function (IS_INCLUDES) {
return function ($this, el, fromIndex) {
var O = toIObject($this);
var length = toLength(O.length);
var index = toAbsoluteIndex(fromIndex, length);
var value;
// Array#includes uses SameValueZero equality algorithm
// eslint-disable-next-line no-self-compare
if (IS_INCLUDES && el != el) while (length > index) {
value = O[index++];
// eslint-disable-next-line no-self-compare
if (value != value) return true;
// Array#indexOf ignores holes, Array#includes - not
} else for (;length > index; index++) if (IS_INCLUDES || index in O) {
if (O[index] === el) return IS_INCLUDES || index || 0;
} return !IS_INCLUDES && -1;
exports["default"] = _default;
},{"./browser.js":1,"./node.js":6,"@babel/runtime/helpers/interopRequireDefault":4,"@babel/runtime/helpers/typeof":5,"detect-node":7}],4:[function(require,module,exports){
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
};
}
},{"./_to-absolute-index":55,"./_to-iobject":57,"./_to-length":58}],14:[function(require,module,exports){
var toString = {}.toString;
module.exports = _interopRequireDefault;
},{}],5:[function(require,module,exports){
function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); }
module.exports = function (it) {
return toString.call(it).slice(8, -1);
};
},{}],15:[function(require,module,exports){
var core = module.exports = { version: '2.5.7' };
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
},{}],16:[function(require,module,exports){
// optional / simple context binding
var aFunction = require('./_a-function');
module.exports = function (fn, that, length) {
aFunction(fn);
if (that === undefined) return fn;
switch (length) {
case 1: return function (a) {
return fn.call(that, a);
function _typeof(obj) {
if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") {
module.exports = _typeof = function _typeof(obj) {
return _typeof2(obj);
};
case 2: return function (a, b) {
return fn.call(that, a, b);
} else {
module.exports = _typeof = function _typeof(obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj);
};
case 3: return function (a, b, c) {
return fn.call(that, a, b, c);
};
}
return function (/* ...args */) {
return fn.apply(that, arguments);
};
};
},{"./_a-function":10}],17:[function(require,module,exports){
// 7.2.1 RequireObjectCoercible(argument)
module.exports = function (it) {
if (it == undefined) throw TypeError("Can't call method on " + it);
return it;
};
},{}],18:[function(require,module,exports){
// Thank's IE8 for his funny defineProperty
module.exports = !require('./_fails')(function () {
return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
});
},{"./_fails":23}],19:[function(require,module,exports){
var isObject = require('./_is-object');
var document = require('./_global').document;
// typeof document.createElement is 'object' in old IE
var is = isObject(document) && isObject(document.createElement);
module.exports = function (it) {
return is ? document.createElement(it) : {};
};
},{"./_global":24,"./_is-object":31}],20:[function(require,module,exports){
// IE 8- don't enum bug keys
module.exports = (
'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
).split(',');
},{}],21:[function(require,module,exports){
// all enumerable object keys, includes symbols
var getKeys = require('./_object-keys');
var gOPS = require('./_object-gops');
var pIE = require('./_object-pie');
module.exports = function (it) {
var result = getKeys(it);
var getSymbols = gOPS.f;
if (getSymbols) {
var symbols = getSymbols(it);
var isEnum = pIE.f;
var i = 0;
var key;
while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
} return result;
};
},{"./_object-gops":44,"./_object-keys":47,"./_object-pie":48}],22:[function(require,module,exports){
var global = require('./_global');
var core = require('./_core');
var ctx = require('./_ctx');
var hide = require('./_hide');
var has = require('./_has');
var PROTOTYPE = 'prototype';
var $export = function (type, name, source) {
var IS_FORCED = type & $export.F;
var IS_GLOBAL = type & $export.G;
var IS_STATIC = type & $export.S;
var IS_PROTO = type & $export.P;
var IS_BIND = type & $export.B;
var IS_WRAP = type & $export.W;
var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
var expProto = exports[PROTOTYPE];
var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];
var key, own, out;
if (IS_GLOBAL) source = name;
for (key in source) {
// contains in native
own = !IS_FORCED && target && target[key] !== undefined;
if (own && has(exports, key)) continue;
// export native or passed
out = own ? target[key] : source[key];
// prevent global pollution for namespaces
exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
// bind timers to global for call from export context
: IS_BIND && own ? ctx(out, global)
// wrap global constructors for prevent change them in library
: IS_WRAP && target[key] == out ? (function (C) {
var F = function (a, b, c) {
if (this instanceof C) {
switch (arguments.length) {
case 0: return new C();
case 1: return new C(a);
case 2: return new C(a, b);
} return new C(a, b, c);
} return C.apply(this, arguments);
};
F[PROTOTYPE] = C[PROTOTYPE];
return F;
// make static versions for prototype methods
})(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
// export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
if (IS_PROTO) {
(exports.virtual || (exports.virtual = {}))[key] = out;
// export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);
}
}
};
// type bitmap
$export.F = 1; // forced
$export.G = 2; // global
$export.S = 4; // static
$export.P = 8; // proto
$export.B = 16; // bind
$export.W = 32; // wrap
$export.U = 64; // safe
$export.R = 128; // real proto method for `library`
module.exports = $export;
},{"./_core":15,"./_ctx":16,"./_global":24,"./_has":25,"./_hide":26}],23:[function(require,module,exports){
module.exports = function (exec) {
try {
return !!exec();
} catch (e) {
return true;
}
};
},{}],24:[function(require,module,exports){
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global = module.exports = typeof window != 'undefined' && window.Math == Math
? window : typeof self != 'undefined' && self.Math == Math ? self
// eslint-disable-next-line no-new-func
: Function('return this')();
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
},{}],25:[function(require,module,exports){
var hasOwnProperty = {}.hasOwnProperty;
module.exports = function (it, key) {
return hasOwnProperty.call(it, key);
};
},{}],26:[function(require,module,exports){
var dP = require('./_object-dp');
var createDesc = require('./_property-desc');
module.exports = require('./_descriptors') ? function (object, key, value) {
return dP.f(object, key, createDesc(1, value));
} : function (object, key, value) {
object[key] = value;
return object;
};
},{"./_descriptors":18,"./_object-dp":39,"./_property-desc":49}],27:[function(require,module,exports){
var document = require('./_global').document;
module.exports = document && document.documentElement;
},{"./_global":24}],28:[function(require,module,exports){
module.exports = !require('./_descriptors') && !require('./_fails')(function () {
return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;
});
},{"./_descriptors":18,"./_dom-create":19,"./_fails":23}],29:[function(require,module,exports){
// fallback for non-array-like ES3 and non-enumerable old V8 strings
var cof = require('./_cof');
// eslint-disable-next-line no-prototype-builtins
module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
return cof(it) == 'String' ? it.split('') : Object(it);
};
},{"./_cof":14}],30:[function(require,module,exports){
// 7.2.2 IsArray(argument)
var cof = require('./_cof');
module.exports = Array.isArray || function isArray(arg) {
return cof(arg) == 'Array';
};
},{"./_cof":14}],31:[function(require,module,exports){
module.exports = function (it) {
return typeof it === 'object' ? it !== null : typeof it === 'function';
};
},{}],32:[function(require,module,exports){
'use strict';
var create = require('./_object-create');
var descriptor = require('./_property-desc');
var setToStringTag = require('./_set-to-string-tag');
var IteratorPrototype = {};
// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
require('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function () { return this; });
module.exports = function (Constructor, NAME, next) {
Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
setToStringTag(Constructor, NAME + ' Iterator');
};
},{"./_hide":26,"./_object-create":38,"./_property-desc":49,"./_set-to-string-tag":51,"./_wks":64}],33:[function(require,module,exports){
'use strict';
var LIBRARY = require('./_library');
var $export = require('./_export');
var redefine = require('./_redefine');
var hide = require('./_hide');
var Iterators = require('./_iterators');
var $iterCreate = require('./_iter-create');
var setToStringTag = require('./_set-to-string-tag');
var getPrototypeOf = require('./_object-gpo');
var ITERATOR = require('./_wks')('iterator');
var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
var FF_ITERATOR = '@@iterator';
var KEYS = 'keys';
var VALUES = 'values';
var returnThis = function () { return this; };
module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
$iterCreate(Constructor, NAME, next);
var getMethod = function (kind) {
if (!BUGGY && kind in proto) return proto[kind];
switch (kind) {
case KEYS: return function keys() { return new Constructor(this, kind); };
case VALUES: return function values() { return new Constructor(this, kind); };
} return function entries() { return new Constructor(this, kind); };
};
var TAG = NAME + ' Iterator';
var DEF_VALUES = DEFAULT == VALUES;
var VALUES_BUG = false;
var proto = Base.prototype;
var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
var $default = $native || getMethod(DEFAULT);
var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
var methods, key, IteratorPrototype;
// Fix native
if ($anyNative) {
IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
// Set @@toStringTag to native iterators
setToStringTag(IteratorPrototype, TAG, true);
// fix for some old engines
if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
}
}
// fix Array#{values, @@iterator}.name in V8 / FF
if (DEF_VALUES && $native && $native.name !== VALUES) {
VALUES_BUG = true;
$default = function values() { return $native.call(this); };
}
// Define iterator
if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
hide(proto, ITERATOR, $default);
}
// Plug for library
Iterators[NAME] = $default;
Iterators[TAG] = returnThis;
if (DEFAULT) {
methods = {
values: DEF_VALUES ? $default : getMethod(VALUES),
keys: IS_SET ? $default : getMethod(KEYS),
entries: $entries
};
if (FORCED) for (key in methods) {
if (!(key in proto)) redefine(proto, key, methods[key]);
} else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
}
return methods;
};
},{"./_export":22,"./_hide":26,"./_iter-create":32,"./_iterators":35,"./_library":36,"./_object-gpo":45,"./_redefine":50,"./_set-to-string-tag":51,"./_wks":64}],34:[function(require,module,exports){
module.exports = function (done, value) {
return { value: value, done: !!done };
};
},{}],35:[function(require,module,exports){
module.exports = {};
},{}],36:[function(require,module,exports){
module.exports = true;
},{}],37:[function(require,module,exports){
var META = require('./_uid')('meta');
var isObject = require('./_is-object');
var has = require('./_has');
var setDesc = require('./_object-dp').f;
var id = 0;
var isExtensible = Object.isExtensible || function () {
return true;
};
var FREEZE = !require('./_fails')(function () {
return isExtensible(Object.preventExtensions({}));
});
var setMeta = function (it) {
setDesc(it, META, { value: {
i: 'O' + ++id, // object ID
w: {} // weak collections IDs
} });
};
var fastKey = function (it, create) {
// return primitive with prefix
if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
if (!has(it, META)) {
// can't set metadata to uncaught frozen object
if (!isExtensible(it)) return 'F';
// not necessary to add metadata
if (!create) return 'E';
// add missing metadata
setMeta(it);
// return object ID
} return it[META].i;
};
var getWeak = function (it, create) {
if (!has(it, META)) {
// can't set metadata to uncaught frozen object
if (!isExtensible(it)) return true;
// not necessary to add metadata
if (!create) return false;
// add missing metadata
setMeta(it);
// return hash weak collections IDs
} return it[META].w;
};
// add metadata on freeze-family methods calling
var onFreeze = function (it) {
if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
return it;
};
var meta = module.exports = {
KEY: META,
NEED: false,
fastKey: fastKey,
getWeak: getWeak,
onFreeze: onFreeze
};
},{"./_fails":23,"./_has":25,"./_is-object":31,"./_object-dp":39,"./_uid":61}],38:[function(require,module,exports){
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
var anObject = require('./_an-object');
var dPs = require('./_object-dps');
var enumBugKeys = require('./_enum-bug-keys');
var IE_PROTO = require('./_shared-key')('IE_PROTO');
var Empty = function () { /* empty */ };
var PROTOTYPE = 'prototype';
// Create object with fake `null` prototype: use iframe Object with cleared prototype
var createDict = function () {
// Thrash, waste and sodomy: IE GC bug
var iframe = require('./_dom-create')('iframe');
var i = enumBugKeys.length;
var lt = '<';
var gt = '>';
var iframeDocument;
iframe.style.display = 'none';
require('./_html').appendChild(iframe);
iframe.src = 'javascript:'; // eslint-disable-line no-script-url
// createDict = iframe.contentWindow.Object;
// html.removeChild(iframe);
iframeDocument = iframe.contentWindow.document;
iframeDocument.open();
iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
iframeDocument.close();
createDict = iframeDocument.F;
while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
return createDict();
};
module.exports = Object.create || function create(O, Properties) {
var result;
if (O !== null) {
Empty[PROTOTYPE] = anObject(O);
result = new Empty();
Empty[PROTOTYPE] = null;
// add "__proto__" for Object.getPrototypeOf polyfill
result[IE_PROTO] = O;
} else result = createDict();
return Properties === undefined ? result : dPs(result, Properties);
};
},{"./_an-object":12,"./_dom-create":19,"./_enum-bug-keys":20,"./_html":27,"./_object-dps":40,"./_shared-key":52}],39:[function(require,module,exports){
var anObject = require('./_an-object');
var IE8_DOM_DEFINE = require('./_ie8-dom-define');
var toPrimitive = require('./_to-primitive');
var dP = Object.defineProperty;
exports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {
anObject(O);
P = toPrimitive(P, true);
anObject(Attributes);
if (IE8_DOM_DEFINE) try {
return dP(O, P, Attributes);
} catch (e) { /* empty */ }
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
if ('value' in Attributes) O[P] = Attributes.value;
return O;
};
},{"./_an-object":12,"./_descriptors":18,"./_ie8-dom-define":28,"./_to-primitive":60}],40:[function(require,module,exports){
var dP = require('./_object-dp');
var anObject = require('./_an-object');
var getKeys = require('./_object-keys');
module.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties) {
anObject(O);
var keys = getKeys(Properties);
var length = keys.length;
var i = 0;
var P;
while (length > i) dP.f(O, P = keys[i++], Properties[P]);
return O;
};
},{"./_an-object":12,"./_descriptors":18,"./_object-dp":39,"./_object-keys":47}],41:[function(require,module,exports){
var pIE = require('./_object-pie');
var createDesc = require('./_property-desc');
var toIObject = require('./_to-iobject');
var toPrimitive = require('./_to-primitive');
var has = require('./_has');
var IE8_DOM_DEFINE = require('./_ie8-dom-define');
var gOPD = Object.getOwnPropertyDescriptor;
exports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor(O, P) {
O = toIObject(O);
P = toPrimitive(P, true);
if (IE8_DOM_DEFINE) try {
return gOPD(O, P);
} catch (e) { /* empty */ }
if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
};
},{"./_descriptors":18,"./_has":25,"./_ie8-dom-define":28,"./_object-pie":48,"./_property-desc":49,"./_to-iobject":57,"./_to-primitive":60}],42:[function(require,module,exports){
// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
var toIObject = require('./_to-iobject');
var gOPN = require('./_object-gopn').f;
var toString = {}.toString;
var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
? Object.getOwnPropertyNames(window) : [];
var getWindowNames = function (it) {
try {
return gOPN(it);
} catch (e) {
return windowNames.slice();
}
};
module.exports.f = function getOwnPropertyNames(it) {
return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
};
},{"./_object-gopn":43,"./_to-iobject":57}],43:[function(require,module,exports){
// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
var $keys = require('./_object-keys-internal');
var hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype');
exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
return $keys(O, hiddenKeys);
};
},{"./_enum-bug-keys":20,"./_object-keys-internal":46}],44:[function(require,module,exports){
exports.f = Object.getOwnPropertySymbols;
},{}],45:[function(require,module,exports){
// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
var has = require('./_has');
var toObject = require('./_to-object');
var IE_PROTO = require('./_shared-key')('IE_PROTO');
var ObjectProto = Object.prototype;
module.exports = Object.getPrototypeOf || function (O) {
O = toObject(O);
if (has(O, IE_PROTO)) return O[IE_PROTO];
if (typeof O.constructor == 'function' && O instanceof O.constructor) {
return O.constructor.prototype;
} return O instanceof Object ? ObjectProto : null;
};
},{"./_has":25,"./_shared-key":52,"./_to-object":59}],46:[function(require,module,exports){
var has = require('./_has');
var toIObject = require('./_to-iobject');
var arrayIndexOf = require('./_array-includes')(false);
var IE_PROTO = require('./_shared-key')('IE_PROTO');
module.exports = function (object, names) {
var O = toIObject(object);
var i = 0;
var result = [];
var key;
for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
// Don't enum bug & hidden keys
while (names.length > i) if (has(O, key = names[i++])) {
~arrayIndexOf(result, key) || result.push(key);
}
return result;
};
},{"./_array-includes":13,"./_has":25,"./_shared-key":52,"./_to-iobject":57}],47:[function(require,module,exports){
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
var $keys = require('./_object-keys-internal');
var enumBugKeys = require('./_enum-bug-keys');
module.exports = Object.keys || function keys(O) {
return $keys(O, enumBugKeys);
};
},{"./_enum-bug-keys":20,"./_object-keys-internal":46}],48:[function(require,module,exports){
exports.f = {}.propertyIsEnumerable;
},{}],49:[function(require,module,exports){
module.exports = function (bitmap, value) {
return {
enumerable: !(bitmap & 1),
configurable: !(bitmap & 2),
writable: !(bitmap & 4),
value: value
};
};
},{}],50:[function(require,module,exports){
module.exports = require('./_hide');
},{"./_hide":26}],51:[function(require,module,exports){
var def = require('./_object-dp').f;
var has = require('./_has');
var TAG = require('./_wks')('toStringTag');
module.exports = function (it, tag, stat) {
if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
};
},{"./_has":25,"./_object-dp":39,"./_wks":64}],52:[function(require,module,exports){
var shared = require('./_shared')('keys');
var uid = require('./_uid');
module.exports = function (key) {
return shared[key] || (shared[key] = uid(key));
};
},{"./_shared":53,"./_uid":61}],53:[function(require,module,exports){
var core = require('./_core');
var global = require('./_global');
var SHARED = '__core-js_shared__';
var store = global[SHARED] || (global[SHARED] = {});
(module.exports = function (key, value) {
return store[key] || (store[key] = value !== undefined ? value : {});
})('versions', []).push({
version: core.version,
mode: require('./_library') ? 'pure' : 'global',
copyright: '© 2018 Denis Pushkarev (zloirock.ru)'
});
},{"./_core":15,"./_global":24,"./_library":36}],54:[function(require,module,exports){
var toInteger = require('./_to-integer');
var defined = require('./_defined');
// true -> String#at
// false -> String#codePointAt
module.exports = function (TO_STRING) {
return function (that, pos) {
var s = String(defined(that));
var i = toInteger(pos);
var l = s.length;
var a, b;
if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
a = s.charCodeAt(i);
return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
? TO_STRING ? s.charAt(i) : a
: TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
};
};
},{"./_defined":17,"./_to-integer":56}],55:[function(require,module,exports){
var toInteger = require('./_to-integer');
var max = Math.max;
var min = Math.min;
module.exports = function (index, length) {
index = toInteger(index);
return index < 0 ? max(index + length, 0) : min(index, length);
};
},{"./_to-integer":56}],56:[function(require,module,exports){
// 7.1.4 ToInteger
var ceil = Math.ceil;
var floor = Math.floor;
module.exports = function (it) {
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
};
},{}],57:[function(require,module,exports){
// to indexed object, toObject with fallback for non-array-like ES3 strings
var IObject = require('./_iobject');
var defined = require('./_defined');
module.exports = function (it) {
return IObject(defined(it));
};
},{"./_defined":17,"./_iobject":29}],58:[function(require,module,exports){
// 7.1.15 ToLength
var toInteger = require('./_to-integer');
var min = Math.min;
module.exports = function (it) {
return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
};
},{"./_to-integer":56}],59:[function(require,module,exports){
// 7.1.13 ToObject(argument)
var defined = require('./_defined');
module.exports = function (it) {
return Object(defined(it));
};
},{"./_defined":17}],60:[function(require,module,exports){
// 7.1.1 ToPrimitive(input [, PreferredType])
var isObject = require('./_is-object');
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
module.exports = function (it, S) {
if (!isObject(it)) return it;
var fn, val;
if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
throw TypeError("Can't convert object to primitive value");
};
},{"./_is-object":31}],61:[function(require,module,exports){
var id = 0;
var px = Math.random();
module.exports = function (key) {
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
};
},{}],62:[function(require,module,exports){
var global = require('./_global');
var core = require('./_core');
var LIBRARY = require('./_library');
var wksExt = require('./_wks-ext');
var defineProperty = require('./_object-dp').f;
module.exports = function (name) {
var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
};
},{"./_core":15,"./_global":24,"./_library":36,"./_object-dp":39,"./_wks-ext":63}],63:[function(require,module,exports){
exports.f = require('./_wks');
},{"./_wks":64}],64:[function(require,module,exports){
var store = require('./_shared')('wks');
var uid = require('./_uid');
var Symbol = require('./_global').Symbol;
var USE_SYMBOL = typeof Symbol == 'function';
var $exports = module.exports = function (name) {
return store[name] || (store[name] =
USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
};
$exports.store = store;
},{"./_global":24,"./_shared":53,"./_uid":61}],65:[function(require,module,exports){
'use strict';
var addToUnscopables = require('./_add-to-unscopables');
var step = require('./_iter-step');
var Iterators = require('./_iterators');
var toIObject = require('./_to-iobject');
// 22.1.3.4 Array.prototype.entries()
// 22.1.3.13 Array.prototype.keys()
// 22.1.3.29 Array.prototype.values()
// 22.1.3.30 Array.prototype[@@iterator]()
module.exports = require('./_iter-define')(Array, 'Array', function (iterated, kind) {
this._t = toIObject(iterated); // target
this._i = 0; // next index
this._k = kind; // kind
// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
}, function () {
var O = this._t;
var kind = this._k;
var index = this._i++;
if (!O || index >= O.length) {
this._t = undefined;
return step(1);
}
if (kind == 'keys') return step(0, index);
if (kind == 'values') return step(0, O[index]);
return step(0, [index, O[index]]);
}, 'values');
// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
Iterators.Arguments = Iterators.Array;
addToUnscopables('keys');
addToUnscopables('values');
addToUnscopables('entries');
},{"./_add-to-unscopables":11,"./_iter-define":33,"./_iter-step":34,"./_iterators":35,"./_to-iobject":57}],66:[function(require,module,exports){
arguments[4][7][0].apply(exports,arguments)
},{"dup":7}],67:[function(require,module,exports){
'use strict';
var $at = require('./_string-at')(true);
// 21.1.3.27 String.prototype[@@iterator]()
require('./_iter-define')(String, 'String', function (iterated) {
this._t = String(iterated); // target
this._i = 0; // next index
// 21.1.5.2.1 %StringIteratorPrototype%.next()
}, function () {
var O = this._t;
var index = this._i;
var point;
if (index >= O.length) return { value: undefined, done: true };
point = $at(O, index);
this._i += point.length;
return { value: point, done: false };
});
},{"./_iter-define":33,"./_string-at":54}],68:[function(require,module,exports){
'use strict';
// ECMAScript 6 symbols shim
var global = require('./_global');
var has = require('./_has');
var DESCRIPTORS = require('./_descriptors');
var $export = require('./_export');
var redefine = require('./_redefine');
var META = require('./_meta').KEY;
var $fails = require('./_fails');
var shared = require('./_shared');
var setToStringTag = require('./_set-to-string-tag');
var uid = require('./_uid');
var wks = require('./_wks');
var wksExt = require('./_wks-ext');
var wksDefine = require('./_wks-define');
var enumKeys = require('./_enum-keys');
var isArray = require('./_is-array');
var anObject = require('./_an-object');
var isObject = require('./_is-object');
var toIObject = require('./_to-iobject');
var toPrimitive = require('./_to-primitive');
var createDesc = require('./_property-desc');
var _create = require('./_object-create');
var gOPNExt = require('./_object-gopn-ext');
var $GOPD = require('./_object-gopd');
var $DP = require('./_object-dp');
var $keys = require('./_object-keys');
var gOPD = $GOPD.f;
var dP = $DP.f;
var gOPN = gOPNExt.f;
var $Symbol = global.Symbol;
var $JSON = global.JSON;
var _stringify = $JSON && $JSON.stringify;
var PROTOTYPE = 'prototype';
var HIDDEN = wks('_hidden');
var TO_PRIMITIVE = wks('toPrimitive');
var isEnum = {}.propertyIsEnumerable;
var SymbolRegistry = shared('symbol-registry');
var AllSymbols = shared('symbols');
var OPSymbols = shared('op-symbols');
var ObjectProto = Object[PROTOTYPE];
var USE_NATIVE = typeof $Symbol == 'function';
var QObject = global.QObject;
// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
var setSymbolDesc = DESCRIPTORS && $fails(function () {
return _create(dP({}, 'a', {
get: function () { return dP(this, 'a', { value: 7 }).a; }
})).a != 7;
}) ? function (it, key, D) {
var protoDesc = gOPD(ObjectProto, key);
if (protoDesc) delete ObjectProto[key];
dP(it, key, D);
if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);
} : dP;
var wrap = function (tag) {
var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
sym._k = tag;
return sym;
};
var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
return typeof it == 'symbol';
} : function (it) {
return it instanceof $Symbol;
};
var $defineProperty = function defineProperty(it, key, D) {
if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
anObject(it);
key = toPrimitive(key, true);
anObject(D);
if (has(AllSymbols, key)) {
if (!D.enumerable) {
if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));
it[HIDDEN][key] = true;
} else {
if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
D = _create(D, { enumerable: createDesc(0, false) });
} return setSymbolDesc(it, key, D);
} return dP(it, key, D);
};
var $defineProperties = function defineProperties(it, P) {
anObject(it);
var keys = enumKeys(P = toIObject(P));
var i = 0;
var l = keys.length;
var key;
while (l > i) $defineProperty(it, key = keys[i++], P[key]);
return it;
};
var $create = function create(it, P) {
return P === undefined ? _create(it) : $defineProperties(_create(it), P);
};
var $propertyIsEnumerable = function propertyIsEnumerable(key) {
var E = isEnum.call(this, key = toPrimitive(key, true));
if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;
return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
};
var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
it = toIObject(it);
key = toPrimitive(key, true);
if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;
var D = gOPD(it, key);
if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
return D;
};
var $getOwnPropertyNames = function getOwnPropertyNames(it) {
var names = gOPN(toIObject(it));
var result = [];
var i = 0;
var key;
while (names.length > i) {
if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
} return result;
};
var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
var IS_OP = it === ObjectProto;
var names = gOPN(IS_OP ? OPSymbols : toIObject(it));
var result = [];
var i = 0;
var key;
while (names.length > i) {
if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
} return result;
};
// 19.4.1.1 Symbol([description])
if (!USE_NATIVE) {
$Symbol = function Symbol() {
if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
var $set = function (value) {
if (this === ObjectProto) $set.call(OPSymbols, value);
if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
setSymbolDesc(this, tag, createDesc(1, value));
};
if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
return wrap(tag);
};
redefine($Symbol[PROTOTYPE], 'toString', function toString() {
return this._k;
});
$GOPD.f = $getOwnPropertyDescriptor;
$DP.f = $defineProperty;
require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames;
require('./_object-pie').f = $propertyIsEnumerable;
require('./_object-gops').f = $getOwnPropertySymbols;
if (DESCRIPTORS && !require('./_library')) {
redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
}
wksExt.f = function (name) {
return wrap(wks(name));
};
return _typeof(obj);
}
$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });
module.exports = _typeof;
},{}],6:[function(require,module,exports){
for (var es6Symbols = (
// 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);
for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);
$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
// 19.4.2.1 Symbol.for(key)
'for': function (key) {
return has(SymbolRegistry, key += '')
? SymbolRegistry[key]
: SymbolRegistry[key] = $Symbol(key);
},
// 19.4.2.5 Symbol.keyFor(sym)
keyFor: function keyFor(sym) {
if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
},
useSetter: function () { setter = true; },
useSimple: function () { setter = false; }
});
$export($export.S + $export.F * !USE_NATIVE, 'Object', {
// 19.1.2.2 Object.create(O [, Properties])
create: $create,
// 19.1.2.4 Object.defineProperty(O, P, Attributes)
defineProperty: $defineProperty,
// 19.1.2.3 Object.defineProperties(O, Properties)
defineProperties: $defineProperties,
// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
// 19.1.2.7 Object.getOwnPropertyNames(O)
getOwnPropertyNames: $getOwnPropertyNames,
// 19.1.2.8 Object.getOwnPropertySymbols(O)
getOwnPropertySymbols: $getOwnPropertySymbols
});
// 24.3.2 JSON.stringify(value [, replacer [, space]])
$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
var S = $Symbol();
// MS Edge converts symbol values to JSON as {}
// WebKit converts symbol values to JSON as null
// V8 throws on boxed symbols
return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
})), 'JSON', {
stringify: function stringify(it) {
var args = [it];
var i = 1;
var replacer, $replacer;
while (arguments.length > i) args.push(arguments[i++]);
$replacer = replacer = args[1];
if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
if (!isArray(replacer)) replacer = function (key, value) {
if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
if (!isSymbol(value)) return value;
};
args[1] = replacer;
return _stringify.apply($JSON, args);
}
});
// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
$Symbol[PROTOTYPE][TO_PRIMITIVE] || require('./_hide')($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
// 19.4.3.5 Symbol.prototype[@@toStringTag]
setToStringTag($Symbol, 'Symbol');
// 20.2.1.9 Math[@@toStringTag]
setToStringTag(Math, 'Math', true);
// 24.3.3 JSON[@@toStringTag]
setToStringTag(global.JSON, 'JSON', true);
},{"./_an-object":12,"./_descriptors":18,"./_enum-keys":21,"./_export":22,"./_fails":23,"./_global":24,"./_has":25,"./_hide":26,"./_is-array":30,"./_is-object":31,"./_library":36,"./_meta":37,"./_object-create":38,"./_object-dp":39,"./_object-gopd":41,"./_object-gopn":43,"./_object-gopn-ext":42,"./_object-gops":44,"./_object-keys":47,"./_object-pie":48,"./_property-desc":49,"./_redefine":50,"./_set-to-string-tag":51,"./_shared":53,"./_to-iobject":57,"./_to-primitive":60,"./_uid":61,"./_wks":64,"./_wks-define":62,"./_wks-ext":63}],69:[function(require,module,exports){
require('./_wks-define')('asyncIterator');
},{"./_wks-define":62}],70:[function(require,module,exports){
require('./_wks-define')('observable');
},{"./_wks-define":62}],71:[function(require,module,exports){
require('./es6.array.iterator');
var global = require('./_global');
var hide = require('./_hide');
var Iterators = require('./_iterators');
var TO_STRING_TAG = require('./_wks')('toStringTag');
var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +
'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +
'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +
'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +
'TextTrackList,TouchList').split(',');
for (var i = 0; i < DOMIterables.length; i++) {
var NAME = DOMIterables[i];
var Collection = global[NAME];
var proto = Collection && Collection.prototype;
if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
Iterators[NAME] = Iterators.Array;
}
},{"./_global":24,"./_hide":26,"./_iterators":35,"./_wks":64,"./es6.array.iterator":65}],72:[function(require,module,exports){
(function (global){
},{}],7:[function(require,module,exports){
module.exports = false;
// Only Node.JS has a process variable that is of [[Class]] process
try {
module.exports = Object.prototype.toString.call(global.process) === '[object process]'
} catch(e) {}
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}]},{},[2]);

44

dist/es/browser.js
/* global WorkerGlobalScope */
function add(fn) {
if (typeof WorkerGlobalScope === 'function' && self instanceof WorkerGlobalScope) {
// this is run inside of a webworker
} else {
/**
* for normal browser-windows, we use the beforeunload-event
*/
window.addEventListener('beforeunload', function () {
fn();
}, true);
if (typeof WorkerGlobalScope === 'function' && self instanceof WorkerGlobalScope) {// this is run inside of a webworker
} else {
/**
* for normal browser-windows, we use the beforeunload-event
*/
window.addEventListener('beforeunload', function () {
fn();
}, true);
/**
* for iframes, we have to use the unload-event
* @link https://stackoverflow.com/q/47533670/3443137
*/
/**
* for iframes, we have to use the unload-event
* @link https://stackoverflow.com/q/47533670/3443137
*/
window.addEventListener('unload', function () {
fn();
}, true);
}
window.addEventListener('unload', function () {
fn();
}, true);
}
/**
* TODO add fallback for safari-mobile
* @link https://stackoverflow.com/a/26193516/3443137
*/
/**
* TODO add fallback for safari-mobile
* @link https://stackoverflow.com/a/26193516/3443137
*/
}
export default {
add: add
add: add
};
var unload = require('./index.js');
window['unload'] = unload;
import isNode from 'detect-node';
import BrowserMethod from './browser.js';
import NodeMethod from './node.js';
var USE_METHOD = isNode ? NodeMethod : BrowserMethod;
var LISTENERS = new Set();
var startedListening = false;
var startedListening = false;
function startListening() {
if (startedListening) return;
startedListening = true;
USE_METHOD.add(runAll);
if (startedListening) return;
startedListening = true;
USE_METHOD.add(runAll);
}
export function add(fn) {
startListening();
if (typeof fn !== 'function') throw new Error('The "listener" argument must be of type Function. Received type ' + typeof fn);
LISTENERS.add(fn);
var addReturn = {
remove: function remove() {
return LISTENERS['delete'](fn);
},
run: function run() {
LISTENERS['delete'](fn);
return fn();
}
};
return addReturn;
startListening();
if (typeof fn !== 'function') throw new Error('The "listener" argument must be of type Function. Received type ' + typeof fn);
LISTENERS.add(fn);
var addReturn = {
remove: function remove() {
return LISTENERS["delete"](fn);
},
run: function run() {
LISTENERS["delete"](fn);
return fn();
}
};
return addReturn;
}
export function runAll() {
var promises = [];
LISTENERS.forEach(function (fn) {
promises.push(fn());
LISTENERS['delete'](fn);
});
return Promise.all(promises);
var promises = [];
LISTENERS.forEach(function (fn) {
promises.push(fn());
LISTENERS["delete"](fn);
});
return Promise.all(promises);
}
export function removeAll() {
LISTENERS.clear();
LISTENERS.clear();
}
export function getSize() {
return LISTENERS.size;
return LISTENERS.size;
}
export default {
add: add,
runAll: runAll,
removeAll: removeAll,
getSize: getSize
add: add,
runAll: runAll,
removeAll: removeAll,
getSize: getSize
};

@@ -5,37 +5,37 @@ // set to true to log events

function add(fn) {
process.on('exit', function () {
DEBUG && console.log('node: exit');
return fn();
process.on('exit', function () {
DEBUG && console.log('node: exit');
return fn();
});
/**
* on the following events,
* the process will not end if there are
* event-handlers attached,
* therefore we have to call process.exit()
*/
process.on('beforeExit', function () {
DEBUG && console.log('node: beforeExit');
return fn().then(function () {
return process.exit();
});
}); // catches ctrl+c event
/**
* on the following events,
* the process will not end if there are
* event-handlers attached,
* therefore we have to call process.exit()
*/
process.on('beforeExit', function () {
DEBUG && console.log('node: beforeExit');
return fn().then(function () {
return process.exit();
});
process.on('SIGINT', function () {
DEBUG && console.log('node: SIGNINT');
return fn().then(function () {
return process.exit();
});
// catches ctrl+c event
process.on('SIGINT', function () {
DEBUG && console.log('node: SIGNINT');
return fn().then(function () {
return process.exit();
});
}); // catches uncaught exceptions
process.on('uncaughtException', function () {
DEBUG && console.log('node: uncaughtException');
return fn().then(function () {
return process.exit();
});
// catches uncaught exceptions
process.on('uncaughtException', function () {
DEBUG && console.log('node: uncaughtException');
return fn().then(function () {
return process.exit();
});
});
});
}
export default {
add: add
add: add
};

@@ -1,36 +0,37 @@

'use strict';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
value: true
});
exports["default"] = void 0;
/* global WorkerGlobalScope */
function add(fn) {
if (typeof WorkerGlobalScope === 'function' && self instanceof WorkerGlobalScope) {
// this is run inside of a webworker
} else {
/**
* for normal browser-windows, we use the beforeunload-event
*/
window.addEventListener('beforeunload', function () {
fn();
}, true);
if (typeof WorkerGlobalScope === 'function' && self instanceof WorkerGlobalScope) {// this is run inside of a webworker
} else {
/**
* for normal browser-windows, we use the beforeunload-event
*/
window.addEventListener('beforeunload', function () {
fn();
}, true);
/**
* for iframes, we have to use the unload-event
* @link https://stackoverflow.com/q/47533670/3443137
*/
/**
* for iframes, we have to use the unload-event
* @link https://stackoverflow.com/q/47533670/3443137
*/
window.addEventListener('unload', function () {
fn();
}, true);
}
window.addEventListener('unload', function () {
fn();
}, true);
}
/**
* TODO add fallback for safari-mobile
* @link https://stackoverflow.com/a/26193516/3443137
*/
/**
* TODO add fallback for safari-mobile
* @link https://stackoverflow.com/a/26193516/3443137
*/
}
exports['default'] = {
add: add
};
var _default = {
add: add
};
exports["default"] = _default;

@@ -1,4 +0,5 @@

'use strict';
"use strict";
var unload = require('./index.js');
window['unload'] = unload;

@@ -1,11 +0,8 @@

'use strict';
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
value: true
});
var _typeof2 = require('babel-runtime/helpers/typeof');
var _typeof3 = _interopRequireDefault(_typeof2);
exports.add = add;

@@ -15,66 +12,61 @@ exports.runAll = runAll;

exports.getSize = getSize;
exports["default"] = void 0;
var _detectNode = require('detect-node');
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
var _detectNode2 = _interopRequireDefault(_detectNode);
var _detectNode = _interopRequireDefault(require("detect-node"));
var _browser = require('./browser.js');
var _browser = _interopRequireDefault(require("./browser.js"));
var _browser2 = _interopRequireDefault(_browser);
var _node = _interopRequireDefault(require("./node.js"));
var _node = require('./node.js');
var _node2 = _interopRequireDefault(_node);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var USE_METHOD = _detectNode2['default'] ? _node2['default'] : _browser2['default'];
var USE_METHOD = _detectNode["default"] ? _node["default"] : _browser["default"];
var LISTENERS = new Set();
var startedListening = false;
var startedListening = false;
function startListening() {
if (startedListening) return;
startedListening = true;
USE_METHOD.add(runAll);
if (startedListening) return;
startedListening = true;
USE_METHOD.add(runAll);
}
function add(fn) {
startListening();
if (typeof fn !== 'function') throw new Error('The "listener" argument must be of type Function. Received type ' + (typeof fn === 'undefined' ? 'undefined' : (0, _typeof3['default'])(fn)));
LISTENERS.add(fn);
var addReturn = {
remove: function remove() {
return LISTENERS['delete'](fn);
},
run: function run() {
LISTENERS['delete'](fn);
return fn();
}
};
return addReturn;
startListening();
if (typeof fn !== 'function') throw new Error('The "listener" argument must be of type Function. Received type ' + (0, _typeof2["default"])(fn));
LISTENERS.add(fn);
var addReturn = {
remove: function remove() {
return LISTENERS["delete"](fn);
},
run: function run() {
LISTENERS["delete"](fn);
return fn();
}
};
return addReturn;
}
function runAll() {
var promises = [];
LISTENERS.forEach(function (fn) {
promises.push(fn());
LISTENERS['delete'](fn);
});
return Promise.all(promises);
var promises = [];
LISTENERS.forEach(function (fn) {
promises.push(fn());
LISTENERS["delete"](fn);
});
return Promise.all(promises);
}
function removeAll() {
LISTENERS.clear();
LISTENERS.clear();
}
function getSize() {
return LISTENERS.size;
return LISTENERS.size;
}
exports['default'] = {
add: add,
runAll: runAll,
removeAll: removeAll,
getSize: getSize
};
var _default = {
add: add,
runAll: runAll,
removeAll: removeAll,
getSize: getSize
};
exports["default"] = _default;

@@ -1,6 +0,7 @@

'use strict';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
value: true
});
exports["default"] = void 0;
// set to true to log events

@@ -10,37 +11,38 @@ var DEBUG = false;

function add(fn) {
process.on('exit', function () {
DEBUG && console.log('node: exit');
return fn();
process.on('exit', function () {
DEBUG && console.log('node: exit');
return fn();
});
/**
* on the following events,
* the process will not end if there are
* event-handlers attached,
* therefore we have to call process.exit()
*/
process.on('beforeExit', function () {
DEBUG && console.log('node: beforeExit');
return fn().then(function () {
return process.exit();
});
}); // catches ctrl+c event
/**
* on the following events,
* the process will not end if there are
* event-handlers attached,
* therefore we have to call process.exit()
*/
process.on('beforeExit', function () {
DEBUG && console.log('node: beforeExit');
return fn().then(function () {
return process.exit();
});
process.on('SIGINT', function () {
DEBUG && console.log('node: SIGNINT');
return fn().then(function () {
return process.exit();
});
// catches ctrl+c event
process.on('SIGINT', function () {
DEBUG && console.log('node: SIGNINT');
return fn().then(function () {
return process.exit();
});
}); // catches uncaught exceptions
process.on('uncaughtException', function () {
DEBUG && console.log('node: uncaughtException');
return fn().then(function () {
return process.exit();
});
// catches uncaught exceptions
process.on('uncaughtException', function () {
DEBUG && console.log('node: uncaughtException');
return fn().then(function () {
return process.exit();
});
});
});
}
exports['default'] = {
add: add
};
var _default = {
add: add
};
exports["default"] = _default;
{
"name": "unload",
"version": "2.0.1",
"version": "2.0.2",
"description": "Execute code when the js-process exits. On all javascript-environments",
"author": "pubkey",
"license": "Apache-2.0",
"keywords": [
"unload",
"exit",
"onunload",
"SIGINT",
"uncaughtException",
"beforeExit"
],
"scripts": {

@@ -9,4 +19,4 @@ "lint": "eslint src test",

"build:es6": "rimraf -rf dist/es && cross-env NODE_ENV=es6 babel src --out-dir dist/es",
"build:es5": "cross-env NODE_ENV=es5 node node_modules/babel-cli/bin/babel.js src --out-dir dist/lib",
"build:test": "cross-env NODE_ENV=es5 node node_modules/babel-cli/bin/babel.js test --out-dir test_tmp",
"build:es5": "cross-env NODE_ENV=es5 babel src --out-dir dist/lib",
"build:test": "cross-env NODE_ENV=es5 babel test --out-dir test_tmp",
"build:browser": "browserify dist/lib/index.browserify.js > dist/browserify.js",

@@ -27,12 +37,2 @@ "build:worker": "browserify test/helper/worker.js > test_tmp/worker.js",

},
"author": "pubkey",
"license": "Apache-2.0",
"keywords": [
"unload",
"exit",
"onunload",
"SIGINT",
"uncaughtException",
"beforeExit"
],
"pre-commit": [

@@ -47,22 +47,12 @@ "lint"

"async-test-util": "1.6.1",
"babel-cli": "6.26.0",
"babel-core": "6.26.3",
"babel-eslint": "8.2.6",
"babel-loader": "7.1.5",
"babel-plugin-transform-async-to-generator": "6.24.1",
"babel-plugin-transform-class-properties": "6.24.1",
"babel-plugin-transform-es2015-block-scoping": "6.26.0",
"babel-plugin-transform-es2015-constants": "6.1.4",
"babel-plugin-transform-es3-member-expression-literals": "6.22.0",
"babel-plugin-transform-es3-property-literals": "6.22.0",
"babel-plugin-transform-object-rest-spread": "6.26.0",
"babel-plugin-transform-regenerator": "6.26.0",
"babel-plugin-transform-runtime": "6.23.0",
"babel-polyfill": "6.26.0",
"babel-preset-es2015": "6.24.1",
"babel-preset-es2015-native-modules": "6.9.4",
"babel-preset-es2015-rollup": "3.0.0",
"babel-preset-es2016": "6.24.1",
"babel-preset-es2017": "6.24.1",
"babel-preset-latest": "6.24.1",
"@babel/cli": "7.1.0",
"@babel/core": "7.1.0",
"@babel/plugin-check-constants": "7.0.0-beta.38",
"@babel/plugin-proposal-object-rest-spread": "7.0.0",
"@babel/plugin-transform-member-expression-literals": "7.0.0",
"@babel/plugin-transform-property-literals": "7.0.0",
"@babel/plugin-transform-runtime": "7.1.0",
"@babel/polyfill": "7.0.0",
"@babel/preset-env": "7.1.0",
"@babel/types": "7.0.0",
"browserify": "16.2.2",

@@ -72,5 +62,5 @@ "child-process-promise": "2.2.1",

"concurrently": "3.6.1",
"cors": "^2.8.4",
"cors": "2.8.4",
"cross-env": "5.2.0",
"eslint": "5.2.0",
"eslint": "5.6.0",
"express": "4.16.3",

@@ -83,12 +73,12 @@ "http-server": "0.11.1",

"mocha": "5.2.0",
"node": "10.7.0",
"node": "10.10.0",
"node-cmd": "3.0.0",
"npm-run-all": "4.1.3",
"pre-commit": "1.2.2",
"request": "2.87.0",
"request": "2.88.0",
"request-promise-native": "1.0.5",
"rimraf": "2.6.2",
"ts-node": "7.0.0",
"typescript": "3.0.1",
"uglify-js": "3.4.6",
"ts-node": "7.0.1",
"typescript": "3.0.3",
"uglify-js": "3.4.9",
"util": "0.11.0",

@@ -99,3 +89,4 @@ "watch": "1.0.2",

"dependencies": {
"detect-node": "^2.0.3"
"@babel/runtime": "7.0.0",
"detect-node": "2.0.4"
},

@@ -102,0 +93,0 @@ "// browser": "this field contains files that will be empty objects in webpack-builds",

@@ -53,2 +53,2 @@ import isNode from 'detect-node';

getSize
};
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc