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

helper-js

Package Overview
Dependencies
Maintainers
1
Versions
143
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

helper-js - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

16

dist/helper-js.common.js
/*!
* helper-js v1.0.6
* helper-js v1.0.7
* phphe <phphe@outlook.com> (https://github.com/phphe)

@@ -332,2 +332,15 @@ * https://github.com/phphe/helper-js.git

}
//
function windowLoaded() {
return new Promise(function (resolve, reject) {
if (document && document.readyState === 'complete') {
resolve();
} else {
window.addEventListener('load', function once() {
resolve();
window.removeEventListener('load', once);
});
}
});
}
var storeOfWaitFor = {};

@@ -423,3 +436,4 @@ // overload waitFor(condition, time = 100, maxCount = 1000))

exports.binarySearch = binarySearch;
exports.windowLoaded = windowLoaded;
exports.storeOfWaitFor = storeOfWaitFor;
exports.waitFor = waitFor;
/*!
* helper-js v1.0.6
* helper-js v1.0.7
* phphe <phphe@outlook.com> (https://github.com/phphe)

@@ -328,2 +328,15 @@ * https://github.com/phphe/helper-js.git

}
//
function windowLoaded() {
return new Promise(function (resolve, reject) {
if (document && document.readyState === 'complete') {
resolve();
} else {
window.addEventListener('load', function once() {
resolve();
window.removeEventListener('load', once);
});
}
});
}
var storeOfWaitFor = {};

@@ -380,2 +393,2 @@ // overload waitFor(condition, time = 100, maxCount = 1000))

export { isset, isArray, isBool, isNumber, isNumeric, isString, isObject, isFunction, isPromise, empty, numRand, numPad, studlyCase, snakeCase, camelCase, camelToWords, titleCase, strRand, replaceMultiple, arrayRemove, arrayFirst, arrayLast, arrayDiff, assignIfDifferent, objectMerge, objectMap, objectOnly, objectExcept, objectGet, objectSet, getUrlParam, uniqueId, isDescendantOf, getOffset, findParent, hasClass, isOffsetInEl, getBorder, binarySearch, storeOfWaitFor, waitFor };
export { isset, isArray, isBool, isNumber, isNumeric, isString, isObject, isFunction, isPromise, empty, numRand, numPad, studlyCase, snakeCase, camelCase, camelToWords, titleCase, strRand, replaceMultiple, arrayRemove, arrayFirst, arrayLast, arrayDiff, assignIfDifferent, objectMerge, objectMap, objectOnly, objectExcept, objectGet, objectSet, getUrlParam, uniqueId, isDescendantOf, getOffset, findParent, hasClass, isOffsetInEl, getBorder, binarySearch, windowLoaded, storeOfWaitFor, waitFor };
/*!
* helper-js v1.0.6
* helper-js v1.0.7
* phphe <phphe@outlook.com> (https://github.com/phphe)

@@ -334,2 +334,15 @@ * https://github.com/phphe/helper-js.git

}
//
function windowLoaded() {
return new Promise(function (resolve, reject) {
if (document && document.readyState === 'complete') {
resolve();
} else {
window.addEventListener('load', function once() {
resolve();
window.removeEventListener('load', once);
});
}
});
}
var storeOfWaitFor = {};

@@ -425,2 +438,3 @@ // overload waitFor(condition, time = 100, maxCount = 1000))

exports.binarySearch = binarySearch;
exports.windowLoaded = windowLoaded;
exports.storeOfWaitFor = storeOfWaitFor;

@@ -427,0 +441,0 @@ exports.waitFor = waitFor;

4

dist/helper-js.min.js
/*!
* helper-js v1.0.6
* helper-js v1.0.7
* phphe <phphe@outlook.com> (https://github.com/phphe)

@@ -8,3 +8,3 @@ * https://github.com/phphe/helper-js.git

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.helperJs=t.helperJs||{})}(this,function(t){"use strict";function e(t){return void 0!==t}function n(t){return"[object Array]"===Object.prototype.toString.call(t)}function r(t){return"[object Boolean]"===Object.prototype.toString.call(t)}function o(t){return"[object Number]"===Object.prototype.toString.call(t)}function i(t){var e=parseFloat(t);return!isNaN(e)&&o(e)}function u(t){return"[object String]"===Object.prototype.toString.call(t)}function f(t){return"[object Object]"===Object.prototype.toString.call(t)}function a(t){return"function"==typeof t}function c(t){return"[object Promise]"===Object.prototype.toString.call(t)}function l(t){return null==t||(null!=t.length?0===t.length:!r(t)&&(o(t)?isNaN(t):f(t)?0===Object.keys(t).length:void 0))}function s(t,e){return 1===arguments.length&&(e=t,t=0),Math.floor(Math.random()*(e-t+1)+t)}function p(t,e){for(var n=t.toString().length;n<e;)t="0"+t,n++;return t}function d(t){return t&&t[0].toUpperCase()+t.substr(1)}function g(t){return t.replace(/ /g,"-").replace(/_/g,"-").replace(/([^A-Z])([A-Z])/g,"$1-$2").replace(/--+/g,"-").replace(/^-|-$|/g,"").toLowerCase()}function v(t){for(var e=t.toString().split(/[-_]/),n=1;n<e.length;n++)e[n]=d(e[n]);return e.join("")}function h(t){return t.toString().trim().split(/(?=[A-Z])/)}function y(t){return h(d(v(t))).join(" ").replace(/\bid\b/gi,"ID")}function b(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",o=0;o<t;o++)n+=r[s(r.length-1)];return e+n}function m(t,e){var n=new RegExp(Object.keys(t).join("|"),"g");return e.replace(n,function(e){return t[e]})}function j(t,e){var n=t.indexOf(e);return n>-1&&t.splice(n,1),t}function O(t){return t[0]}function w(t){return t[t.length-1]}function x(t,e){for(var n=t.length,r=[];n--;)e.indexOf(t[n])<0&&r.push(t[n]);return r}function E(t,e,n){t[e]!==n&&(t[e]=n)}function S(t,e){for(var n in e)t.hasOwnProperty(n)&&f(t[n])&&f(e[n])?Object.assign(t[n],e[n]):t[n]=e[n];return t}function P(t,e){var n={};for(var r in t)n[r]=e(t[r],r,t);return n}function I(t,e){var n={};for(var r in t)e.indexOf(r)>-1&&(n[r]=t[r]);return n}function N(t,e){var n={};for(var r in t)-1===e.indexOf(r)&&(n[r]=t[r]);return n}function C(t,e){for(var n=e.split("."),r=t,o=0;o<n.length;o++){if(void 0===r[n[o]])return;r=r[n[o]]}return r}function M(t,e,n){for(var r=e.split("."),o=r.length-1,i=0;i<o;i++)null==t[r[i]]&&(t[r[i]]={}),t=t[r[i]];t[r[o]]=n}function F(t){var e=document.location.href,n=e.indexOf(t+"=");if(-1==n)return!1;var r=e.slice(t.length+n+1),o=r.indexOf("&");return-1!=o&&(r=r.slice(0,o)),r}function L(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id_",e=t+b();return document.getElementById(e)||Z.includes(e)?L(t):(Z.push(e),e)}function A(t,e){for(;;){if(null==t.parentElement)return!1;if(t.parentElement===e)return!0;t=t.parentElement}}function H(t){function e(t){var n={x:t.offsetLeft,y:t.offsetTop},r={x:0,y:0};return null!=t.offsetParent&&(r=e(t.offsetParent)),{x:n.x+r.x,y:n.y+r.y}}return e(t)}function R(t,e){function n(t,e){if(t.parentElement)return e(t.parentElement)?t.parentElement:n(t.parentElement,e)}return n(t,e)}function k(t,e){return t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.className)}function B(t,e,n){var r=H(n);return r.x<=t&&r.x+n.offsetWidth>=t&&r.y<=e&&r.y+n.offsetHeight>=e}function D(t){var e=document.body,n=R(t,function(t){return k(t,"work-area")}),r=H(n);return{left:r.x,right:r.x+n.offsetWidth,top:r.y+50,bottom:e.offsetHeight<window.innerHeight?window.innerHeight:e.offsetHeight}}function W(t,e){for(var n,r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3,i=0,u=t.length-1,f=0;i>=0&&i<=u;){if(f>=o)throw Error("binarySearch: loop times is over "+o+", you can increase the limit.");n=Math.floor((u-i)/2+i),r=t[n];var a=e(r,t,f);if(a<0)u=n-1;else{if(!(a>0))return r;i=n+1}f++}return null}function _(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e3;a(t)&&(o=r,r=i(n)?n:100,n=t,t=null);var u=$;return t&&e(u[t])&&(window.clearInterval(u[t]),delete u[t]),new Promise(function(i,f){function a(e){l<=o?n()&&(c(e,t),i()):(c(e,t),f(new Error("waitFor: Limit is reached"))),l++}function c(t,n){t&&(n&&e(u[n])?(window.clearInterval(u[n]),delete u[n]):window.clearInterval(t))}var l=0,s=window.setInterval(function(){a(s)},r);t&&(u[t]=s),a()})}var Z=[],$={};t.isset=e,t.isArray=n,t.isBool=r,t.isNumber=o,t.isNumeric=i,t.isString=u,t.isObject=f,t.isFunction=a,t.isPromise=c,t.empty=l,t.numRand=s,t.numPad=p,t.studlyCase=d,t.snakeCase=g,t.camelCase=v,t.camelToWords=h,t.titleCase=y,t.strRand=b,t.replaceMultiple=m,t.arrayRemove=j,t.arrayFirst=O,t.arrayLast=w,t.arrayDiff=x,t.assignIfDifferent=E,t.objectMerge=S,t.objectMap=P,t.objectOnly=I,t.objectExcept=N,t.objectGet=C,t.objectSet=M,t.getUrlParam=F,t.uniqueId=L,t.isDescendantOf=A,t.getOffset=H,t.findParent=R,t.hasClass=k,t.isOffsetInEl=B,t.getBorder=D,t.binarySearch=W,t.storeOfWaitFor=$,t.waitFor=_,Object.defineProperty(t,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.helperJs=e.helperJs||{})}(this,function(e){"use strict";function t(e){return void 0!==e}function n(e){return"[object Array]"===Object.prototype.toString.call(e)}function r(e){return"[object Boolean]"===Object.prototype.toString.call(e)}function o(e){return"[object Number]"===Object.prototype.toString.call(e)}function i(e){var t=parseFloat(e);return!isNaN(t)&&o(t)}function u(e){return"[object String]"===Object.prototype.toString.call(e)}function a(e){return"[object Object]"===Object.prototype.toString.call(e)}function f(e){return"function"==typeof e}function c(e){return"[object Promise]"===Object.prototype.toString.call(e)}function l(e){return null==e||(null!=e.length?0===e.length:!r(e)&&(o(e)?isNaN(e):a(e)?0===Object.keys(e).length:void 0))}function s(e,t){return 1===arguments.length&&(t=e,e=0),Math.floor(Math.random()*(t-e+1)+e)}function d(e,t){for(var n=e.toString().length;n<t;)e="0"+e,n++;return e}function p(e){return e&&e[0].toUpperCase()+e.substr(1)}function g(e){return e.replace(/ /g,"-").replace(/_/g,"-").replace(/([^A-Z])([A-Z])/g,"$1-$2").replace(/--+/g,"-").replace(/^-|-$|/g,"").toLowerCase()}function v(e){for(var t=e.toString().split(/[-_]/),n=1;n<t.length;n++)t[n]=p(t[n]);return t.join("")}function h(e){return e.toString().trim().split(/(?=[A-Z])/)}function m(e){return h(p(v(e))).join(" ").replace(/\bid\b/gi,"ID")}function y(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",o=0;o<e;o++)n+=r[s(r.length-1)];return t+n}function b(e,t){var n=new RegExp(Object.keys(e).join("|"),"g");return t.replace(n,function(t){return e[t]})}function w(e,t){var n=e.indexOf(t);return n>-1&&e.splice(n,1),e}function j(e){return e[0]}function O(e){return e[e.length-1]}function x(e,t){for(var n=e.length,r=[];n--;)t.indexOf(e[n])<0&&r.push(e[n]);return r}function E(e,t,n){e[t]!==n&&(e[t]=n)}function S(e,t){for(var n in t)e.hasOwnProperty(n)&&a(e[n])&&a(t[n])?Object.assign(e[n],t[n]):e[n]=t[n];return e}function P(e,t){var n={};for(var r in e)n[r]=t(e[r],r,e);return n}function I(e,t){var n={};for(var r in e)t.indexOf(r)>-1&&(n[r]=e[r]);return n}function L(e,t){var n={};for(var r in e)-1===t.indexOf(r)&&(n[r]=e[r]);return n}function N(e,t){for(var n=t.split("."),r=e,o=0;o<n.length;o++){if(void 0===r[n[o]])return;r=r[n[o]]}return r}function C(e,t,n){for(var r=t.split("."),o=r.length-1,i=0;i<o;i++)null==e[r[i]]&&(e[r[i]]={}),e=e[r[i]];e[r[o]]=n}function M(e){var t=document.location.href,n=t.indexOf(e+"=");if(-1==n)return!1;var r=t.slice(e.length+n+1),o=r.indexOf("&");return-1!=o&&(r=r.slice(0,o)),r}function F(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id_",t=e+y();return document.getElementById(t)||$.includes(t)?F(e):($.push(t),t)}function A(e,t){for(;;){if(null==e.parentElement)return!1;if(e.parentElement===t)return!0;e=e.parentElement}}function H(e){function t(e){var n={x:e.offsetLeft,y:e.offsetTop},r={x:0,y:0};return null!=e.offsetParent&&(r=t(e.offsetParent)),{x:n.x+r.x,y:n.y+r.y}}return t(e)}function R(e,t){function n(e,t){if(e.parentElement)return t(e.parentElement)?e.parentElement:n(e.parentElement,t)}return n(e,t)}function k(e,t){return e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className)}function B(e,t,n){var r=H(n);return r.x<=e&&r.x+n.offsetWidth>=e&&r.y<=t&&r.y+n.offsetHeight>=t}function D(e){var t=document.body,n=R(e,function(e){return k(e,"work-area")}),r=H(n);return{left:r.x,right:r.x+n.offsetWidth,top:r.y+50,bottom:t.offsetHeight<window.innerHeight?window.innerHeight:t.offsetHeight}}function W(e,t){for(var n,r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3,i=0,u=e.length-1,a=0;i>=0&&i<=u;){if(a>=o)throw Error("binarySearch: loop times is over "+o+", you can increase the limit.");n=Math.floor((u-i)/2+i),r=e[n];var f=t(r,e,a);if(f<0)u=n-1;else{if(!(f>0))return r;i=n+1}a++}return null}function _(){return new Promise(function(e,t){document&&"complete"===document.readyState?e():window.addEventListener("load",function t(){e(),window.removeEventListener("load",t)})})}function Z(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e3;f(e)&&(o=r,r=i(n)?n:100,n=e,e=null);var u=J;return e&&t(u[e])&&(window.clearInterval(u[e]),delete u[e]),new Promise(function(i,a){function f(t){l<=o?n()&&(c(t,e),i()):(c(t,e),a(new Error("waitFor: Limit is reached"))),l++}function c(e,n){e&&(n&&t(u[n])?(window.clearInterval(u[n]),delete u[n]):window.clearInterval(e))}var l=0,s=window.setInterval(function(){f(s)},r);e&&(u[e]=s),f()})}var $=[],J={};e.isset=t,e.isArray=n,e.isBool=r,e.isNumber=o,e.isNumeric=i,e.isString=u,e.isObject=a,e.isFunction=f,e.isPromise=c,e.empty=l,e.numRand=s,e.numPad=d,e.studlyCase=p,e.snakeCase=g,e.camelCase=v,e.camelToWords=h,e.titleCase=m,e.strRand=y,e.replaceMultiple=b,e.arrayRemove=w,e.arrayFirst=j,e.arrayLast=O,e.arrayDiff=x,e.assignIfDifferent=E,e.objectMerge=S,e.objectMap=P,e.objectOnly=I,e.objectExcept=L,e.objectGet=N,e.objectSet=C,e.getUrlParam=M,e.uniqueId=F,e.isDescendantOf=A,e.getOffset=H,e.findParent=R,e.hasClass=k,e.isOffsetInEl=B,e.getBorder=D,e.binarySearch=W,e.windowLoaded=_,e.storeOfWaitFor=J,e.waitFor=Z,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=helper-js.min.js.map
{
"name": "helper-js",
"version": "1.0.6",
"version": "1.0.7",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/helper-js.common.js",

@@ -318,2 +318,15 @@ // is 各种判断

}
//
export function windowLoaded() {
return new Promise(function(resolve, reject) {
if (document && document.readyState === 'complete') {
resolve()
} else {
window.addEventListener('load', function once() {
resolve()
window.removeEventListener('load', once)
})
}
})
}
export const storeOfWaitFor = {}

@@ -320,0 +333,0 @@ // overload waitFor(condition, time = 100, maxCount = 1000))

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