Comparing version 2.1.0 to 2.1.1
@@ -1,45 +0,13 @@ | ||
import gOPD from 'object-get-own-property-descriptor-x'; | ||
import attempt from 'attempt-x'; | ||
import isObjectLike from 'is-object-like-x'; | ||
import isLength from 'is-length-x'; | ||
import call from 'simple-call-x'; | ||
import getGetter from 'util-get-getter-x'; | ||
var test1 = function test1() { | ||
return attempt(function createSet() { | ||
/* eslint-disable-next-line compat/compat */ | ||
return new Set(); | ||
}); | ||
var creator = function creator() { | ||
/* eslint-disable-next-line compat/compat */ | ||
return new Set(); | ||
}; | ||
var getFromDescriptor = function getFromDescriptor(descriptor) { | ||
var resTest1 = test1(); | ||
if (resTest1.threw === false && isObjectLike(resTest1.value)) { | ||
var res = attempt.call(resTest1.value, descriptor.get); | ||
if (res.threw === false && isLength(res.value)) { | ||
return descriptor.get; | ||
} | ||
} | ||
return null; | ||
}; | ||
var getGetter = function getGetter() { | ||
if (typeof Set === 'function') { | ||
/* eslint-disable-next-line compat/compat */ | ||
var descriptor = gOPD(Set.prototype, 'size'); | ||
if (descriptor && typeof descriptor.get === 'function') { | ||
var getter = getFromDescriptor(descriptor); | ||
if (getter !== null) { | ||
return getter; | ||
} | ||
} | ||
} | ||
return null; | ||
}; | ||
var getSize = getGetter(); | ||
var getSize = getGetter(creator, 'size', isLength); | ||
/** | ||
@@ -58,3 +26,5 @@ * Determine if an `object` is a `Set`. | ||
var result = attempt.call(object, getSize); | ||
var result = attempt(function attemptee() { | ||
return call(getSize, object); | ||
}); | ||
return result.threw === false && isLength(result.value); | ||
@@ -61,0 +31,0 @@ }; |
@@ -5,18 +5,12 @@ /*! | ||
"copywrite": "Copyright (c) 2015-2017", | ||
"date": "2019-08-14T15:48:42.551Z", | ||
"date": "2019-08-20T20:13:06.564Z", | ||
"describe": "", | ||
"description": "Detect whether or not an object is an ES6 SET.", | ||
"file": "is-set-x.min.js", | ||
"hash": "e0792154643f2ef7780f", | ||
"hash": "47fab87ecdea841cea37", | ||
"license": "MIT", | ||
"version": "2.1.0" | ||
"version": "2.1.1" | ||
} | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.isSetX=t():e.isSetX=t()}(function(){"use strict";var e,t={}.constructor,r=t.prototype,n=t.defineProperty,o=function(){return"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0},i=function(){return this};try{return n?n(r,"$$globalThis$$",{get:i,configurable:!0}):r.__defineGetter__("$$globalThis$$",i),e="undefined"==typeof $$globalThis$$?o():$$globalThis$$,delete r.$$globalThis$$,e}catch(e){return o()}}(),function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=7)}([function(e,t,r){"use strict";var n=Object.prototype.toString;if(r(4)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;e.exports=function(e){if("symbol"==typeof e)return!0;if("[object Symbol]"!==n.call(e))return!1;try{return function(e){return"symbol"==typeof e.valueOf()&&i.test(o.call(e))}(e)}catch(e){return!1}}}else e.exports=function(e){return!1}},function(e,t,r){"use strict"; | ||
/*! | ||
* is-primitive <https://github.com/jonschlinkert/is-primitive> | ||
* | ||
* Copyright (c) 2014-present, Jon Schlinkert. | ||
* Released under the MIT License. | ||
*/e.exports=function(e){return"object"==typeof e?null===e:"function"!=typeof e}},function(e,t,r){"use strict";var n=Date.prototype.getDay,o=Object.prototype.toString,i="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(e){return"object"==typeof e&&null!==e&&(i?function(e){try{return n.call(e),!0}catch(e){return!1}}(e):"[object Date]"===o.call(e))}},function(e,t,r){"use strict";var n=String.prototype.valueOf,o=Object.prototype.toString,i="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(e){return"string"==typeof e||"object"==typeof e&&(i?function(e){try{return n.call(e),!0}catch(e){return!1}}(e):"[object String]"===o.call(e))}},function(e,t,r){"use strict";(function(t){var n=t.Symbol,o=r(6);e.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&o())))}}).call(this,r(5))},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},function(e,t,r){"use strict";r.r(t);var n=function(e){return null==e},o=function(e){if(n(e))throw new TypeError("Cannot call method on ".concat(e));return e},i={}.constructor,u=function(e){return i(o(e))},c=function(e){try{for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return{threw:!1,value:e.apply(this,r)}}catch(e){return{threw:!0,value:e}}},s=r(0),f=r.n(s);for(var a=c(function(){return function(e,t){if(e!==t)throw new TypeError("Cannot instantiate an arrow function")}(this,void 0),"function"==typeof Symbol&&f()(Symbol(""))}.bind(void 0)),l=!1===a.threw&&!0===a.value,p=r(1),y=r.n(p),b=r(2),d=r.n(b),g=function(e){return!!e},v={}.toString,m=function(e){return null===e?"[object Null]":void 0===e?"[object Undefined]":v.call(e)},h=l&&f()(Symbol.toStringTag),S="Cannot convert a Symbol value to a string",w=S.constructor,j=function(e){if(f()(e))throw new TypeError(S);return w(e)},O=function(e){return j(o(e))},_=[{code:9,description:"Tab",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\t"},{code:10,description:"Line Feed",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\n"},{code:11,description:"Vertical Tab",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\v"},{code:12,description:"Form Feed",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\f"},{code:13,description:"Carriage Return",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\r"},{code:32,description:"Space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:160,description:"No-break space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:5760,description:"Ogham space mark",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:6158,description:"Mongolian vowel separator",es5:!0,es2015:!0,es2016:!0,es2017:!1,es2018:!1,string:""},{code:8192,description:"En quad",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8193,description:"Em quad",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8194,description:"En space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8195,description:"Em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8196,description:"Three-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8197,description:"Four-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8198,description:"Six-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8199,description:"Figure space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8200,description:"Punctuation space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8201,description:"Thin space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8202,description:"Hair space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8232,description:"Line separator",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\u2028"},{code:8233,description:"Paragraph separator",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\u2029"},{code:8239,description:"Narrow no-break space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8287,description:"Medium mathematical space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:12288,description:"Ideographic space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:65279,description:"Byte Order Mark",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\ufeff"}],x="",$=_.length,T=0;T<$;T+=1)_[T].es2016&&_[T].string,_[T].es2018&&(x+=_[T].string);var P=x,E=new(0,/none/.constructor)("^[".concat(P,"]+")),M="".replace,N=function(e){return M.call(O(e),E,"")},F=new(0,/none/.constructor)("[".concat(P,"]+$")),k="".replace,C=function(e){return k.call(O(e),F,"")},D=function(e){return N(C(e))},A=new(0,/none/.constructor)("[".concat(P,"]+"),"g"),G=" ".replace,I=function(e){return G.call(D(e),A," ")},X=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,q="".replace,L=function(e,t){return q.call(O(e),X,arguments.length>1?j(t):"")},R=c.constructor,z=c.toString,B=/^class /,H=B.test,U=!1===c(function(){return R('"use strict"; return class My {};')()}).threw,V=function(e){return H.call(B,I(L(z.call(e)," ")))},J=function(e){var t=c(V,e);return!1===t.threw&&t.value},K=function(e,t){return!y()(e)&&(h?function(e,t){return!(U&&!1===t&&J(e)||!1!==c.call(e,z).threw)}(e,g(t)):(!U||!1!==g(t)||!J(e))&&function(e){var t=m(e);return"[object Function]"===t||"[object GeneratorFunction]"===t||"[object AsyncFunction]"===t}(e))},Q="string".constructor,W=(0).constructor,Y=l&&Symbol.toPrimitive,Z=l&&Symbol.prototype.valueOf,ee=["toString","valueOf"],te=["valueOf","toString"],re=function(e,t){o(e),function(e){if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"')}(t);for(var r,n,i="string"===t?ee:te,u=0;u<2;u+=1)if(r=e[i[u]],K(r)&&(n=r.call(e),y()(n)))return n;throw new TypeError("No default value")},ne=function(e,t){if(t){if(e===Q)return"string";if(e===W)return"number"}return"default"},oe=function(e){if(l){if(Y)return function(e,t){var r=e[t];if(!1===n(r)){if(!1===K(r))throw new TypeError("".concat(r," returned for property ").concat(t," of object ").concat(e," is not a function"));return r}}(e,Y);if(f()(e))return Z}},ie=function(e){var t=e.exoticToPrim,r=e.input,n=e.hint,o=t.call(r,n);if(y()(o))return o;throw new TypeError("unable to convert exotic object to primitive")},ue=function(e,t){var r="default"===t&&(d()(e)||f()(e))?"string":t;return re(e,"default"===r?"number":r)},ce=function(e,t){if(y()(e))return e;var r=ne(t,arguments.length>1),n=oe(e);return void 0===n?ue(e,r):ie({exoticToPrim:n,input:e,hint:r})};function se(e){return(se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var fe,ae,le,pe=function(e){var t=ce(e,String);return l&&"symbol"===se(t)?t:j(t)},ye={}.hasOwnProperty,be=function(e,t){return ye.call(u(e),pe(t))},de=r(3),ge=r.n(de),ve=l&&Symbol.prototype.toString,me="function"==typeof ve&&f.a,he="".constructor,Se=function(e){return me&&me(e)?ve.call(e):he(e)},we=parseInt,je=(0).constructor,Oe="".charAt,_e=/^[-+]?0[xX]/,xe=_e.test,$e=function(e,t){var r=N(j(e));return""===Oe.call(r,0)?NaN:we(r,je(t)||(xe.call(_e,r)?16:10))},Te=2..constructor,Pe="Cannot convert a Symbol value to a number".slice,Ee=/^0b[01]+$/i,Me=Ee.test,Ne=/^0o[0-7]+$/i,Fe=new(0,Ee.constructor)("[ ]","g"),ke=/^[-+]0x[0-9a-f]+$/i,Ce=function(e,t){return $e(Pe.call(e,2),t)},De=function(e,t){return function(e){return Me.call(Ee,e)}(t)?e(Ce(t,2)):function(e){return Me.call(Ne,e)}(t)?e(Ce(t,8)):null},Ae=function(e,t){var r=De(e,t);if(null!==r)return r;if(function(e){return Me.call(Fe,e)}(t)||function(e){return Me.call(ke,e)}(t))return NaN;var n=D(t);return n!==t?e(n):null},Ge=function e(t){var r=function(e){if(f()(e))throw new TypeError("Cannot convert a Symbol value to a number");return e}(ce(t,Te));if("string"==typeof r){var n=Ae(e,r);if(null!==n)return n}return Te(r)},Ie=function(e){return e!=e},Xe=function(e){return"number"==typeof e&&!1===Ie(e)&&e!==1/0&&e!==-1/0},qe=function(e){var t=Ge(e);return 0===t||Ie(t)?t:t>0?1:-1},Le=Math.abs,Re=Math.floor,ze=function(e){var t=Ge(e);return Ie(t)?0:0===t||!1===Xe(t)?t:qe(t)*Re(Le(t))},Be=function(e){var t=Ge(e[1]),r=e.length<3?{max:t,min:0}:{max:Ge(e[2]),min:t};if(r.min>r.max)throw new RangeError('"min" must be less than "max"');return r},He=function(e){var t=Ge(e);if(arguments.length<2)return t;var r=Be(arguments),n=r.max,o=r.min;return t<o?o:t>n?n:t},Ue=/^(?:0|[1-9]\d*)$/,Ve=Ue.test,Je=function(e,t){var r=Se(e);if(!1===Ve.call(Ue,r))return!1;var n=Ge(r);return arguments.length>1?n<He(ze(t),9007199254740991):n<9007199254740991},Ke={}.propertyIsEnumerable,Qe=function(e,t){return Ke.call(u(e),pe(t))},We="".charAt,Ye={}.constructor,Ze=Ye.getOwnPropertyDescriptor,et="function"==typeof Ze&&Ze,tt=function(e,t){e[pe(t)]=0;var r=c(et,e,t);return!1===r.threw&&0===r.value.value};if(et){var rt="undefined"!=typeof document&&document;if(!rt||tt(rt.createElement("div"),"sentinel")){var nt=c(et,u("abc"),1);if(!1===nt.threw&&nt.value&&"b"===nt.value.value)if(tt({},"sentinel")){var ot=!1===c(et,42,"name").threw;le=l&&tt({},u(Symbol("")))?ot?et:function(e,t){return et(u(e),t)}:ot?function(e,t){return et(e,pe(t))}:function(e,t){return et(u(e),pe(t))}}else fe=et;else ae=et}}if(!1===g(le)||fe||ae){var it,ut,ct=Ye.prototype,st=be(ct,"__defineGetter__");if(st){var ft=ct.__lookupGetter__,at=ct.__lookupSetter__;it=function(e,t){return ft.call(e,t)},ut=function(e,t){return at.call(e,t)}}le=function(e,t){var r,n=u(e),o=pe(t);if(fe&&!1===(r=c.call(u,fe,n,o)).threw)return r.value;var i=ge()(n)&&Je(o,n.length);if(ae&&!1===i&&!1===(r=c.call(u,ae,n,o)).threw)return r.value;var s=void 0;if(!1===i&&!1===be(n,o))return s;if(s={configurable:!1===y()(e)&&!1===i,enumerable:Qe(n,o)},st){var f=n.__proto__,a=n!==ct;a&&(n.__proto__=ct);var l=it(n,o),p=ut(n,o);if(a&&(n.__proto__=f),l||p)return l&&(s.get=l),p&&(s.set=p),s}return i?(s.value=We.call(n,o),s.writable=!1):(s.value=n[o],s.writable=!0),s}}var lt=le,pt=function(e){return!1===y()(e)&&!1===K(e,!0)},yt=function(e){return Xe(e)&&ze(e)===e},bt=function(e){return yt(e)&&e>=-9007199254740991&&e<=9007199254740991},dt=function(e){return bt(e)&&e>=0},gt=function(e){var t=c(function(){return new Set});if(!1===t.threw&&pt(t.value)){var r=c.call(t.value,e.get);if(!1===r.threw&&dt(r.value))return e.get}return null},vt=function(){if("function"==typeof Set){var e=lt(Set.prototype,"size");if(e&&"function"==typeof e.get){var t=gt(e);if(null!==t)return t}}return null}();t.default=function(e){if(null===vt||!1===pt(e))return!1;var t=c.call(e,vt);return!1===t.threw&&dt(t.value)}}])}); | ||
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.isSetX=n():t.isSetX=n()}(function(){"use strict";var t,n={}.constructor,e=n.prototype,r=n.defineProperty,o=function(){return"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0},i=function(){return this};try{return r?r(e,"$$globalThis$$",{get:i,configurable:!0}):e.__defineGetter__("$$globalThis$$",i),t="undefined"==typeof $$globalThis$$?o():$$globalThis$$,delete e.$$globalThis$$,t}catch(t){return o()}}(),function(){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=6)}([function(t,n,e){"use strict";var r=Object.prototype.toString;if(e(3)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==r.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},function(t,n,e){"use strict";var r=String.prototype.valueOf,o=Object.prototype.toString,i="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(t){return"string"==typeof t||"object"==typeof t&&(i?function(t){try{return r.call(t),!0}catch(t){return!1}}(t):"[object String]"===o.call(t))}},function(t,n,e){"use strict";var r=Date.prototype.getDay,o=Object.prototype.toString,i="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(t){return"object"==typeof t&&null!==t&&(i?function(t){try{return r.call(t),!0}catch(t){return!1}}(t):"[object Date]"===o.call(t))}},function(t,n,e){"use strict";(function(n){var r=n.Symbol,o=e(5);t.exports=function(){return"function"==typeof r&&("function"==typeof Symbol&&("symbol"==typeof r("foo")&&("symbol"==typeof Symbol("bar")&&o())))}}).call(this,e(4))},function(t,n){var e;e=function(){return this}();try{e=e||new Function("return this")()}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t,n,e){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},n=Symbol("test"),e=Object(n);if("string"==typeof n)return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;for(n in t[n]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var r=Object.getOwnPropertySymbols(t);if(1!==r.length||r[0]!==n)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,n))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,n);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},function(t,n,e){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}e.r(n);var o=function(t){return"object"===r(t)?null===t:"function"!=typeof t},i=e(1),u=e.n(i),c={}.constructor("a"),s="a"===c[0]&&0 in c,f=function(){}.bind,a="function"==typeof f&&function(){var t=null,n=null,e=null,r=[];try{var o=f.apply(function(r,o){return e=this,t=r,n=o,arguments},[r,1]),i=o(2);return 1===o.length&&2===i.length&&1===t&&2===n&&e===r}catch(t){return!1}}()&&function(){var t=null,n=null,e=null,r=[1,2,3],o=function(o,i){return t=o,n=i,e=this,r};try{var i=f.apply(o,[null]),u=new i(1,2);return i.length===o.length&&u===r&&1===t&&2===n&&e!==r}catch(t){return!1}}(),l="".split,p=Math.max,y=o.bind,b=o.call,d=a?y.call(b,l):function(t,n){return l.call(t,n)},g=function(t){return u()(t)?d(t,""):t},v=function(t,n){var e=arguments.length>2?arguments[2]:[];if("string"!=typeof t&&o(t))return e;for(var r=s?t:g(t),i=r.length,u=p(0,n)||0;u<i;u+=1)e[e.length]=t[u];return e};function m(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=[],r=!0,o=!1,i=void 0;try{for(var u,c=t[Symbol.iterator]();!(r=(u=c.next()).done)&&(e.push(u.value),!n||e.length!==n);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return e}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var h=v.bind,w=v.call,S={},j=S.constructor,O=S.toString,_=function(t,n){return t>=n?t:n},x=function(t){if("function"!=typeof t&&"[object Function]"!==O.apply(t))throw new TypeError("bind called on incompatible "+t)},T=[function(t){return function(){return t.apply(this,v(arguments))}},function(t,n){return function(e){return t.apply(this,v(arguments,n,[e]))}},function(t,n){return function(e,r){return t.apply(this,v(arguments,n,[e,r]))}},function(t,n){return function(e,r,o){return t.apply(this,v(arguments,n,[e,r,o]))}},function(t,n){return function(e,r,o,i){return t.apply(this,v(arguments,n,[e,r,o,i]))}},function(t,n){return function(e,r,o,i,u){return t.apply(this,v(arguments,n,[e,r,o,i,u]))}},function(t,n){return function(e,r,o,i,u,c){return t.apply(this,v(arguments,n,[e,r,o,i,u,c]))}},function(t,n){return function(e,r,o,i,u,c,s){return t.apply(this,v(arguments,n,[e,r,o,i,u,c,s]))}},function(t,n){return function(e,r,o,i,u,c,s,f){return t.apply(this,v(arguments,n,[e,r,o,i,u,c,s,f]))}}],$=function(t){var n=m(t,3),e=n[0],r=n[1],o=n[2],i=_(0,r.length-_(0,o.length-2)),u=T[i],c=u?u(e,i):T[0](e);if(r.prototype){var s=function(){};s.prototype=r.prototype,c.prototype=new s,s.prototype=null}return c},E=function(t,n){var e=t.apply(this,n);return j(e)===e?e:this},P=a?w.bind(h):function(t,n){x(t);var e,r=arguments,o=function(){var o=v(arguments,0,v(r,2));return this instanceof e?E.apply(this,[t,o]):t.apply(n,o)};return e=$([o,t,r])},F=TypeError,M=P.apply,N=P(P.call,M),k=P(M,{}.toString),C=function(t){if("function"!=typeof t&&"[object Function]"!==k(t))throw new F(t+" is not a function");return t},D=function(t,n){return N(C(t),n,v(arguments[2]))},A=function(t){try{return{threw:!1,value:D(t,this,v(arguments,1))}}catch(t){return{threw:!0,value:t}}},I=function(t){return!!t},G={}.toString,X=function(t){return function(t){if("function"!=typeof t&&"[object Function]"!==D(G,t))throw new TypeError("methodize called on incompatible "+t)}(t),function(){return D(t,arguments[0],v(arguments,1))}},q=X({}.toString),z=function(t){return null===t?"[object Null]":void 0===t?"[object Undefined]":q(t)},L=e(0),R=e.n(L);for(var B=A(function(){return function(t,n){if(t!==n)throw new TypeError("Cannot instantiate an arrow function")}(this,void 0),"function"==typeof Symbol&&R()(Symbol(""))}.bind(void 0)),H=!1===B.threw&&!0===B.value,U=H&&R()(Symbol.toStringTag),V=function(t){return null==t},J=function(t){if(V(t))throw new TypeError("Cannot call method on ".concat(t));return t},K="Cannot convert a Symbol value to a string".constructor,Q=function(t){if(R()(t))throw new TypeError("Cannot convert a Symbol value to a string");return K(t)},W=function(t){return Q(J(t))},Y=[{code:9,description:"Tab",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\t"},{code:10,description:"Line Feed",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\n"},{code:11,description:"Vertical Tab",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\v"},{code:12,description:"Form Feed",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\f"},{code:13,description:"Carriage Return",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\r"},{code:32,description:"Space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:160,description:"No-break space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:5760,description:"Ogham space mark",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:6158,description:"Mongolian vowel separator",es5:!0,es2015:!0,es2016:!0,es2017:!1,es2018:!1,string:""},{code:8192,description:"En quad",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8193,description:"Em quad",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8194,description:"En space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8195,description:"Em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8196,description:"Three-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8197,description:"Four-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8198,description:"Six-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8199,description:"Figure space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8200,description:"Punctuation space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8201,description:"Thin space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8202,description:"Hair space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8232,description:"Line separator",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\u2028"},{code:8233,description:"Paragraph separator",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\u2029"},{code:8239,description:"Narrow no-break space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8287,description:"Medium mathematical space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:12288,description:"Ideographic space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:65279,description:"Byte Order Mark",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\ufeff"}],Z="",tt=Y.length,nt=0;nt<tt;nt+=1)Y[nt].es2016&&Y[nt].string,Y[nt].es2018&&(Z+=Y[nt].string);var et=Z,rt=new(0,/none/.constructor)("^[".concat(et,"]+")),ot=X("".replace),it=function(t){return ot(W(t),rt,"")},ut=new(0,/none/.constructor)("[".concat(et,"]+$")),ct=X("".replace),st=function(t){return ct(W(t),ut,"")},ft=function(t){return it(st(t))},at=new(0,/none/.constructor)("[".concat(et,"]+"),"g"),lt=X(" ".replace),pt=function(t){return lt(ft(t),at," ")},yt=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,bt=X("".replace),dt=function(t,n){return bt(W(t),yt,arguments.length>1?Q(n):"")},gt=A.constructor,vt=X(A.toString),mt=/^class /,ht=X(mt.test),wt=!1===A(function(){return gt('"use strict"; return class My {};')()}).threw,St=function(t){return ht(mt,pt(dt(vt(t)," ")))},jt=function(t){var n=A(St,t);return!1===n.threw&&n.value},Ot=function(t,n){return!o(t)&&(U?function(t,n){return!(wt&&!1===n&&jt(t)||!1!==A(function(){return vt(t)}).threw)}(t,I(n)):(!wt||!1!==I(n)||!jt(t))&&function(t){var n=z(t);return"[object Function]"===n||"[object GeneratorFunction]"===n||"[object AsyncFunction]"===n}(t))},_t=function(t){return!1===o(t)&&!1===Ot(t,!0)},xt=function(t){return t!=t},Tt=function(t){return"number"==typeof t&&!1===xt(t)&&t!==1/0&&t!==-1/0},$t=e(2),Et=e.n($t),Pt="string".constructor,Ft=(0).constructor,Mt=H&&Symbol.toPrimitive,Nt=H&&Symbol.prototype.valueOf,kt=["toString","valueOf"],Ct=["valueOf","toString"],Dt=function(t,n){J(t),function(t){if("string"!=typeof t||"number"!==t&&"string"!==t)throw new TypeError('hint must be "string" or "number"')}(n);for(var e="string"===n?kt:Ct,r=0;r<2;r+=1){var i=t[e[r]];if(Ot(i)){var u=D(i,t);if(o(u))return u}}throw new TypeError("No default value")},At=function(t,n){if(n){if(t===Pt)return"string";if(t===Ft)return"number"}return"default"},It=function(t){if(H){if(Mt)return function(t,n){var e=t[n];if(!1===V(e)){if(!1===Ot(e))throw new TypeError("".concat(e," returned for property ").concat(n," of object ").concat(t," is not a function"));return e}}(t,Mt);if(R()(t))return Nt}},Gt=function(t){var n=t.exoticToPrim,e=t.input,r=t.hint,i=D(n,e,[r]);if(o(i))return i;throw new TypeError("unable to convert exotic object to primitive")},Xt=function(t,n){var e="default"===n&&(Et()(t)||R()(t))?"string":n;return Dt(t,"default"===e?"number":e)},qt=function(t,n){if(o(t))return t;var e=At(n,arguments.length>1),r=It(t);return void 0===r?Xt(t,e):Gt({exoticToPrim:r,input:t,hint:e})},zt=parseInt,Lt=(0).constructor,Rt=X("".charAt),Bt=/^[-+]?0[xX]/,Ht=X(Bt.test),Ut=function(t,n){var e=it(Q(t));return""===Rt(e,0)?NaN:zt(e,Lt(n)||(Ht(Bt,e)?16:10))},Vt=2..constructor,Jt=X("Cannot convert a Symbol value to a number".slice),Kt=/^0b[01]+$/i,Qt=Kt.constructor,Wt=X(Kt.test),Yt=/^0o[0-7]+$/i,Zt=new Qt("[ ]","g"),tn=/^[-+]0x[0-9a-f]+$/i,nn=function(t,n){return Ut(Jt(t,2),n)},en=function(t,n){return function(t){return Wt(Kt,t)}(n)?t(nn(n,2)):function(t){return Wt(Yt,t)}(n)?t(nn(n,8)):null},rn=function(t,n){var e=en(t,n);if(null!==e)return e;if(function(t){return Wt(Zt,t)}(n)||function(t){return Wt(tn,t)}(n))return NaN;var r=ft(n);return r!==n?t(r):null},on=function t(n){var e=function(t){if(R()(t))throw new TypeError("Cannot convert a Symbol value to a number");return t}(qt(n,Vt));if("string"==typeof e){var r=rn(t,e);if(null!==r)return r}return Vt(e)},un=function(t){var n=on(t);return 0===n||xt(n)?n:n>0?1:-1},cn=Math.abs,sn=Math.floor,fn=function(t){var n=on(t);return xt(n)?0:0===n||!1===Tt(n)?n:un(n)*sn(cn(n))},an=function(t){return Tt(t)&&fn(t)===t},ln=function(t){return an(t)&&t>=-9007199254740991&&t<=9007199254740991},pn=function(t){return ln(t)&&t>=0},yn={}.constructor,bn=function(t){return yn(J(t))};function dn(t){return(dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var gn,vn,mn,hn=function(t){var n=qt(t,String);return H&&"symbol"===dn(n)?n:Q(n)},wn=X({}.hasOwnProperty),Sn=function(t,n){return wn(bn(t),hn(n))},jn=H&&Symbol.prototype.toString,On="function"==typeof jn&&R.a,_n="".constructor,xn=function(t){return On&&On(t)?jn.call(t):_n(t)},Tn=function(t){var n=on(t[1]),e=t.length<3?{max:n,min:0}:{max:on(t[2]),min:n};if(e.min>e.max)throw new RangeError('"min" must be less than "max"');return e},$n=function(t){var n=on(t);if(arguments.length<2)return n;var e=Tn(arguments),r=e.max,o=e.min;return n<o?o:n>r?r:n},En=/^(?:0|[1-9]\d*)$/,Pn=En.test,Fn=function(t,n){var e=xn(t);if(!1===Pn.call(En,e))return!1;var r=on(e);return arguments.length>1?r<$n(fn(n),9007199254740991):r<9007199254740991},Mn=X({}.propertyIsEnumerable),Nn=function(t,n){return Mn(bn(t),hn(n))},kn=X("".charAt),Cn={}.constructor,Dn=Cn.getOwnPropertyDescriptor,An="function"==typeof Dn&&Dn,In=function(t,n){t[hn(n)]=0;var e=A(An,t,n);return!1===e.threw&&0===e.value.value},Gn=Cn.prototype,Xn=Sn(Gn,"__defineGetter__"),qn=Xn&&X(Gn.__lookupGetter__),zn=Xn&&X(Gn.__lookupSetter__);if(An){var Ln="undefined"!=typeof document&&document;if(!Ln||In(Ln.createElement("div"),"sentinel")){var Rn=A(An,bn("abc"),1);if(!1===Rn.threw&&Rn.value&&"b"===Rn.value.value)if(In({},"sentinel")){var Bn=!1===A(An,42,"name").threw;mn=H&&In({},bn(Symbol("")))?Bn?An:function(t,n){return An(bn(t),n)}:Bn?function(t,n){return An(t,hn(n))}:function(t,n){return An(bn(t),hn(n))}}else gn=An;else vn=An}}(!1===I(mn)||gn||vn)&&(mn=function(t,n){var e,r=bn(t),i=hn(n);if(gn&&!1===(e=A(function(){return gn(bn(r),i)})).threw)return e.value;var c=u()(r)&&Fn(i,r.length);if(vn&&!1===c&&!1===(e=A(function(){return vn(bn(r),i)})).threw)return e.value;var s=void 0;if(!1===c&&!1===Sn(r,i))return s;if(s={configurable:!1===o(t)&&!1===c,enumerable:Nn(r,i)},Xn){var f=r.__proto__,a=r!==Gn;a&&(r.__proto__=Gn);var l=qn(r,i),p=zn(r,i);if(a&&(r.__proto__=f),l||p)return l&&(s.get=l),p&&(s.set=p),s}return c?(s.value=kn(r,i),s.writable=!1):(s.value=r[i],s.writable=!0),s});var Hn=mn,Un=function(){return!0},Vn=function(t){return"function"==typeof t?A(t):{threw:!1,value:t}},Jn=function(t,n){var e="function"==typeof arguments[2]?arguments[2]:Un,r=A(function(){return D(t.get,n)});return!1===r.threw&&e(r.value)?t.get:null},Kn=function(t,n){var e=Vn(t);if(!1===e.threw&&_t(e.value)){var r=Hn(e.value.constructor.prototype,n);if(r&&"function"==typeof r.get)return Jn(r,e.value,arguments[2])}return null}(function(){return new Set},"size",pn);n.default=function(t){if(null===Kn||!1===_t(t))return!1;var n=A(function(){return D(Kn,t)});return!1===n.threw&&pn(n.value)}}])}); | ||
//# sourceMappingURL=is-set-x.min.js.map |
{ | ||
"name": "is-set-x", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Detect whether or not an object is an ES6 SET.", | ||
@@ -54,6 +54,7 @@ "homepage": "https://github.com/Xotic750/is-set-x", | ||
"dependencies": { | ||
"attempt-x": "^2.1.0", | ||
"is-length-x": "^3.2.0", | ||
"is-object-like-x": "^2.1.0", | ||
"object-get-own-property-descriptor-x": "^4.1.0" | ||
"attempt-x": "^2.1.1", | ||
"util-get-getter-x": "^1.0.1", | ||
"is-length-x": "^3.2.1", | ||
"is-object-like-x": "^2.1.1", | ||
"simple-call-x": "^1.0.2" | ||
}, | ||
@@ -68,6 +69,6 @@ "devDependencies": { | ||
"@babel/runtime": "^7.5.5", | ||
"@types/jest": "^24.0.17", | ||
"@types/node": "^12.7.1", | ||
"@types/webpack": "^4.32.1", | ||
"@xotic750/eslint-config-recommended": "^1.1.2", | ||
"@types/jest": "^24.0.18", | ||
"@types/node": "^12.7.2", | ||
"@types/webpack": "^4.39.0", | ||
"@xotic750/eslint-config-recommended": "^1.1.5", | ||
"babel-core": "^7.0.0-0", | ||
@@ -80,3 +81,3 @@ "babel-eslint": "^10.0.2", | ||
"cross-env": "^5.2.0", | ||
"eslint": "^6.1.0", | ||
"eslint": "^6.2.1", | ||
"eslint-friendly-formatter": "^4.0.1", | ||
@@ -92,3 +93,3 @@ "eslint-import-resolver-webpack": "^0.11.1", | ||
"eslint-plugin-jest": "^22.15.1", | ||
"eslint-plugin-jsdoc": "^15.8.0", | ||
"eslint-plugin-jsdoc": "^15.8.3", | ||
"eslint-plugin-json": "^1.4.0", | ||
@@ -102,4 +103,4 @@ "eslint-plugin-lodash": "^6.0.0", | ||
"eslint-plugin-switch-case": "^1.1.2", | ||
"jest": "^24.8.0", | ||
"jest-cli": "^24.8.0", | ||
"jest": "^24.9.0", | ||
"jest-cli": "^24.9.0", | ||
"jest-file": "^1.0.0", | ||
@@ -111,3 +112,3 @@ "lodash": "^4.17.15", | ||
"prettier": "^1.18.2", | ||
"rimraf": "^2.6.3", | ||
"rimraf": "^3.0.0", | ||
"source-map-loader": "^0.2.4", | ||
@@ -117,5 +118,5 @@ "strip-ansi": "^5.2.0", | ||
"typescript": "^3.5.3", | ||
"webpack": "^4.39.1", | ||
"webpack": "^4.39.2", | ||
"webpack-bundle-analyzer": "^3.4.1", | ||
"webpack-cli": "^3.3.6", | ||
"webpack-cli": "^3.3.7", | ||
"webpack-global-object-x": "^1.0.0", | ||
@@ -122,0 +123,0 @@ "webpack-merge": "^4.2.1" |
@@ -1,46 +0,14 @@ | ||
import gOPD from 'object-get-own-property-descriptor-x'; | ||
import attempt from 'attempt-x'; | ||
import isObjectLike from 'is-object-like-x'; | ||
import isLength from 'is-length-x'; | ||
import call from 'simple-call-x'; | ||
import getGetter from 'util-get-getter-x'; | ||
const test1 = function test1() { | ||
return attempt(function createSet() { | ||
/* eslint-disable-next-line compat/compat */ | ||
return new Set(); | ||
}); | ||
const creator = function creator() { | ||
/* eslint-disable-next-line compat/compat */ | ||
return new Set(); | ||
}; | ||
const getFromDescriptor = function getFromDescriptor(descriptor) { | ||
const resTest1 = test1(); | ||
const getSize = getGetter(creator, 'size', isLength); | ||
if (resTest1.threw === false && isObjectLike(resTest1.value)) { | ||
const res = attempt.call(resTest1.value, descriptor.get); | ||
if (res.threw === false && isLength(res.value)) { | ||
return descriptor.get; | ||
} | ||
} | ||
return null; | ||
}; | ||
const getGetter = function getGetter() { | ||
if (typeof Set === 'function') { | ||
/* eslint-disable-next-line compat/compat */ | ||
const descriptor = gOPD(Set.prototype, 'size'); | ||
if (descriptor && typeof descriptor.get === 'function') { | ||
const getter = getFromDescriptor(descriptor); | ||
if (getter !== null) { | ||
return getter; | ||
} | ||
} | ||
} | ||
return null; | ||
}; | ||
const getSize = getGetter(); | ||
/** | ||
@@ -58,3 +26,5 @@ * Determine if an `object` is a `Set`. | ||
const result = attempt.call(object, getSize); | ||
const result = attempt(function attemptee() { | ||
return call(getSize, object); | ||
}); | ||
@@ -61,0 +31,0 @@ return result.threw === false && isLength(result.value); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
310781
2088
5
+ Addedsimple-call-x@^1.0.2
+ Addedutil-get-getter-x@^1.0.1
+ Addedutil-get-getter-x@1.0.2(transitive)
Updatedattempt-x@^2.1.1
Updatedis-length-x@^3.2.1
Updatedis-object-like-x@^2.1.1