retry
—> Re-run a callback funciton using Promises with try count and delay time.simple-axios-module.js
—> Simpler configuration of axios to have cleaner api calls.runBeforeEachMethod
—> Happy helper to execute a callback on every class method.handleSwipe
—> Returns a promise with the direction of the swipe.shortenNumber
—> Returns value in compacted format (e.g. 1M, 4K).debounce
—> Native JS debounce function (prevents muliple clicks on an element).sanitizeInput
—> Validate inputs for injections.handleSwipe
—> detect the swiper directinon and doing some staff on user swipe.openCaller
—> Easily work with callers (mail, phone and etc).generateError
—> Reusable function to throwing errors and more.generateArr
—> Fastly create arrays.toPersian
—> Converts any string number (even in innerHtml) to persian number.toEnglish
—> Converts any string number (even in innerHtml) to english number.scrollToElement
—> Scrolls to specific element.checkEmptyObject
—> Checks if an object has proptery or not.checkJson
—> Checks whether a string is JSON or not.checkPrimitive
—> Checks whether a variable is primitive (data that is not an object and has no methods) or not.castTimeMsg
—> Eeasy way to form the date messages like10 days ago
oryesterday
and etc.generateUrl
—> Generate URLs with query params. (nice and easy)addLeadingZero
—> Add zero at the begining of a number (eg. countdown)
jamal-rahimzadegan / utility Goto Github PK
View Code? Open in Web Editor NEWUtility functions for Javascript