Socket
Socket
Sign inDemoInstall

runtime-shared

Package Overview
Dependencies
0
Maintainers
4
Versions
85
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.6.4 to 0.6.5

1408

dist/shared.function.js

@@ -85,3 +85,3 @@ module.exports = function() {

/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 10);
/******/ return __webpack_require__(__webpack_require__.s = 2);
/******/ })

@@ -419,123 +419,562 @@ /************************************************************************/

// https://github.com/ericf/css-mediaquery
module.exports = {
get Promise() {
return __webpack_require__(3);
},
get Symbol() {
return __webpack_require__(0);
},
get Map() {
return __webpack_require__(4);
},
get Set() {
return __webpack_require__(5);
},
get WeakMap() {
return __webpack_require__(6);
},
get WeakSet() {
return __webpack_require__(7);
},
get FontFace() {
return __webpack_require__(8);
},
get URL() {
return __webpack_require__(9);
},
get URLSearchParams() {
return __webpack_require__(1);
},
get matchMedia() {
return __webpack_require__(10);
}
};
var RE_MEDIA_QUERY = /^(?:(only|not)?\s*([_a-z][_a-z0-9-]*)|(\([^\)]+\)))(?:\s*and\s*(.*))?$/i,
RE_MQ_EXPRESSION = /^\(\s*([_a-z-][_a-z0-9-]*)\s*(?:\:\s*([^\)]+))?\s*\)$/,
RE_MQ_FEATURE = /^(?:(min|max)-)?(.+)/;
/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
function _matches(media, values) {
return _parseQuery(media).some(function (query) {
var inverse = query.inverse;
"use strict";
var typeMatch = query.type === 'all' || values.type === query.type;
if (typeMatch && inverse || !(typeMatch || inverse)) {
return false;
}
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var expressionsMatch = query.expressions.every(function (expression) {
var feature = expression.feature,
modifier = expression.modifier,
expValue = expression.value,
value = values[feature];
/* eslint no-extend-native: "off" */
if (!value) {
return false;
}
function noop() {}
switch (feature) {
case 'width':
case 'height':
expValue = parseFloat(expValue);
value = parseFloat(value);
break;
// Use polyfill for setImmediate for performance gains
var asap = typeof setImmediate === 'function' && setImmediate || function (fn) {
if (typeof setTimeout === 'function') {
setTimeout(fn, 0);
} else {
fn();
}
};
var onUnhandledRejection = function onUnhandledRejection(err) {
if (typeof console !== 'undefined' && console) {
console.log('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console
}
};
// Polyfill for Function.prototype.bind
function bind(fn, thisArg) {
return function () {
fn.apply(thisArg, arguments);
};
}
function Promise(fn) {
if (_typeof(this) !== 'object') throw new TypeError('Promises must be constructed via new');
if (typeof fn !== 'function') throw new TypeError('Promise resolver is not a function');
this._state = 0;
this._handled = false;
this._value = undefined;
this._deferreds = [];
doResolve(fn, this);
}
function handle(self, deferred) {
while (self._state === 3) {
self = self._value;
}
if (self._state === 0) {
self._deferreds.push(deferred);
return;
}
self._handled = true;
asap(function () {
var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
if (cb === null) {
(self._state === 1 ? resolve : reject)(deferred.promise, self._value);
return;
}
var ret;
try {
ret = cb(self._value);
} catch (e) {
reject(deferred.promise, e);
return;
}
resolve(deferred.promise, ret);
});
}
function resolve(self, newValue) {
try {
// Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure
if (newValue === self) throw new TypeError('A promise cannot be resolved with itself.');
if (newValue && ((typeof newValue === 'undefined' ? 'undefined' : _typeof(newValue)) === 'object' || typeof newValue === 'function')) {
var then = newValue.then;
if (newValue instanceof Promise) {
self._state = 3;
self._value = newValue;
finale(self);
return;
} else if (typeof then === 'function') {
doResolve(bind(then, newValue), self);
return;
}
}
self._state = 1;
self._value = newValue;
finale(self);
} catch (e) {
reject(self, e);
}
}
switch (modifier) {
case 'min':
return value >= expValue;
case 'max':
return value <= expValue;
default:
return value === expValue;
function reject(self, newValue) {
self._state = 2;
self._value = newValue;
finale(self);
}
function finale(self) {
if (self._state === 2 && self._deferreds.length === 0) {
asap(function () {
if (!self._handled) {
onUnhandledRejection(self._value);
}
});
}
return expressionsMatch && !inverse || !expressionsMatch && inverse;
});
for (var i = 0, len = self._deferreds.length; i < len; i++) {
handle(self, self._deferreds[i]);
}
self._deferreds = null;
}
function Handler(onFulfilled, onRejected, promise) {
this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
this.onRejected = typeof onRejected === 'function' ? onRejected : null;
this.promise = promise;
}
/**
* Take a potentially misbehaving resolver function and make sure
* onFulfilled and onRejected are only called once.
*
* Makes no guarantees about asynchrony.
*/
function doResolve(fn, self) {
var done = false;
try {
fn(function (value) {
if (done) return;
done = true;
resolve(self, value);
}, function (reason) {
if (done) return;
done = true;
reject(self, reason);
});
} catch (ex) {
if (done) return;
done = true;
reject(self, ex);
}
}
Promise.prototype.catch = function (onRejected) {
return this.then(null, onRejected);
};
function _parseQuery(media) {
return media.split(',').map(function (query) {
query = query.trim();
Promise.prototype.then = function (onFulfilled, onRejected) {
var prom = new this.constructor(noop);
var captures = query.match(RE_MEDIA_QUERY);
handle(this, new Handler(onFulfilled, onRejected, prom));
return prom;
};
if (!captures) {
throw new SyntaxError('Invalid CSS media query: "' + query + '"');
}
Promise.all = function (arr) {
var args = Array.prototype.slice.call(arr);
var modifier = captures[1],
type = captures[2],
expressions = ((captures[3] || '') + (captures[4] || '')).trim(),
parsed = {};
return new Promise(function (resolve, reject) {
if (args.length === 0) return resolve([]);
var remaining = args.length;
parsed.inverse = !!modifier && modifier.toLowerCase() === 'not';
parsed.type = type ? type.toLowerCase() : 'all';
function res(i, val) {
try {
if (val && ((typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object' || typeof val === 'function')) {
var then = val.then;
if (typeof then === 'function') {
then.call(val, function (val) {
res(i, val);
}, reject);
return;
}
}
args[i] = val;
if (--remaining === 0) {
resolve(args);
}
} catch (ex) {
reject(ex);
}
}
if (!expressions) {
parsed.expressions = [];
return parsed;
for (var i = 0; i < args.length; i++) {
res(i, args[i]);
}
});
};
expressions = expressions.match(/\([^\)]+\)/g);
Promise.resolve = function (value) {
if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.constructor === Promise) {
return value;
}
if (!expressions) {
throw new SyntaxError('Invalid CSS media query: "' + query + '"');
return new Promise(function (resolve) {
resolve(value);
});
};
Promise.reject = function (value) {
return new Promise(function (resolve, reject) {
reject(value);
});
};
Promise.race = function (values) {
return new Promise(function (resolve, reject) {
for (var i = 0, len = values.length; i < len; i++) {
values[i].then(resolve, reject);
}
});
};
parsed.expressions = expressions.map(function (expression) {
var captures = expression.match(RE_MQ_EXPRESSION);
/**
* Set the immediate function to execute callbacks
* @param fn {function} Function to execute
* @private
*/
Promise._setImmediateFn = function _setImmediateFn(fn) {
asap = fn;
};
if (!captures) {
throw new SyntaxError('Invalid CSS media query: "' + query + '"');
Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) {
onUnhandledRejection = fn;
};
module.exports = Promise;
/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _symbol = __webpack_require__(0);
var _symbol2 = _interopRequireDefault(_symbol);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// Deleted map items mess with iterator pointers, so rather than removing them mark them as deleted. Can't use undefined or null since those both valid keys so use a private symbol.
var undefMarker = (0, _symbol2.default)('undef');
// NaN cannot be found in an array using indexOf, so we encode NaNs using a private symbol.
/* eslint no-extend-native: "off" */
var NaNMarker = (0, _symbol2.default)('NaN');
var ACCESSOR_SUPPORT = true;
function encodeKey(key) {
// Number.isNaN not extist in iOS 8.x
return key !== key ? NaNMarker : key;
}
function decodeKey(encodedKey) {
return encodedKey === NaNMarker ? NaN : encodedKey;
}
function makeIterator(mapInst, getter) {
var nextIdx = 0;
var done = false;
return {
next: function next() {
if (nextIdx === mapInst._keys.length) done = true;
if (!done) {
while (mapInst._keys[nextIdx] === undefMarker) {
nextIdx++;
}return { value: getter.call(mapInst, nextIdx++), done: false };
} else {
return { value: void 0, done: true };
}
}
};
}
var feature = captures[1].toLowerCase().match(RE_MQ_FEATURE);
function calcSize(mapInst) {
var size = 0;
for (var i = 0, s = mapInst._keys.length; i < s; i++) {
if (mapInst._keys[i] !== undefMarker) size++;
}
return size;
}
return {
modifier: feature[1],
feature: feature[2],
value: captures[2]
};
});
function hasProtoMethod(instance, method) {
return typeof instance[method] === 'function';
}
return parsed;
var Map = function Map(data) {
this._keys = [];
this._values = [];
// If `data` is iterable (indicated by presence of a forEach method), pre-populate the map
if (data && hasProtoMethod(data, 'forEach')) {
// Fastpath: If `data` is a Map, shortcircuit all following the checks
if (data instanceof Map ||
// If `data` is not an instance of Map, it could be because you have a Map from an iframe or a worker or something.
// Check if `data` has all the `Map` methods and if so, assume data is another Map
hasProtoMethod(data, 'clear') && hasProtoMethod(data, 'delete') && hasProtoMethod(data, 'entries') && hasProtoMethod(data, 'forEach') && hasProtoMethod(data, 'get') && hasProtoMethod(data, 'has') && hasProtoMethod(data, 'keys') && hasProtoMethod(data, 'set') && hasProtoMethod(data, 'values')) {
data.forEach(function (value, key) {
this.set.apply(this, [key, value]);
}, this);
} else {
data.forEach(function (item) {
this.set.apply(this, item);
}, this);
}
}
if (!ACCESSOR_SUPPORT) this.size = calcSize(this);
};
Map.prototype = {};
// Some old engines do not support ES5 getters/setters. Since Map only requires these for the size property, we can fall back to setting the size property statically each time the size of the map changes.
try {
Object.defineProperty(Map.prototype, 'size', {
get: function get() {
return calcSize(this);
}
});
} catch (e) {
ACCESSOR_SUPPORT = false;
}
Map.prototype.get = function (key) {
var idx = this._keys.indexOf(encodeKey(key));
return idx !== -1 ? this._values[idx] : undefined;
};
Map.prototype.set = function (key, value) {
var idx = this._keys.indexOf(encodeKey(key));
if (idx !== -1) {
this._values[idx] = value;
} else {
this._keys.push(encodeKey(key));
this._values.push(value);
if (!ACCESSOR_SUPPORT) this.size = calcSize(this);
}
return this;
};
Map.prototype.has = function (key) {
return this._keys.indexOf(encodeKey(key)) !== -1;
};
Map.prototype.delete = function (key) {
var idx = this._keys.indexOf(encodeKey(key));
if (idx === -1) return false;
this._keys[idx] = undefMarker;
this._values[idx] = undefMarker;
if (!ACCESSOR_SUPPORT) this.size = calcSize(this);
return true;
};
Map.prototype.clear = function () {
this._keys = this._values = [];
if (!ACCESSOR_SUPPORT) this.size = 0;
};
Map.prototype.values = function () {
return makeIterator(this, function (i) {
return this._values[i];
});
};
Map.prototype.keys = function () {
return makeIterator(this, function (i) {
return decodeKey(this._keys[i]);
});
};
Map.prototype.entries = Map.prototype[_symbol2.default.iterator] = function () {
return makeIterator(this, function (i) {
return [decodeKey(this._keys[i]), this._values[i]];
});
};
Map.prototype.forEach = function (callbackFn, thisArg) {
thisArg = thisArg || global;
var iterator = this.entries();
var result = iterator.next();
while (result.done === false) {
callbackFn.call(thisArg, result.value[1], result.value[0], this);
result = iterator.next();
}
};
function matchMedia(media) {
var mql = {
matches: false,
media: media
Map.prototype[_symbol2.default.species] = Map;
Object.defineProperty(Map, 'constructor', {
value: Map
});
try {
Object.defineProperty(Map, 'length', {
value: 0
});
} catch (e) {}
module.exports = Map;
/***/ }),
/* 5 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _symbol = __webpack_require__(0);
var _symbol2 = _interopRequireDefault(_symbol);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// Deleted map items mess with iterator pointers, so rather than removing them mark them as deleted. Can't use undefined or null since those both valid keys so use a private symbol.
var undefMarker = (0, _symbol2.default)('undef');
// NaN cannot be found in an array using indexOf, so we encode NaNs using a private symbol.
/* eslint no-extend-native: "off" */
var NaNMarker = (0, _symbol2.default)('NaN');
var ACCESSOR_SUPPORT = true;
function encodeVal(data) {
// Number.isNaN not extist in iOS 8.x
return data !== data ? NaNMarker : data;
}
function decodeVal(encodedData) {
return encodedData === NaNMarker ? NaN : encodedData;
}
function makeIterator(setInst, getter) {
var nextIdx = 0;
return {
next: function next() {
while (setInst._values[nextIdx] === undefMarker) {
nextIdx++;
}if (nextIdx === setInst._values.length) {
return { value: void 0, done: true };
} else {
return { value: getter.call(setInst, nextIdx++), done: false };
}
}
};
}
if (media === '') {
mql.matches = true;
return mql;
function calcSize(setInst) {
var size = 0;
for (var i = 0, s = setInst._values.length; i < s; i++) {
if (setInst._values[i] !== undefMarker) size++;
}
return size;
}
mql.matches = _matches(media, {
type: 'screen',
width: window.screen.width,
height: window.screen.height
var Set = function Set(data) {
this._values = [];
// If `data` is iterable (indicated by presence of a forEach method), pre-populate the set
data && typeof data.forEach === 'function' && data.forEach(function (item) {
this.add.call(this, item);
}, this);
if (!ACCESSOR_SUPPORT) this.size = calcSize(this);
};
// Some old engines do not support ES5 getters/setters. Since Set only requires these for the size property, we can fall back to setting the size property statically each time the size of the set changes.
try {
Object.defineProperty(Set.prototype, 'size', {
get: function get() {
return calcSize(this);
}
});
return mql;
} catch (e) {
ACCESSOR_SUPPORT = false;
}
module.exports = matchMedia;
Set.prototype.add = function (value) {
value = encodeVal(value);
if (this._values.indexOf(value) === -1) {
this._values.push(value);
if (!ACCESSOR_SUPPORT) this.size = calcSize(this);
}
return this;
};
Set.prototype.has = function (value) {
return this._values.indexOf(encodeVal(value)) !== -1;
};
Set.prototype.delete = function (value) {
var idx = this._values.indexOf(encodeVal(value));
if (idx === -1) return false;
this._values[idx] = undefMarker;
if (!ACCESSOR_SUPPORT) this.size = calcSize(this);
return true;
};
Set.prototype.clear = function () {
this._values = [];
if (!ACCESSOR_SUPPORT) this.size = 0;
};
Set.prototype.values = Set.prototype.keys = function () {
return makeIterator(this, function (i) {
return decodeVal(this._values[i]);
});
};
Set.prototype.entries = Set.prototype[_symbol2.default.iterator] = function () {
return makeIterator(this, function (i) {
return [decodeVal(this._values[i]), decodeVal(this._values[i])];
});
};
Set.prototype.forEach = function (callbackFn, thisArg) {
thisArg = thisArg || global;
var iterator = this.entries();
var result = iterator.next();
while (result.done === false) {
callbackFn.call(thisArg, result.value[1], result.value[0], this);
result = iterator.next();
}
};
Set.prototype[_symbol2.default.species] = Set;
Object.defineProperty(Set, 'constructor', {
value: Set
});
try {
Object.defineProperty(Set, 'length', {
value: 0
});
} catch (e) {}
module.exports = Set;
/***/ }),
/* 3 */
/* 6 */
/***/ (function(module, exports, __webpack_require__) {

@@ -546,2 +985,105 @@

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* eslint no-extend-native: "off" */
var defineProperty = Object.defineProperty;
var counter = Date.now() % 1e9;
var WeakMap = function WeakMap(data) {
this.name = '__st' + (Math.random() * 1e9 >>> 0) + (counter++ + '__');
// If data is iterable (indicated by presence of a forEach method), pre-populate the map
data && data.forEach && data.forEach(function (item) {
this.set.apply(this, item);
}, this);
};
WeakMap.prototype.set = function (key, value) {
if ((typeof key === 'undefined' ? 'undefined' : _typeof(key)) !== 'object' && typeof key !== 'function') throw new TypeError('Invalid value used as weak map key');
var entry = key[this.name];
if (entry && entry[0] === key) entry[1] = value;else defineProperty(key, this.name, { value: [key, value], writable: true });
return this;
};
WeakMap.prototype.get = function (key) {
var entry;
return (entry = key[this.name]) && entry[0] === key ? entry[1] : undefined;
};
WeakMap.prototype.delete = function (key) {
var entry = key[this.name];
if (!entry || entry[0] !== key) return false;
entry[0] = entry[1] = undefined;
return true;
};
WeakMap.prototype.has = function (key) {
var entry = key[this.name];
if (!entry) return false;
return entry[0] === key;
};
module.exports = WeakMap;
/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* eslint no-extend-native: "off" */
var counter = Date.now() % 1e9;
var WeakSet = function WeakSet(data) {
this.name = '__st' + (Math.random() * 1e9 >>> 0) + (counter++ + '__');
data && data.forEach && data.forEach(this.add, this);
};
WeakSet.prototype.add = function (obj) {
var name = this.name;
if (!obj[name]) Object.defineProperty(obj, name, { value: true, writable: true });
return this;
};
WeakSet.prototype.delete = function (obj) {
if (!obj[this.name]) return false;
obj[this.name] = undefined;
return true;
};
WeakSet.prototype.has = function (obj) {
return !!obj[this.name];
};
module.exports = WeakSet;
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var FontFace = function FontFace(family, source) {
_classCallCheck(this, FontFace);
this.family = family;
this.source = source;
};
module.exports = FontFace;
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// https://github.com/Polymer/URL

@@ -1110,3 +1652,3 @@

/***/ }),
/* 4 */
/* 10 */
/***/ (function(module, exports, __webpack_require__) {

@@ -1117,664 +1659,122 @@

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
// https://github.com/ericf/css-mediaquery
var FontFace = function FontFace(family, source) {
_classCallCheck(this, FontFace);
var RE_MEDIA_QUERY = /^(?:(only|not)?\s*([_a-z][_a-z0-9-]*)|(\([^\)]+\)))(?:\s*and\s*(.*))?$/i,
RE_MQ_EXPRESSION = /^\(\s*([_a-z-][_a-z0-9-]*)\s*(?:\:\s*([^\)]+))?\s*\)$/,
RE_MQ_FEATURE = /^(?:(min|max)-)?(.+)/;
this.family = family;
this.source = source;
};
function _matches(media, values) {
return _parseQuery(media).some(function (query) {
var inverse = query.inverse;
module.exports = FontFace;
var typeMatch = query.type === 'all' || values.type === query.type;
/***/ }),
/* 5 */
/***/ (function(module, exports, __webpack_require__) {
if (typeMatch && inverse || !(typeMatch || inverse)) {
return false;
}
"use strict";
var expressionsMatch = query.expressions.every(function (expression) {
var feature = expression.feature,
modifier = expression.modifier,
expValue = expression.value,
value = values[feature];
if (!value) {
return false;
}
/* eslint no-extend-native: "off" */
switch (feature) {
case 'width':
case 'height':
expValue = parseFloat(expValue);
value = parseFloat(value);
break;
}
var counter = Date.now() % 1e9;
var WeakSet = function WeakSet(data) {
this.name = '__st' + (Math.random() * 1e9 >>> 0) + (counter++ + '__');
data && data.forEach && data.forEach(this.add, this);
};
WeakSet.prototype.add = function (obj) {
var name = this.name;
if (!obj[name]) Object.defineProperty(obj, name, { value: true, writable: true });
return this;
};
WeakSet.prototype.delete = function (obj) {
if (!obj[this.name]) return false;
obj[this.name] = undefined;
return true;
};
WeakSet.prototype.has = function (obj) {
return !!obj[this.name];
};
module.exports = WeakSet;
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* eslint no-extend-native: "off" */
var defineProperty = Object.defineProperty;
var counter = Date.now() % 1e9;
var WeakMap = function WeakMap(data) {
this.name = '__st' + (Math.random() * 1e9 >>> 0) + (counter++ + '__');
// If data is iterable (indicated by presence of a forEach method), pre-populate the map
data && data.forEach && data.forEach(function (item) {
this.set.apply(this, item);
}, this);
};
WeakMap.prototype.set = function (key, value) {
if ((typeof key === 'undefined' ? 'undefined' : _typeof(key)) !== 'object' && typeof key !== 'function') throw new TypeError('Invalid value used as weak map key');
var entry = key[this.name];
if (entry && entry[0] === key) entry[1] = value;else defineProperty(key, this.name, { value: [key, value], writable: true });
return this;
};
WeakMap.prototype.get = function (key) {
var entry;
return (entry = key[this.name]) && entry[0] === key ? entry[1] : undefined;
};
WeakMap.prototype.delete = function (key) {
var entry = key[this.name];
if (!entry || entry[0] !== key) return false;
entry[0] = entry[1] = undefined;
return true;
};
WeakMap.prototype.has = function (key) {
var entry = key[this.name];
if (!entry) return false;
return entry[0] === key;
};
module.exports = WeakMap;
/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _symbol = __webpack_require__(0);
var _symbol2 = _interopRequireDefault(_symbol);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// Deleted map items mess with iterator pointers, so rather than removing them mark them as deleted. Can't use undefined or null since those both valid keys so use a private symbol.
var undefMarker = (0, _symbol2.default)('undef');
// NaN cannot be found in an array using indexOf, so we encode NaNs using a private symbol.
/* eslint no-extend-native: "off" */
var NaNMarker = (0, _symbol2.default)('NaN');
var ACCESSOR_SUPPORT = true;
function encodeVal(data) {
// Number.isNaN not extist in iOS 8.x
return data !== data ? NaNMarker : data;
}
function decodeVal(encodedData) {
return encodedData === NaNMarker ? NaN : encodedData;
}
function makeIterator(setInst, getter) {
var nextIdx = 0;
return {
next: function next() {
while (setInst._values[nextIdx] === undefMarker) {
nextIdx++;
}if (nextIdx === setInst._values.length) {
return { value: void 0, done: true };
} else {
return { value: getter.call(setInst, nextIdx++), done: false };
switch (modifier) {
case 'min':
return value >= expValue;
case 'max':
return value <= expValue;
default:
return value === expValue;
}
}
};
}
});
function calcSize(setInst) {
var size = 0;
for (var i = 0, s = setInst._values.length; i < s; i++) {
if (setInst._values[i] !== undefMarker) size++;
}
return size;
}
var Set = function Set(data) {
this._values = [];
// If `data` is iterable (indicated by presence of a forEach method), pre-populate the set
data && typeof data.forEach === 'function' && data.forEach(function (item) {
this.add.call(this, item);
}, this);
if (!ACCESSOR_SUPPORT) this.size = calcSize(this);
};
// Some old engines do not support ES5 getters/setters. Since Set only requires these for the size property, we can fall back to setting the size property statically each time the size of the set changes.
try {
Object.defineProperty(Set.prototype, 'size', {
get: function get() {
return calcSize(this);
}
return expressionsMatch && !inverse || !expressionsMatch && inverse;
});
} catch (e) {
ACCESSOR_SUPPORT = false;
}
Set.prototype.add = function (value) {
value = encodeVal(value);
if (this._values.indexOf(value) === -1) {
this._values.push(value);
if (!ACCESSOR_SUPPORT) this.size = calcSize(this);
}
return this;
};
Set.prototype.has = function (value) {
return this._values.indexOf(encodeVal(value)) !== -1;
};
Set.prototype.delete = function (value) {
var idx = this._values.indexOf(encodeVal(value));
if (idx === -1) return false;
this._values[idx] = undefMarker;
if (!ACCESSOR_SUPPORT) this.size = calcSize(this);
return true;
};
Set.prototype.clear = function () {
this._values = [];
if (!ACCESSOR_SUPPORT) this.size = 0;
};
Set.prototype.values = Set.prototype.keys = function () {
return makeIterator(this, function (i) {
return decodeVal(this._values[i]);
});
};
Set.prototype.entries = Set.prototype[_symbol2.default.iterator] = function () {
return makeIterator(this, function (i) {
return [decodeVal(this._values[i]), decodeVal(this._values[i])];
});
};
Set.prototype.forEach = function (callbackFn, thisArg) {
thisArg = thisArg || global;
var iterator = this.entries();
var result = iterator.next();
while (result.done === false) {
callbackFn.call(thisArg, result.value[1], result.value[0], this);
result = iterator.next();
}
};
Set.prototype[_symbol2.default.species] = Set;
function _parseQuery(media) {
return media.split(',').map(function (query) {
query = query.trim();
Object.defineProperty(Set, 'constructor', {
value: Set
});
var captures = query.match(RE_MEDIA_QUERY);
try {
Object.defineProperty(Set, 'length', {
value: 0
});
} catch (e) {}
module.exports = Set;
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _symbol = __webpack_require__(0);
var _symbol2 = _interopRequireDefault(_symbol);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// Deleted map items mess with iterator pointers, so rather than removing them mark them as deleted. Can't use undefined or null since those both valid keys so use a private symbol.
var undefMarker = (0, _symbol2.default)('undef');
// NaN cannot be found in an array using indexOf, so we encode NaNs using a private symbol.
/* eslint no-extend-native: "off" */
var NaNMarker = (0, _symbol2.default)('NaN');
var ACCESSOR_SUPPORT = true;
function encodeKey(key) {
// Number.isNaN not extist in iOS 8.x
return key !== key ? NaNMarker : key;
}
function decodeKey(encodedKey) {
return encodedKey === NaNMarker ? NaN : encodedKey;
}
function makeIterator(mapInst, getter) {
var nextIdx = 0;
var done = false;
return {
next: function next() {
if (nextIdx === mapInst._keys.length) done = true;
if (!done) {
while (mapInst._keys[nextIdx] === undefMarker) {
nextIdx++;
}return { value: getter.call(mapInst, nextIdx++), done: false };
} else {
return { value: void 0, done: true };
}
if (!captures) {
throw new SyntaxError('Invalid CSS media query: "' + query + '"');
}
};
}
function calcSize(mapInst) {
var size = 0;
for (var i = 0, s = mapInst._keys.length; i < s; i++) {
if (mapInst._keys[i] !== undefMarker) size++;
}
return size;
}
var modifier = captures[1],
type = captures[2],
expressions = ((captures[3] || '') + (captures[4] || '')).trim(),
parsed = {};
function hasProtoMethod(instance, method) {
return typeof instance[method] === 'function';
}
parsed.inverse = !!modifier && modifier.toLowerCase() === 'not';
parsed.type = type ? type.toLowerCase() : 'all';
var Map = function Map(data) {
this._keys = [];
this._values = [];
// If `data` is iterable (indicated by presence of a forEach method), pre-populate the map
if (data && hasProtoMethod(data, 'forEach')) {
// Fastpath: If `data` is a Map, shortcircuit all following the checks
if (data instanceof Map ||
// If `data` is not an instance of Map, it could be because you have a Map from an iframe or a worker or something.
// Check if `data` has all the `Map` methods and if so, assume data is another Map
hasProtoMethod(data, 'clear') && hasProtoMethod(data, 'delete') && hasProtoMethod(data, 'entries') && hasProtoMethod(data, 'forEach') && hasProtoMethod(data, 'get') && hasProtoMethod(data, 'has') && hasProtoMethod(data, 'keys') && hasProtoMethod(data, 'set') && hasProtoMethod(data, 'values')) {
data.forEach(function (value, key) {
this.set.apply(this, [key, value]);
}, this);
} else {
data.forEach(function (item) {
this.set.apply(this, item);
}, this);
if (!expressions) {
parsed.expressions = [];
return parsed;
}
}
if (!ACCESSOR_SUPPORT) this.size = calcSize(this);
};
Map.prototype = {};
expressions = expressions.match(/\([^\)]+\)/g);
// Some old engines do not support ES5 getters/setters. Since Map only requires these for the size property, we can fall back to setting the size property statically each time the size of the map changes.
try {
Object.defineProperty(Map.prototype, 'size', {
get: function get() {
return calcSize(this);
if (!expressions) {
throw new SyntaxError('Invalid CSS media query: "' + query + '"');
}
});
} catch (e) {
ACCESSOR_SUPPORT = false;
}
Map.prototype.get = function (key) {
var idx = this._keys.indexOf(encodeKey(key));
return idx !== -1 ? this._values[idx] : undefined;
};
Map.prototype.set = function (key, value) {
var idx = this._keys.indexOf(encodeKey(key));
if (idx !== -1) {
this._values[idx] = value;
} else {
this._keys.push(encodeKey(key));
this._values.push(value);
if (!ACCESSOR_SUPPORT) this.size = calcSize(this);
}
return this;
};
Map.prototype.has = function (key) {
return this._keys.indexOf(encodeKey(key)) !== -1;
};
Map.prototype.delete = function (key) {
var idx = this._keys.indexOf(encodeKey(key));
if (idx === -1) return false;
this._keys[idx] = undefMarker;
this._values[idx] = undefMarker;
if (!ACCESSOR_SUPPORT) this.size = calcSize(this);
return true;
};
Map.prototype.clear = function () {
this._keys = this._values = [];
if (!ACCESSOR_SUPPORT) this.size = 0;
};
Map.prototype.values = function () {
return makeIterator(this, function (i) {
return this._values[i];
});
};
Map.prototype.keys = function () {
return makeIterator(this, function (i) {
return decodeKey(this._keys[i]);
});
};
Map.prototype.entries = Map.prototype[_symbol2.default.iterator] = function () {
return makeIterator(this, function (i) {
return [decodeKey(this._keys[i]), this._values[i]];
});
};
Map.prototype.forEach = function (callbackFn, thisArg) {
thisArg = thisArg || global;
var iterator = this.entries();
var result = iterator.next();
while (result.done === false) {
callbackFn.call(thisArg, result.value[1], result.value[0], this);
result = iterator.next();
}
};
parsed.expressions = expressions.map(function (expression) {
var captures = expression.match(RE_MQ_EXPRESSION);
Map.prototype[_symbol2.default.species] = Map;
Object.defineProperty(Map, 'constructor', {
value: Map
});
try {
Object.defineProperty(Map, 'length', {
value: 0
});
} catch (e) {}
module.exports = Map;
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* eslint no-extend-native: "off" */
function noop() {}
// Use polyfill for setImmediate for performance gains
var asap = typeof setImmediate === 'function' && setImmediate || function (fn) {
if (typeof setTimeout === 'function') {
setTimeout(fn, 0);
} else {
fn();
}
};
var onUnhandledRejection = function onUnhandledRejection(err) {
if (typeof console !== 'undefined' && console) {
console.log('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console
}
};
// Polyfill for Function.prototype.bind
function bind(fn, thisArg) {
return function () {
fn.apply(thisArg, arguments);
};
}
function Promise(fn) {
if (_typeof(this) !== 'object') throw new TypeError('Promises must be constructed via new');
if (typeof fn !== 'function') throw new TypeError('Promise resolver is not a function');
this._state = 0;
this._handled = false;
this._value = undefined;
this._deferreds = [];
doResolve(fn, this);
}
function handle(self, deferred) {
while (self._state === 3) {
self = self._value;
}
if (self._state === 0) {
self._deferreds.push(deferred);
return;
}
self._handled = true;
asap(function () {
var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
if (cb === null) {
(self._state === 1 ? resolve : reject)(deferred.promise, self._value);
return;
}
var ret;
try {
ret = cb(self._value);
} catch (e) {
reject(deferred.promise, e);
return;
}
resolve(deferred.promise, ret);
});
}
function resolve(self, newValue) {
try {
// Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure
if (newValue === self) throw new TypeError('A promise cannot be resolved with itself.');
if (newValue && ((typeof newValue === 'undefined' ? 'undefined' : _typeof(newValue)) === 'object' || typeof newValue === 'function')) {
var then = newValue.then;
if (newValue instanceof Promise) {
self._state = 3;
self._value = newValue;
finale(self);
return;
} else if (typeof then === 'function') {
doResolve(bind(then, newValue), self);
return;
if (!captures) {
throw new SyntaxError('Invalid CSS media query: "' + query + '"');
}
}
self._state = 1;
self._value = newValue;
finale(self);
} catch (e) {
reject(self, e);
}
}
function reject(self, newValue) {
self._state = 2;
self._value = newValue;
finale(self);
}
var feature = captures[1].toLowerCase().match(RE_MQ_FEATURE);
function finale(self) {
if (self._state === 2 && self._deferreds.length === 0) {
asap(function () {
if (!self._handled) {
onUnhandledRejection(self._value);
}
return {
modifier: feature[1],
feature: feature[2],
value: captures[2]
};
});
}
for (var i = 0, len = self._deferreds.length; i < len; i++) {
handle(self, self._deferreds[i]);
}
self._deferreds = null;
}
function Handler(onFulfilled, onRejected, promise) {
this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
this.onRejected = typeof onRejected === 'function' ? onRejected : null;
this.promise = promise;
}
/**
* Take a potentially misbehaving resolver function and make sure
* onFulfilled and onRejected are only called once.
*
* Makes no guarantees about asynchrony.
*/
function doResolve(fn, self) {
var done = false;
try {
fn(function (value) {
if (done) return;
done = true;
resolve(self, value);
}, function (reason) {
if (done) return;
done = true;
reject(self, reason);
});
} catch (ex) {
if (done) return;
done = true;
reject(self, ex);
}
}
Promise.prototype.catch = function (onRejected) {
return this.then(null, onRejected);
return parsed;
});
};
Promise.prototype.then = function (onFulfilled, onRejected) {
var prom = new this.constructor(noop);
function matchMedia(media) {
var mql = {
matches: false,
media: media
};
handle(this, new Handler(onFulfilled, onRejected, prom));
return prom;
};
Promise.all = function (arr) {
var args = Array.prototype.slice.call(arr);
return new Promise(function (resolve, reject) {
if (args.length === 0) return resolve([]);
var remaining = args.length;
function res(i, val) {
try {
if (val && ((typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object' || typeof val === 'function')) {
var then = val.then;
if (typeof then === 'function') {
then.call(val, function (val) {
res(i, val);
}, reject);
return;
}
}
args[i] = val;
if (--remaining === 0) {
resolve(args);
}
} catch (ex) {
reject(ex);
}
}
for (var i = 0; i < args.length; i++) {
res(i, args[i]);
}
});
};
Promise.resolve = function (value) {
if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.constructor === Promise) {
return value;
if (media === '') {
mql.matches = true;
return mql;
}
return new Promise(function (resolve) {
resolve(value);
mql.matches = _matches(media, {
type: 'screen',
width: window.screen.width,
height: window.screen.height
});
};
Promise.reject = function (value) {
return new Promise(function (resolve, reject) {
reject(value);
});
};
return mql;
}
Promise.race = function (values) {
return new Promise(function (resolve, reject) {
for (var i = 0, len = values.length; i < len; i++) {
values[i].then(resolve, reject);
}
});
};
module.exports = matchMedia;
/**
* Set the immediate function to execute callbacks
* @param fn {function} Function to execute
* @private
*/
Promise._setImmediateFn = function _setImmediateFn(fn) {
asap = fn;
};
Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) {
onUnhandledRejection = fn;
};
module.exports = Promise;
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = {
get Promise() {
return __webpack_require__(9);
},
get Symbol() {
return __webpack_require__(0);
},
get Map() {
return __webpack_require__(8);
},
get Set() {
return __webpack_require__(7);
},
get WeakMap() {
return __webpack_require__(6);
},
get WeakSet() {
return __webpack_require__(5);
},
get FontFace() {
return __webpack_require__(4);
},
get URL() {
return __webpack_require__(3);
},
get URLSearchParams() {
return __webpack_require__(1);
},
get matchMedia() {
return __webpack_require__(2);
}
};
/***/ })
/******/ ])};;
{
"name": "runtime-shared",
"version": "0.6.4",
"version": "0.6.5",
"description": "Shared Runtime.",

@@ -5,0 +5,0 @@ "license": "BSD-3-Clause",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc