New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@advertol/context-media-query

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@advertol/context-media-query - npm Package Compare versions

Comparing version 1.0.0-alpha.0 to 1.0.0

CHANGELOG.md

677

index.cjs.js

@@ -30,450 +30,414 @@ 'use strict';

/**
* Returns the first argument provided to it.
*/
function identity(val) {
return val;
}
* Returns the first argument provided to it.
*/
function identity(val){
return val;
}
var identity_1 = identity;
var identity_1 = identity;
/**
* Returns a function that gets a property of the passed object
*/
function prop(name) {
return function (obj) {
return obj[name];
};
}
* Returns a function that gets a property of the passed object
*/
function prop(name){
return function(obj){
return obj[name];
};
}
var prop_1 = prop;
var prop_1 = prop;
/**
* Safer Object.hasOwnProperty
*/
function hasOwn(obj, prop) {
return Object.prototype.hasOwnProperty.call(obj, prop);
}
* Safer Object.hasOwnProperty
*/
function hasOwn(obj, prop){
return Object.prototype.hasOwnProperty.call(obj, prop);
}
var hasOwn_1 = hasOwn;
var hasOwn_1 = hasOwn;
var _hasDontEnumBug, _dontEnums;
var _hasDontEnumBug,
_dontEnums;
function checkDontEnum() {
_dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'];
_hasDontEnumBug = true;
function checkDontEnum(){
_dontEnums = [
'toString',
'toLocaleString',
'valueOf',
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',
'constructor'
];
for (var key in {
'toString': null
}) {
_hasDontEnumBug = false;
}
}
/**
* Similar to Array/forEach but works over object properties and fixes Don't
* Enum bug on IE.
* based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
*/
_hasDontEnumBug = true;
for (var key in {'toString': null}) {
_hasDontEnumBug = false;
}
}
function forIn(obj, fn, thisObj) {
var key,
i = 0; // no need to check if argument is a real object that way we can use
// it for arrays, functions, date, etc.
//post-pone check till needed
/**
* Similar to Array/forEach but works over object properties and fixes Don't
* Enum bug on IE.
* based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
*/
function forIn(obj, fn, thisObj){
var key, i = 0;
// no need to check if argument is a real object that way we can use
// it for arrays, functions, date, etc.
if (_hasDontEnumBug == null) checkDontEnum();
//post-pone check till needed
if (_hasDontEnumBug == null) checkDontEnum();
for (key in obj) {
if (exec(fn, obj, key, thisObj) === false) {
break;
}
}
for (key in obj) {
if (exec(fn, obj, key, thisObj) === false) {
break;
}
}
if (_hasDontEnumBug) {
var ctor = obj.constructor,
isProto = !!ctor && obj === ctor.prototype;
while (key = _dontEnums[i++]) {
// For constructor, if it is a prototype object the constructor
// is always non-enumerable unless defined otherwise (and
// enumerated above). For non-prototype objects, it will have
// to be defined on this object, since it cannot be defined on
// any prototype objects.
//
// For other [[DontEnum]] properties, check if the value is
// different than Object prototype value.
if ((key !== 'constructor' || !isProto && hasOwn_1(obj, key)) && obj[key] !== Object.prototype[key]) {
if (exec(fn, obj, key, thisObj) === false) {
break;
if (_hasDontEnumBug) {
var ctor = obj.constructor,
isProto = !!ctor && obj === ctor.prototype;
while (key = _dontEnums[i++]) {
// For constructor, if it is a prototype object the constructor
// is always non-enumerable unless defined otherwise (and
// enumerated above). For non-prototype objects, it will have
// to be defined on this object, since it cannot be defined on
// any prototype objects.
//
// For other [[DontEnum]] properties, check if the value is
// different than Object prototype value.
if (
(key !== 'constructor' ||
(!isProto && hasOwn_1(obj, key))) &&
obj[key] !== Object.prototype[key]
) {
if (exec(fn, obj, key, thisObj) === false) {
break;
}
}
}
}
}
}
}
}
function exec(fn, obj, key, thisObj) {
return fn.call(thisObj, obj[key], key, obj);
}
function exec(fn, obj, key, thisObj){
return fn.call(thisObj, obj[key], key, obj);
}
var forIn_1 = forIn;
var forIn_1 = forIn;
/**
* Similar to Array/forEach but works over object properties and fixes Don't
* Enum bug on IE.
* based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
*/
function forOwn(obj, fn, thisObj) {
forIn_1(obj, function (val, key) {
if (hasOwn_1(obj, key)) {
return fn.call(thisObj, obj[key], key, obj);
* Similar to Array/forEach but works over object properties and fixes Don't
* Enum bug on IE.
* based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
*/
function forOwn(obj, fn, thisObj){
forIn_1(obj, function(val, key){
if (hasOwn_1(obj, key)) {
return fn.call(thisObj, obj[key], key, obj);
}
});
}
});
}
var forOwn_1 = forOwn;
var forOwn_1 = forOwn;
/**
* Gets the "kind" of value. (e.g. "String", "Number", etc)
*/
function kindOf(val) {
return Object.prototype.toString.call(val).slice(8, -1);
}
* Gets the "kind" of value. (e.g. "String", "Number", etc)
*/
function kindOf(val) {
return Object.prototype.toString.call(val).slice(8, -1);
}
var kindOf_1 = kindOf;
var kindOf_1 = kindOf;
/**
* Check if value is from a specific "kind".
*/
* Check if value is from a specific "kind".
*/
function isKind(val, kind){
return kindOf_1(val) === kind;
}
var isKind_1 = isKind;
function isKind(val, kind) {
return kindOf_1(val) === kind;
}
var isKind_1 = isKind;
/**
*/
*/
var isArray = Array.isArray || function (val) {
return isKind_1(val, 'Array');
};
var isArray_1 = isArray;
var isArray = Array.isArray || function (val) {
return isKind_1(val, 'Array');
};
var isArray_1 = isArray;
function containsMatch(array, pattern) {
var i = -1,
length = array.length;
var i = -1, length = array.length;
while (++i < length) {
if (deepMatches(array[i], pattern)) {
return true;
}
}
while (++i < length) {
if (deepMatches(array[i], pattern)) {
return true;
return false;
}
}
return false;
}
function matchArray(target, pattern) {
var i = -1, patternLength = pattern.length;
while (++i < patternLength) {
if (!containsMatch(target, pattern[i])) {
return false;
}
}
function matchArray(target, pattern) {
var i = -1,
patternLength = pattern.length;
while (++i < patternLength) {
if (!containsMatch(target, pattern[i])) {
return false;
return true;
}
}
return true;
}
function matchObject(target, pattern) {
var result = true;
forOwn_1(pattern, function(val, key) {
if (!deepMatches(target[key], val)) {
// Return false to break out of forOwn early
return (result = false);
}
});
function matchObject(target, pattern) {
var result = true;
forOwn_1(pattern, function (val, key) {
if (!deepMatches(target[key], val)) {
// Return false to break out of forOwn early
return result = false;
return result;
}
});
return result;
}
/**
* Recursively check if the objects match.
*/
function deepMatches(target, pattern) {
if (target && typeof target === 'object' && pattern && typeof pattern === 'object') {
if (isArray_1(target) && isArray_1(pattern)) {
return matchArray(target, pattern);
} else {
return matchObject(target, pattern);
/**
* Recursively check if the objects match.
*/
function deepMatches(target, pattern){
if (target && typeof target === 'object' &&
pattern && typeof pattern === 'object') {
if (isArray_1(target) && isArray_1(pattern)) {
return matchArray(target, pattern);
} else {
return matchObject(target, pattern);
}
} else {
return target === pattern;
}
}
} else {
return target === pattern;
}
}
var deepMatches_1 = deepMatches;
var deepMatches_1 = deepMatches;
/**
* Converts argument into a valid iterator.
* Used internally on most array/object/collection methods that receives a
* callback/iterator providing a shortcut syntax.
*/
* Converts argument into a valid iterator.
* Used internally on most array/object/collection methods that receives a
* callback/iterator providing a shortcut syntax.
*/
function makeIterator(src, thisObj){
if (src == null) {
return identity_1;
}
switch(typeof src) {
case 'function':
// function is the first to improve perf (most common case)
// also avoid using `Function#call` if not needed, which boosts
// perf a lot in some cases
return (typeof thisObj !== 'undefined')? function(val, i, arr){
return src.call(thisObj, val, i, arr);
} : src;
case 'object':
return function(val){
return deepMatches_1(val, src);
};
case 'string':
case 'number':
return prop_1(src);
}
}
var makeIterator_ = makeIterator;
function makeIterator(src, thisObj) {
if (src == null) {
return identity_1;
}
switch (typeof src) {
case 'function':
// function is the first to improve perf (most common case)
// also avoid using `Function#call` if not needed, which boosts
// perf a lot in some cases
return typeof thisObj !== 'undefined' ? function (val, i, arr) {
return src.call(thisObj, val, i, arr);
} : src;
case 'object':
return function (val) {
return deepMatches_1(val, src);
};
case 'string':
case 'number':
return prop_1(src);
}
}
var makeIterator_ = makeIterator;
/**
* Array filter
*/
* Array filter
*/
function filter(arr, callback, thisObj) {
callback = makeIterator_(callback, thisObj);
var results = [];
if (arr == null) {
return results;
}
var i = -1, len = arr.length, value;
while (++i < len) {
value = arr[i];
if (callback(value, i, arr)) {
results.push(value);
}
}
function filter(arr, callback, thisObj) {
callback = makeIterator_(callback, thisObj);
var results = [];
if (arr == null) {
return results;
}
var i = -1,
len = arr.length,
value;
while (++i < len) {
value = arr[i];
if (callback(value, i, arr)) {
results.push(value);
return results;
}
}
return results;
}
var filter_1 = filter;
var filter_1 = filter;
/**
* @return {array} Array of unique items
*/
* @return {array} Array of unique items
*/
function unique(arr, compare){
compare = compare || isEqual;
return filter_1(arr, function(item, i, arr){
var n = arr.length;
while (++i < n) {
if ( compare(item, arr[i]) ) {
return false;
}
}
return true;
});
}
function unique(arr, compare) {
compare = compare || isEqual;
return filter_1(arr, function (item, i, arr) {
var n = arr.length;
while (++i < n) {
if (compare(item, arr[i])) {
return false;
}
function isEqual(a, b){
return a === b;
}
return true;
});
}
var unique_1 = unique;
function isEqual(a, b) {
return a === b;
}
var unique_1 = unique;
/**
* Array every
*/
* Array every
*/
function every(arr, callback, thisObj) {
callback = makeIterator_(callback, thisObj);
var result = true;
if (arr == null) {
return result;
}
var i = -1, len = arr.length;
while (++i < len) {
// we iterate over sparse items since there is no way to make it
// work properly on IE 7-8. see #64
if (!callback(arr[i], i, arr) ) {
result = false;
break;
}
}
function every(arr, callback, thisObj) {
callback = makeIterator_(callback, thisObj);
var result = true;
if (arr == null) {
return result;
}
var i = -1,
len = arr.length;
while (++i < len) {
// we iterate over sparse items since there is no way to make it
// work properly on IE 7-8. see #64
if (!callback(arr[i], i, arr)) {
result = false;
break;
return result;
}
}
return result;
}
var every_1 = every;
var every_1 = every;
/**
* Array.indexOf
*/
function indexOf(arr, item, fromIndex) {
fromIndex = fromIndex || 0;
* Array.indexOf
*/
function indexOf(arr, item, fromIndex) {
fromIndex = fromIndex || 0;
if (arr == null) {
return -1;
}
if (arr == null) {
return -1;
}
var len = arr.length,
i = fromIndex < 0 ? len + fromIndex : fromIndex;
while (i < len) {
// we iterate over sparse items since there is no way to make it
// work properly on IE 7-8. see #64
if (arr[i] === item) {
return i;
}
var len = arr.length,
i = fromIndex < 0 ? len + fromIndex : fromIndex;
i++;
}
while (i < len) {
// we iterate over sparse items since there is no way to make it
// work properly on IE 7-8. see #64
if (arr[i] === item) {
return i;
return -1;
}
i++;
}
var indexOf_1 = indexOf;
return -1;
}
var indexOf_1 = indexOf;
/**
* If array contains values.
*/
* If array contains values.
*/
function contains(arr, val) {
return indexOf_1(arr, val) !== -1;
}
var contains_1 = contains;
function contains(arr, val) {
return indexOf_1(arr, val) !== -1;
}
var contains_1 = contains;
/**
* Create slice of source array or array-like object
*/
function slice(arr, start, end) {
var len = arr.length;
* Create slice of source array or array-like object
*/
function slice(arr, start, end){
var len = arr.length;
if (start == null) {
start = 0;
} else if (start < 0) {
start = Math.max(len + start, 0);
} else {
start = Math.min(start, len);
}
if (start == null) {
start = 0;
} else if (start < 0) {
start = Math.max(len + start, 0);
} else {
start = Math.min(start, len);
}
if (end == null) {
end = len;
} else if (end < 0) {
end = Math.max(len + end, 0);
} else {
end = Math.min(end, len);
}
if (end == null) {
end = len;
} else if (end < 0) {
end = Math.max(len + end, 0);
} else {
end = Math.min(end, len);
}
var result = [];
var result = [];
while (start < end) {
result.push(arr[start++]);
}
while (start < end) {
result.push(arr[start++]);
}
return result;
}
return result;
}
var slice_1 = slice;
var slice_1 = slice;
/**
* Return a new Array with elements common to all Arrays.
* - based on underscore.js implementation
*/
* Return a new Array with elements common to all Arrays.
* - based on underscore.js implementation
*/
function intersection(arr) {
var arrs = slice_1(arguments, 1),
result = filter_1(unique_1(arr), function(needle){
return every_1(arrs, function(haystack){
return contains_1(haystack, needle);
});
});
return result;
}
var intersection_1 = intersection;
function intersection(arr) {
var arrs = slice_1(arguments, 1),
result = filter_1(unique_1(arr), function (needle) {
return every_1(arrs, function (haystack) {
return contains_1(haystack, needle);
});
});
return result;
}
var intersection_1 = intersection;
/**
* Array some
*/
* Array some
*/
function some(arr, callback, thisObj) {
callback = makeIterator_(callback, thisObj);
var result = false;
if (arr == null) {
return result;
}
var i = -1, len = arr.length;
while (++i < len) {
// we iterate over sparse items since there is no way to make it
// work properly on IE 7-8. see #64
if ( callback(arr[i], i, arr) ) {
result = true;
break;
}
}
function some(arr, callback, thisObj) {
callback = makeIterator_(callback, thisObj);
var result = false;
if (arr == null) {
return result;
}
var i = -1,
len = arr.length;
while (++i < len) {
// we iterate over sparse items since there is no way to make it
// work properly on IE 7-8. see #64
if (callback(arr[i], i, arr)) {
result = true;
break;
return result;
}
}
return result;
}
var some_1 = some;
var some_1 = some;
/**
* Return a new Array with elements that aren't present in the other Arrays.
*/
* Return a new Array with elements that aren't present in the other Arrays.
*/
function difference(arr) {
var arrs = slice_1(arguments, 1),
result = filter_1(unique_1(arr), function(needle){
return !some_1(arrs, function(haystack){
return contains_1(haystack, needle);
});
});
return result;
}
var difference_1 = difference;
function difference(arr) {
var arrs = slice_1(arguments, 1),
result = filter_1(unique_1(arr), function (needle) {
return !some_1(arrs, function (haystack) {
return contains_1(haystack, needle);
});
});
return result;
}
var difference_1 = difference;
function _objectValues(obj) {

@@ -603,1 +567,2 @@ var values = [];

module.exports = MediaQueryContext;
//# sourceMappingURL=index.cjs.js.map

@@ -28,450 +28,414 @@ import { Context } from '@advertol/core';

/**
* Returns the first argument provided to it.
*/
function identity(val) {
return val;
}
* Returns the first argument provided to it.
*/
function identity(val){
return val;
}
var identity_1 = identity;
var identity_1 = identity;
/**
* Returns a function that gets a property of the passed object
*/
function prop(name) {
return function (obj) {
return obj[name];
};
}
* Returns a function that gets a property of the passed object
*/
function prop(name){
return function(obj){
return obj[name];
};
}
var prop_1 = prop;
var prop_1 = prop;
/**
* Safer Object.hasOwnProperty
*/
function hasOwn(obj, prop) {
return Object.prototype.hasOwnProperty.call(obj, prop);
}
* Safer Object.hasOwnProperty
*/
function hasOwn(obj, prop){
return Object.prototype.hasOwnProperty.call(obj, prop);
}
var hasOwn_1 = hasOwn;
var hasOwn_1 = hasOwn;
var _hasDontEnumBug, _dontEnums;
var _hasDontEnumBug,
_dontEnums;
function checkDontEnum() {
_dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'];
_hasDontEnumBug = true;
function checkDontEnum(){
_dontEnums = [
'toString',
'toLocaleString',
'valueOf',
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',
'constructor'
];
for (var key in {
'toString': null
}) {
_hasDontEnumBug = false;
}
}
/**
* Similar to Array/forEach but works over object properties and fixes Don't
* Enum bug on IE.
* based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
*/
_hasDontEnumBug = true;
for (var key in {'toString': null}) {
_hasDontEnumBug = false;
}
}
function forIn(obj, fn, thisObj) {
var key,
i = 0; // no need to check if argument is a real object that way we can use
// it for arrays, functions, date, etc.
//post-pone check till needed
/**
* Similar to Array/forEach but works over object properties and fixes Don't
* Enum bug on IE.
* based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
*/
function forIn(obj, fn, thisObj){
var key, i = 0;
// no need to check if argument is a real object that way we can use
// it for arrays, functions, date, etc.
if (_hasDontEnumBug == null) checkDontEnum();
//post-pone check till needed
if (_hasDontEnumBug == null) checkDontEnum();
for (key in obj) {
if (exec(fn, obj, key, thisObj) === false) {
break;
}
}
for (key in obj) {
if (exec(fn, obj, key, thisObj) === false) {
break;
}
}
if (_hasDontEnumBug) {
var ctor = obj.constructor,
isProto = !!ctor && obj === ctor.prototype;
while (key = _dontEnums[i++]) {
// For constructor, if it is a prototype object the constructor
// is always non-enumerable unless defined otherwise (and
// enumerated above). For non-prototype objects, it will have
// to be defined on this object, since it cannot be defined on
// any prototype objects.
//
// For other [[DontEnum]] properties, check if the value is
// different than Object prototype value.
if ((key !== 'constructor' || !isProto && hasOwn_1(obj, key)) && obj[key] !== Object.prototype[key]) {
if (exec(fn, obj, key, thisObj) === false) {
break;
if (_hasDontEnumBug) {
var ctor = obj.constructor,
isProto = !!ctor && obj === ctor.prototype;
while (key = _dontEnums[i++]) {
// For constructor, if it is a prototype object the constructor
// is always non-enumerable unless defined otherwise (and
// enumerated above). For non-prototype objects, it will have
// to be defined on this object, since it cannot be defined on
// any prototype objects.
//
// For other [[DontEnum]] properties, check if the value is
// different than Object prototype value.
if (
(key !== 'constructor' ||
(!isProto && hasOwn_1(obj, key))) &&
obj[key] !== Object.prototype[key]
) {
if (exec(fn, obj, key, thisObj) === false) {
break;
}
}
}
}
}
}
}
}
function exec(fn, obj, key, thisObj) {
return fn.call(thisObj, obj[key], key, obj);
}
function exec(fn, obj, key, thisObj){
return fn.call(thisObj, obj[key], key, obj);
}
var forIn_1 = forIn;
var forIn_1 = forIn;
/**
* Similar to Array/forEach but works over object properties and fixes Don't
* Enum bug on IE.
* based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
*/
function forOwn(obj, fn, thisObj) {
forIn_1(obj, function (val, key) {
if (hasOwn_1(obj, key)) {
return fn.call(thisObj, obj[key], key, obj);
* Similar to Array/forEach but works over object properties and fixes Don't
* Enum bug on IE.
* based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
*/
function forOwn(obj, fn, thisObj){
forIn_1(obj, function(val, key){
if (hasOwn_1(obj, key)) {
return fn.call(thisObj, obj[key], key, obj);
}
});
}
});
}
var forOwn_1 = forOwn;
var forOwn_1 = forOwn;
/**
* Gets the "kind" of value. (e.g. "String", "Number", etc)
*/
function kindOf(val) {
return Object.prototype.toString.call(val).slice(8, -1);
}
* Gets the "kind" of value. (e.g. "String", "Number", etc)
*/
function kindOf(val) {
return Object.prototype.toString.call(val).slice(8, -1);
}
var kindOf_1 = kindOf;
var kindOf_1 = kindOf;
/**
* Check if value is from a specific "kind".
*/
* Check if value is from a specific "kind".
*/
function isKind(val, kind){
return kindOf_1(val) === kind;
}
var isKind_1 = isKind;
function isKind(val, kind) {
return kindOf_1(val) === kind;
}
var isKind_1 = isKind;
/**
*/
*/
var isArray = Array.isArray || function (val) {
return isKind_1(val, 'Array');
};
var isArray_1 = isArray;
var isArray = Array.isArray || function (val) {
return isKind_1(val, 'Array');
};
var isArray_1 = isArray;
function containsMatch(array, pattern) {
var i = -1,
length = array.length;
var i = -1, length = array.length;
while (++i < length) {
if (deepMatches(array[i], pattern)) {
return true;
}
}
while (++i < length) {
if (deepMatches(array[i], pattern)) {
return true;
return false;
}
}
return false;
}
function matchArray(target, pattern) {
var i = -1, patternLength = pattern.length;
while (++i < patternLength) {
if (!containsMatch(target, pattern[i])) {
return false;
}
}
function matchArray(target, pattern) {
var i = -1,
patternLength = pattern.length;
while (++i < patternLength) {
if (!containsMatch(target, pattern[i])) {
return false;
return true;
}
}
return true;
}
function matchObject(target, pattern) {
var result = true;
forOwn_1(pattern, function(val, key) {
if (!deepMatches(target[key], val)) {
// Return false to break out of forOwn early
return (result = false);
}
});
function matchObject(target, pattern) {
var result = true;
forOwn_1(pattern, function (val, key) {
if (!deepMatches(target[key], val)) {
// Return false to break out of forOwn early
return result = false;
return result;
}
});
return result;
}
/**
* Recursively check if the objects match.
*/
function deepMatches(target, pattern) {
if (target && typeof target === 'object' && pattern && typeof pattern === 'object') {
if (isArray_1(target) && isArray_1(pattern)) {
return matchArray(target, pattern);
} else {
return matchObject(target, pattern);
/**
* Recursively check if the objects match.
*/
function deepMatches(target, pattern){
if (target && typeof target === 'object' &&
pattern && typeof pattern === 'object') {
if (isArray_1(target) && isArray_1(pattern)) {
return matchArray(target, pattern);
} else {
return matchObject(target, pattern);
}
} else {
return target === pattern;
}
}
} else {
return target === pattern;
}
}
var deepMatches_1 = deepMatches;
var deepMatches_1 = deepMatches;
/**
* Converts argument into a valid iterator.
* Used internally on most array/object/collection methods that receives a
* callback/iterator providing a shortcut syntax.
*/
* Converts argument into a valid iterator.
* Used internally on most array/object/collection methods that receives a
* callback/iterator providing a shortcut syntax.
*/
function makeIterator(src, thisObj){
if (src == null) {
return identity_1;
}
switch(typeof src) {
case 'function':
// function is the first to improve perf (most common case)
// also avoid using `Function#call` if not needed, which boosts
// perf a lot in some cases
return (typeof thisObj !== 'undefined')? function(val, i, arr){
return src.call(thisObj, val, i, arr);
} : src;
case 'object':
return function(val){
return deepMatches_1(val, src);
};
case 'string':
case 'number':
return prop_1(src);
}
}
var makeIterator_ = makeIterator;
function makeIterator(src, thisObj) {
if (src == null) {
return identity_1;
}
switch (typeof src) {
case 'function':
// function is the first to improve perf (most common case)
// also avoid using `Function#call` if not needed, which boosts
// perf a lot in some cases
return typeof thisObj !== 'undefined' ? function (val, i, arr) {
return src.call(thisObj, val, i, arr);
} : src;
case 'object':
return function (val) {
return deepMatches_1(val, src);
};
case 'string':
case 'number':
return prop_1(src);
}
}
var makeIterator_ = makeIterator;
/**
* Array filter
*/
* Array filter
*/
function filter(arr, callback, thisObj) {
callback = makeIterator_(callback, thisObj);
var results = [];
if (arr == null) {
return results;
}
var i = -1, len = arr.length, value;
while (++i < len) {
value = arr[i];
if (callback(value, i, arr)) {
results.push(value);
}
}
function filter(arr, callback, thisObj) {
callback = makeIterator_(callback, thisObj);
var results = [];
if (arr == null) {
return results;
}
var i = -1,
len = arr.length,
value;
while (++i < len) {
value = arr[i];
if (callback(value, i, arr)) {
results.push(value);
return results;
}
}
return results;
}
var filter_1 = filter;
var filter_1 = filter;
/**
* @return {array} Array of unique items
*/
* @return {array} Array of unique items
*/
function unique(arr, compare){
compare = compare || isEqual;
return filter_1(arr, function(item, i, arr){
var n = arr.length;
while (++i < n) {
if ( compare(item, arr[i]) ) {
return false;
}
}
return true;
});
}
function unique(arr, compare) {
compare = compare || isEqual;
return filter_1(arr, function (item, i, arr) {
var n = arr.length;
while (++i < n) {
if (compare(item, arr[i])) {
return false;
}
function isEqual(a, b){
return a === b;
}
return true;
});
}
var unique_1 = unique;
function isEqual(a, b) {
return a === b;
}
var unique_1 = unique;
/**
* Array every
*/
* Array every
*/
function every(arr, callback, thisObj) {
callback = makeIterator_(callback, thisObj);
var result = true;
if (arr == null) {
return result;
}
var i = -1, len = arr.length;
while (++i < len) {
// we iterate over sparse items since there is no way to make it
// work properly on IE 7-8. see #64
if (!callback(arr[i], i, arr) ) {
result = false;
break;
}
}
function every(arr, callback, thisObj) {
callback = makeIterator_(callback, thisObj);
var result = true;
if (arr == null) {
return result;
}
var i = -1,
len = arr.length;
while (++i < len) {
// we iterate over sparse items since there is no way to make it
// work properly on IE 7-8. see #64
if (!callback(arr[i], i, arr)) {
result = false;
break;
return result;
}
}
return result;
}
var every_1 = every;
var every_1 = every;
/**
* Array.indexOf
*/
function indexOf(arr, item, fromIndex) {
fromIndex = fromIndex || 0;
* Array.indexOf
*/
function indexOf(arr, item, fromIndex) {
fromIndex = fromIndex || 0;
if (arr == null) {
return -1;
}
if (arr == null) {
return -1;
}
var len = arr.length,
i = fromIndex < 0 ? len + fromIndex : fromIndex;
while (i < len) {
// we iterate over sparse items since there is no way to make it
// work properly on IE 7-8. see #64
if (arr[i] === item) {
return i;
}
var len = arr.length,
i = fromIndex < 0 ? len + fromIndex : fromIndex;
i++;
}
while (i < len) {
// we iterate over sparse items since there is no way to make it
// work properly on IE 7-8. see #64
if (arr[i] === item) {
return i;
return -1;
}
i++;
}
var indexOf_1 = indexOf;
return -1;
}
var indexOf_1 = indexOf;
/**
* If array contains values.
*/
* If array contains values.
*/
function contains(arr, val) {
return indexOf_1(arr, val) !== -1;
}
var contains_1 = contains;
function contains(arr, val) {
return indexOf_1(arr, val) !== -1;
}
var contains_1 = contains;
/**
* Create slice of source array or array-like object
*/
function slice(arr, start, end) {
var len = arr.length;
* Create slice of source array or array-like object
*/
function slice(arr, start, end){
var len = arr.length;
if (start == null) {
start = 0;
} else if (start < 0) {
start = Math.max(len + start, 0);
} else {
start = Math.min(start, len);
}
if (start == null) {
start = 0;
} else if (start < 0) {
start = Math.max(len + start, 0);
} else {
start = Math.min(start, len);
}
if (end == null) {
end = len;
} else if (end < 0) {
end = Math.max(len + end, 0);
} else {
end = Math.min(end, len);
}
if (end == null) {
end = len;
} else if (end < 0) {
end = Math.max(len + end, 0);
} else {
end = Math.min(end, len);
}
var result = [];
var result = [];
while (start < end) {
result.push(arr[start++]);
}
while (start < end) {
result.push(arr[start++]);
}
return result;
}
return result;
}
var slice_1 = slice;
var slice_1 = slice;
/**
* Return a new Array with elements common to all Arrays.
* - based on underscore.js implementation
*/
* Return a new Array with elements common to all Arrays.
* - based on underscore.js implementation
*/
function intersection(arr) {
var arrs = slice_1(arguments, 1),
result = filter_1(unique_1(arr), function(needle){
return every_1(arrs, function(haystack){
return contains_1(haystack, needle);
});
});
return result;
}
var intersection_1 = intersection;
function intersection(arr) {
var arrs = slice_1(arguments, 1),
result = filter_1(unique_1(arr), function (needle) {
return every_1(arrs, function (haystack) {
return contains_1(haystack, needle);
});
});
return result;
}
var intersection_1 = intersection;
/**
* Array some
*/
* Array some
*/
function some(arr, callback, thisObj) {
callback = makeIterator_(callback, thisObj);
var result = false;
if (arr == null) {
return result;
}
var i = -1, len = arr.length;
while (++i < len) {
// we iterate over sparse items since there is no way to make it
// work properly on IE 7-8. see #64
if ( callback(arr[i], i, arr) ) {
result = true;
break;
}
}
function some(arr, callback, thisObj) {
callback = makeIterator_(callback, thisObj);
var result = false;
if (arr == null) {
return result;
}
var i = -1,
len = arr.length;
while (++i < len) {
// we iterate over sparse items since there is no way to make it
// work properly on IE 7-8. see #64
if (callback(arr[i], i, arr)) {
result = true;
break;
return result;
}
}
return result;
}
var some_1 = some;
var some_1 = some;
/**
* Return a new Array with elements that aren't present in the other Arrays.
*/
* Return a new Array with elements that aren't present in the other Arrays.
*/
function difference(arr) {
var arrs = slice_1(arguments, 1),
result = filter_1(unique_1(arr), function(needle){
return !some_1(arrs, function(haystack){
return contains_1(haystack, needle);
});
});
return result;
}
var difference_1 = difference;
function difference(arr) {
var arrs = slice_1(arguments, 1),
result = filter_1(unique_1(arr), function (needle) {
return !some_1(arrs, function (haystack) {
return contains_1(haystack, needle);
});
});
return result;
}
var difference_1 = difference;
function _objectValues(obj) {

@@ -601,1 +565,2 @@ var values = [];

export default MediaQueryContext;
//# sourceMappingURL=index.esm.js.map
{
"name": "@advertol/context-media-query",
"version": "1.0.0-alpha.0",
"version": "1.0.0",
"description": "Control zone visibility with CSS media query listeners.",

@@ -10,4 +10,5 @@ "main": "index.cjs.js",

"files": [
"index.cjs.js",
"index.esm.js",
"index.cjs.{js,js.map}",
"index.esm.{js,js.map}",
"CHANGELOG.md",
"LICENSE.md",

@@ -23,2 +24,3 @@ "README.md"

"lint": "eslint '{index,lib/**/*,test/**/*}.js'",
"postpublish": "GITHUB_TOKEN=$GITHUB_RELEASE_TOKEN github-release-from-changelog",
"prepublishOnly": "npm run build",

@@ -28,6 +30,7 @@ "release": "np",

"test:automated": "BABEL_ENV=test karma start",
"test:automated:watch": "npm run test:automated -- --auto-watch --no-single-run"
"test:automated:watch": "npm run test:automated -- --auto-watch --no-single-run",
"version": "version-changelog CHANGELOG.md && changelog-verify CHANGELOG.md && git add CHANGELOG.md"
},
"dependencies": {
"@advertol/core": "^1.0.0-alpha.0",
"@advertol/core": "^1.0.0",
"mout": "^1.1.0"

@@ -44,2 +47,4 @@ },

"babel-preset-niksy": "^4.1.0",
"changelog-verify": "^1.1.2",
"core-js": "^2.6.5",
"eslint": "^5.4.0",

@@ -54,6 +59,7 @@ "eslint-config-niksy": "^6.1.0",

"esm": "^3.0.51",
"github-release-from-changelog": "^1.3.2",
"istanbul-instrumenter-loader": "^3.0.1",
"karma": "^1.1.0",
"karma": "^4.0.1",
"karma-browserstack-launcher": "^1.0.0",
"karma-chrome-launcher": "^1.0.1",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage-istanbul-reporter": "^2.0.1",

@@ -74,2 +80,3 @@ "karma-fixture": "^0.2.6",

"rollup-plugin-node-resolve": "^4.0.1",
"version-changelog": "^3.1.1",
"webpack": "^4.12.0"

@@ -94,9 +101,8 @@ },

"type": "git",
"url": "git+https://github.com/niksy/advertol.git"
"url": "git+https://github.com/niksy/advertol-context-media-query.git"
},
"bugs": {
"url": "https://github.com/niksy/advertol/issues"
"url": "https://github.com/niksy/advertol-context-media-query/issues"
},
"homepage": "https://github.com/niksy/advertol#readme",
"gitHead": "e83640d93effb6e4c14d54bb504351e9d98097db"
"homepage": "https://github.com/niksy/advertol-context-media-query#readme"
}

@@ -63,6 +63,6 @@ # @advertol/context-media-query

[ci]: https://travis-ci.com/niksy/context-media-query
[ci-img]: https://travis-ci.com/niksy/context-media-query.svg?branch=master
[ci]: https://travis-ci.com/niksy/advertol-context-media-query
[ci-img]: https://travis-ci.com/niksy/advertol-context-media-query.svg?branch=master
[browserstack]: https://www.browserstack.com/
[browserstack-img]: https://www.browserstack.com/automate/badge.svg?badge_key=ZXVsVDVhem9zZmNjQWVKV2ZvZUtiK1RCZlA2ajg2dDZmOTVIV0tZck5Xdz0tLTRQVkRYcVVPWU8xK0lJR3o3Z1gzUEE9PQ==--24a91b3152c00c01a8af853126eaf873886db782
[browserstack-img]: https://www.browserstack.com/automate/badge.svg?badge_key=Uk5ZSnhVM2NrTm1SUmQxQkxiaDRNWW1Ha0hGZTY0TGRWRjNZYmgxaTFpOD0tLVRTV0tLdDcyV2UxdG5oZHJDWWo1aEE9PQ==--ebc313555d15850b799a231e058c3050ea288cd4
[media-queries]: https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries
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