Skip to content

ale4ko69/js-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub package.json version

js-helper

Javascript library with useful features

Functions

getMaxzIndex()number

Checks all DOM elements in the document body for position inline style and computed CSS and returns the maximum number of the z-index CSS property.

guid()string

Generate GUID/UUID string.

getRandomString([strLen])string

Generate random string consisting from English Letters in Upper and Lower case and number from 0-9

htmlCleanWhiteBreakLine(content)string

Clean Html String from line break, space

getTimeStampNow()number

Get current TIMESTAMP in milliseconds

dateDiff(date2_ms, date1_ms)number

Show the difference between two dates in minutes

findObjectsByKeyValue(obj, key, val)array

Search in object by key & value

getMaxzIndex() ⇒ number

Checks all DOM elements in the document body for position inline style and computed CSS and returns the maximum number of the z-index CSS property.

Kind: global function
Returns: number - Maximum Z-index number

guid() ⇒ string

Generate GUID/UUID string.

Kind: global function
Returns: string - string in unique format GUID - 279cd021-7f13-056c-ff5e-6fe1deef4379

getRandomString([strLen]) ⇒ string

Generate random string consisting from English Letters in Upper and Lower case and number from 0-9

Kind: global function
Returns: string - Generated random string

Param Type Default Description
[strLen] number | undefined 10 Length of the random string; By default 10 chars

htmlCleanWhiteBreakLine(content) ⇒ string

Clean Html String from line break, space

Kind: global function
Returns: string - Clean string

Param Type Description
content string Text with all type of breake lines and spaces

getTimeStampNow() ⇒ number

Get current TIMESTAMP in milliseconds

Kind: global function
Returns: number - Milliseconds

dateDiff(date2_ms, date1_ms) ⇒ number

Show the difference between two dates in minutes

Kind: global function
Returns: number - Difference in minutes between two dates

Param Type Description
date2_ms number Date converted to milliseconds
date1_ms number Date converted to milliseconds

findObjectsByKeyValue(obj, key, val) ⇒ array

Search in object by key & value

Kind: global function
Returns: array - An array of the found objects

Param Type Description
obj object Object where we search
key string Property in Object in our search
val string Value for search

© 2021-2022 Alexey Kagansky