2.0.4 • Published 3 years ago

@ivbrajkovic/utils v2.0.4

Weekly downloads
200
License
ISC
Repository
github
Last release
3 years ago

Vanilla JS Uility Functions

Collection of vanilla JS utility functions ES2015 compatible

Function list

/* Fetch */
fetchTextAsync; // Fetch text response async
fetchTextAbortCb; // Fetch text response with abort (callback)
fetchJsonAsync; // Fetch JSON response async
fetchJsonAbortCb; // Fetch JSON response with abort (callback)

/* Inline */
fetchSimpleTextAsync; // Fetch text
fetchSimpleJsonAsync; // Fetch JSON
isObjectEmpty; // Check if an objet is empty
deleteAllChild; // Delete all child of HTML element
randomIntFast; // Generate random integer (~~)
radToDeg; // Convert radian to degree
degToRad; // Convert degree to radian
isPowerOf2; // Check if number is power of two (bitwise check)
fixToOne; // Round number to one decimal (fast)
fixToTwo; // Round number to two decimal (fast)
trimLeadingZeros; // Remove leading 0's from string
logObject; // Pretty print object to console
absValue; // Absolute value of a 32 bit number (like Math.abs but faster)

/* DOM */
createElement; // Create a DOM element

/* Other */
debounce; // Simple debounce with setTimeout
random; // Generate random number (decimal option)
truncStr; // Truncate string if exceed max length
makeObservable; // Proxy with set trap

/* Debug (chromium API) */
getElementEvents; // Get HTML element registered events

TODO

  1. Add terser script to minify js :heavy_check_mark:
  2. Add more functions :blush:
2.0.3

3 years ago

2.0.2

3 years ago

2.0.4

3 years ago

2.0.0

3 years ago

1.2.22

3 years ago

1.2.21

3 years ago

1.2.16

3 years ago

1.2.17

3 years ago

1.2.15

3 years ago

1.2.18

3 years ago

1.2.19

3 years ago

1.2.20

3 years ago

1.2.14

3 years ago

1.2.12

3 years ago

1.2.13

3 years ago

1.2.11

4 years ago

1.2.10

4 years ago

1.2.9

4 years ago

1.2.8

4 years ago

1.2.7

4 years ago

1.2.6

4 years ago

1.2.5

4 years ago

1.2.0

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.1.41

4 years ago

1.0.41

4 years ago

1.0.40

4 years ago

1.0.39

4 years ago

1.0.38

4 years ago

1.0.37

4 years ago

1.0.36

4 years ago

1.0.35

4 years ago

1.0.33

4 years ago

1.0.32

4 years ago

1.0.26

4 years ago

1.0.23

4 years ago

1.0.28

4 years ago

1.0.31

4 years ago

1.0.30

4 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.20

4 years ago

1.0.19

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago