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

tree-helper

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tree-helper - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

69

dist/tree-helper.js

@@ -15,5 +15,5 @@ /*!

/*!
* helper-js v1.0.0
* helper-js v1.0.6
* phphe <phphe@outlook.com> (https://github.com/phphe)
* undefined
* https://github.com/phphe/helper-js.git
* Released under the MIT License.

@@ -54,67 +54,4 @@ */

}
function getOffset(el) {
var elOffset = {
x: el.offsetLeft,
y: el.offsetTop
};
var parentOffset = { x: 0, y: 0 };
if (el.offsetParent != null) parentOffset = getOffset(el.offsetParent);
return {
x: elOffset.x + parentOffset.x,
y: elOffset.y + parentOffset.y
};
}
// overload waitFor(condition, time = 100, maxCount = 1000))
function waitFor(name, condition) {
var time = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 100;
var maxCount = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1000;
var storeOfWaitFor = {};
if (isFunction(name)) {
maxCount = time;
time = isNumeric(condition) ? condition : 100;
condition = name;
name = null;
}
if (!waitFor._waits) {
waitFor._waits = {};
}
var waits = waitFor._waits;
if (name && isset(waits[name])) {
window.clearInterval(waits[name]);
delete waits[name];
}
return new Promise(function (resolve, reject) {
var count = 0;
function judge(interval) {
if (count <= maxCount) {
if (condition()) {
stop(interval, name);
resolve();
}
} else {
stop(interval, name);
reject(new Error('waitFor: Limit is reached'));
}
count++;
}
function stop(interval, name) {
if (interval) {
if (name && isset(waits[name])) {
window.clearInterval(waits[name]);
delete waits[name];
} else {
window.clearInterval(interval);
}
}
}
var interval = window.setInterval(function () {
judge(interval);
}, time);
if (name) {
waits[name] = interval;
}
judge();
});
}
function clone(obj) {

@@ -121,0 +58,0 @@ var childrenKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'children';

4

package.json
{
"name": "tree-helper",
"version": "1.0.1",
"version": "1.0.2",
"description": "",

@@ -24,4 +24,4 @@ "main": "dist/tree-helper.common.js",

"dependencies": {
"helper-js": "^1.0.3"
"helper-js": "^1.0.6"
}
}

Sorry, the diff of this file is not supported yet

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