2.0.4 • Published 4 years ago

@ivbrajkovic/utils v2.0.4

Weekly downloads
200
License
ISC
Repository
github
Last release
4 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

4 years ago

2.0.2

4 years ago

2.0.4

4 years ago

2.0.0

4 years ago

1.2.22

4 years ago

1.2.21

4 years ago

1.2.16

5 years ago

1.2.17

5 years ago

1.2.15

5 years ago

1.2.18

5 years ago

1.2.19

5 years ago

1.2.20

5 years ago

1.2.14

5 years ago

1.2.12

5 years ago

1.2.13

5 years ago

1.2.11

5 years ago

1.2.10

5 years ago

1.2.9

5 years ago

1.2.8

5 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.0

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.1.41

5 years ago

1.0.41

5 years ago

1.0.40

5 years ago

1.0.39

5 years ago

1.0.38

5 years ago

1.0.37

5 years ago

1.0.36

5 years ago

1.0.35

5 years ago

1.0.33

5 years ago

1.0.32

5 years ago

1.0.26

5 years ago

1.0.23

5 years ago

1.0.28

5 years ago

1.0.31

5 years ago

1.0.30

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago