0.0.17 • Published 11 months ago

@aseemtaneja/utils v0.0.17

Weekly downloads
-
License
MIT
Repository
-
Last release
11 months ago

A bunch of utilities that I use in my projects.

Installation

npm install @aseemtaneja/utils@latest

Utilities

Strings

  • joinTruthy - Joins an array of strings, ignoring falsy values.

Arrays

  • sampleOne - Plucks a random item from an array.

Objects

  • shallowMapKeys - Maps the keys of an object to new keys.

Geometry

  • getDistanceBetweenPoints - Returns the distance between two points on a cartesian plane.

Phone Numbers

  • isValidIndianMobileNumber - Checks if a number is a valid Indian mobile number.
  • getTenDigitIndianMobileNumber - Returns a vaild 10 digit Indian mobile number from a given string or returns null.

Colors

Utilities that make working with colors easier in Tailwind CSS.

  • getColorVarsObj - Returns an object with CSS variables names as keys and CSS colors as values.
  • getColorVarsCSS - Returns an object of the form {':root': ColorVarsObj, '.dark'? : ColorVarsObj}.
  • getCSSVarsColorObj - Returns a color object where the values are CSS variables.
  • getRadixColorObj - Returns a color object with Radix UI color values.
  • getRadixColorsForTailwind - Returns a color object with Radix UI color values, and, base CSS which exposes the color values as CSS vars.
  • getFreshworksColorsForTailwind - Returns a color object with Freshworks' 'Crayon' design system color values.

DOM

  • moveCursorWithinInput - Moves the user's cursor to the desired position within a text input.
0.0.16

11 months ago

0.0.17

11 months ago

0.0.15

1 year ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago