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

fizzy-ui-utils

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fizzy-ui-utils - npm Package Compare versions

Comparing version 2.0.5 to 2.0.6

2

package.json
{
"name": "fizzy-ui-utils",
"version": "2.0.5",
"version": "2.0.6",
"description": "UI utilities",

@@ -5,0 +5,0 @@ "main": "utils.js",

@@ -19,4 +19,4 @@ QUnit.test( 'makeArray', function( assert ) {

var empty = makeArray();
assert.ok( Array.isArray( empty ), 'makeArray on undefined is array' );
assert.equal( empty.length, 1, 'length = 1' );
assert.deepEqual( empty, [], 'makeArray on undefined is empty array' );
assert.equal( empty.length, 0, 'length = 0' );
assert.ok( empty[0] === undefined, '[0] is undefined' );

@@ -28,2 +28,9 @@

var nullAry = makeArray( null );
assert.deepEqual( nullAry, [], 'makeArray(null) returns empty array' );
var falseAry = makeArray( false );
assert.deepEqual( falseAry, [ false ], 'makeArray(false) returns array with false' );
assert.equal( falseAry.length, 1, 'falseyAry has 1 item' );
});
/**
* Fizzy UI utils v2.0.5
* Fizzy UI utils v2.0.6
* MIT license

@@ -57,19 +57,23 @@ */

var arraySlice = Array.prototype.slice;
// turn element or nodeList into an array
utils.makeArray = function( obj ) {
var ary = [];
if ( Array.isArray( obj ) ) {
// use object if already an array
ary = obj;
} else if ( obj && typeof obj == 'object' &&
typeof obj.length == 'number' ) {
return obj;
}
// return empty array if undefined or null. #6
if ( obj === null || obj === undefined ) {
return [];
}
var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';
if ( isArrayLike ) {
// convert nodeList to array
for ( var i=0; i < obj.length; i++ ) {
ary.push( obj[i] );
}
} else {
// array of single index
ary.push( obj );
return arraySlice.call( obj );
}
return ary;
// array of single index
return [ obj ];
};

@@ -153,18 +157,14 @@

utils.debounceMethod = function( _class, methodName, threshold ) {
threshold = threshold || 100;
// original method
var method = _class.prototype[ methodName ];
var timeoutName = methodName + 'Timeout';
var timeout;
_class.prototype[ methodName ] = function() {
var timeout = this[ timeoutName ];
if ( timeout ) {
clearTimeout( timeout );
}
clearTimeout( timeout );
var args = arguments;
var _this = this;
this[ timeoutName ] = setTimeout( function() {
timeout = setTimeout( function() {
method.apply( _this, args );
delete _this[ timeoutName ];
}, threshold || 100 );
}, threshold );
};

@@ -171,0 +171,0 @@ };

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