Socket
Socket
Sign inDemoInstall

immutable-tuple

Package Overview
Dependencies
0
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.4.4 to 0.4.5

4

dist/tuple.js

@@ -134,5 +134,3 @@ 'use strict';

// use the global `Array` constructor as a shared namespace.
var root = globalKey in Array
? Array[globalKey]
: def(Array, globalKey, new UniversalWeakMap, false);
var root = Array[globalKey] || def(Array, globalKey, new UniversalWeakMap, false);

@@ -139,0 +137,0 @@ function intern(array) {

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=function(){this._weakMap=null,this._strongMap=null};function e(t){switch(typeof t){case"object":if(null===t)return!1;case"function":return!0;default:return!1}}t.prototype.get=function(t){var e=this._getMap(t,!1);if(e)return e.get(t)},t.prototype.set=function(t,e){return this._getMap(t,!0).set(t,e),e},t.prototype._getMap=function(t,r){return r?e(t)?this._weakMap||(this._weakMap=new WeakMap):this._strongMap||(this._strongMap=new Map):e(t)?this._weakMap:this._strongMap};var r="function"==typeof Symbol,n=r?Symbol.for("immutable-tuple"):"@@__IMMUTABLE_TUPLE__@@",o=r?Symbol.for("immutable-tuple-root"):"@@__IMMUTABLE_TUPLE_ROOT__@@";function a(t){function e(e,r){var n=Object.getOwnPropertyDescriptor(Array.prototype,e);t(e,n,!!r)}e("every"),e("filter"),e("find"),e("findIndex"),e("forEach"),e("includes"),e("indexOf"),e("join"),e("lastIndexOf"),e("map"),e("reduce"),e("reduceRight"),e("slice"),e("some"),e("toLocaleString"),e("toString"),e("reverse",!0),e("sort",!0),e(r&&Symbol.iterator||"@@iterator")}function tuple(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return u(t)}var i=o in Array?Array[o]:p(Array,o,new t,!1);function u(e){var r=i;if(e.forEach(function(e){r=r.get(e)||r.set(e,new t)}),r.tuple)return r.tuple;var n=Object.create(tuple.prototype);return e.forEach(function(t,e){return p(n,e,t,!0)}),p(n,"length",e.length,!1),r.tuple=n}function p(t,e,r,n){return Object.defineProperty(t,e,{value:r,enumerable:!!n,writable:!1,configurable:!1}),r}function f(t){return!(!t||!0!==t[n])}function c(tuple){for(var t=[],e=tuple.length;e--;)t[e]=tuple[e];return t}p(tuple.prototype,n,!0,!1),tuple.isTuple=f,a(function(t,e,r){var n=e&&e.value;"function"==typeof n&&(e.value=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var o=n.apply(r?c(this):this,t);return Array.isArray(o)?u(o):o},Object.defineProperty(tuple.prototype,t,e))});var l=Array.prototype,s=l.concat;tuple.prototype.concat=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return u(s.apply(c(this),t.map(function(t){return f(t)?c(t):t})))},exports.default=tuple,exports.tuple=tuple;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=function(){this._weakMap=null,this._strongMap=null};function e(t){switch(typeof t){case"object":if(null===t)return!1;case"function":return!0;default:return!1}}t.prototype.get=function(t){var e=this._getMap(t,!1);if(e)return e.get(t)},t.prototype.set=function(t,e){return this._getMap(t,!0).set(t,e),e},t.prototype._getMap=function(t,r){return r?e(t)?this._weakMap||(this._weakMap=new WeakMap):this._strongMap||(this._strongMap=new Map):e(t)?this._weakMap:this._strongMap};var r="function"==typeof Symbol,n=r?Symbol.for("immutable-tuple"):"@@__IMMUTABLE_TUPLE__@@",o=r?Symbol.for("immutable-tuple-root"):"@@__IMMUTABLE_TUPLE_ROOT__@@";function a(t){function e(e,r){var n=Object.getOwnPropertyDescriptor(Array.prototype,e);t(e,n,!!r)}e("every"),e("filter"),e("find"),e("findIndex"),e("forEach"),e("includes"),e("indexOf"),e("join"),e("lastIndexOf"),e("map"),e("reduce"),e("reduceRight"),e("slice"),e("some"),e("toLocaleString"),e("toString"),e("reverse",!0),e("sort",!0),e(r&&Symbol.iterator||"@@iterator")}function tuple(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return i(t)}var u=Array[o]||p(Array,o,new t,!1);function i(e){var r=u;if(e.forEach(function(e){r=r.get(e)||r.set(e,new t)}),r.tuple)return r.tuple;var n=Object.create(tuple.prototype);return e.forEach(function(t,e){return p(n,e,t,!0)}),p(n,"length",e.length,!1),r.tuple=n}function p(t,e,r,n){return Object.defineProperty(t,e,{value:r,enumerable:!!n,writable:!1,configurable:!1}),r}function f(t){return!(!t||!0!==t[n])}function c(tuple){for(var t=[],e=tuple.length;e--;)t[e]=tuple[e];return t}p(tuple.prototype,n,!0,!1),tuple.isTuple=f,a(function(t,e,r){var n=e&&e.value;"function"==typeof n&&(e.value=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var o=n.apply(r?c(this):this,t);return Array.isArray(o)?i(o):o},Object.defineProperty(tuple.prototype,t,e))});var l=Array.prototype,s=l.concat;tuple.prototype.concat=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return i(s.apply(c(this),t.map(function(t){return f(t)?c(t):t})))},exports.default=tuple,exports.tuple=tuple;
{
"name": "immutable-tuple",
"version": "0.4.4",
"version": "0.4.5",
"description": "Immutable finite list objects with constant-time equality testing (===) and no memory leaks",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -32,5 +32,3 @@ // See [`universal-weak-map.js`](universal-weak-map.html).

// use the global `Array` constructor as a shared namespace.
const root = globalKey in Array
? Array[globalKey]
: def(Array, globalKey, new UniversalWeakMap, false);
const root = Array[globalKey] || def(Array, globalKey, new UniversalWeakMap, false);

@@ -37,0 +35,0 @@ function intern(array) {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc