1.0.5 • Published 1 year ago

custom-pkg-util v1.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Custom Package

Numeric Operations

  • sum(a: number, b: number): number: Adds two numbers.
  • subtract(a: number, b: number): number: Subtracts b from a.
  • multiply(a: number, b: number): number: Multiplies two numbers.
  • divide(a: number, b: number): number | string: Divides a by b. Returns 'Cannot divide by zero' if b is 0.
  • square(a: number): number: Returns the square of a.
  • cube(a: number): number: Returns the cube of a.
  • isEven(a: number): boolean: Checks if a is even.
  • isOdd(a: number): boolean: Checks if a is odd.

String Operations

  • capitalize(str: string): string: Capitalizes the first letter of a string.
  • reverse(str: string): string: Reverses the characters of a string.
  • length(str: string): number: Returns the length of a string.
  • countWords(str: string): number: Counts the number of words in a string.
  • replaceVowels(str: string): string: Replaces vowels in a string with '*'.
  • toUpperCase(str: string): string: Converts a string to uppercase.
  • toLowerCase(str: string): string: Converts a string to lowercase.
1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago