- Json stringify the log message if its being pushed to Kibana
- Changed winston logger to Pino logger to improve performance and reduce memory usage
- Added toUpperTitle method that accepts a string and removes all non alphanumeric characters and capitalizes each letter of every first word
import {Logger} from '@mhmdhammoud/meritt-utils'
// Usage Example
Logger.info('className', ' functionName', 'logMessage', 'userIp')
// Available levels info warn error
- Added toUpperTitle method that accepts a string and removes all non alphanumeric characters and capitalizes each letter of every first word
import {Formatter} from '@mhmdhammoud/meritt-utils'
// Usage Example
const sentence:string = "hello__world$$99"
console.log(Formatter.toUpperTitle(sentence))
console : Hello World 99
- Added generateKeys method that returns public and private keys
import {Crypto} from '@mhmdhammoud/meritt-utils'
// Example of generating a public and a private key
const response = Crypto.generateKeys()
console.log(response)
{
publicKey:7,
privateKey:247,
}
- Checking for prime numbers discarding even and odd numbers and skips 6 iterations at a time until radical I
- Added Formatter class for manipulating strings
import {Formatter} from '@mhmdhammoud/meritt-utils'
// Example of creating a product slug
const slug = Formatter.slugify('My Product Name') // my-product-name
- Fixed bug in Crypto class where encrypting a string with a key that is not a number would throw an error
- Improved Crypto class to allow encrypting and decrypting numbers and objects
- Documented Crypto class
- Added Crypto class that contains encrypt and decrypt methods for strings, numbers, and objects using a public and private key
import {Crypto} from '@mhmdhammoud/meritt-utils'
// Example of encrypting and decrypting a string
const encryptedMessage = Crypto.encrypt('Hello World', 7) // [23,235,141,414]
const decryptedMessage = Crypto.decrypt(encryptedMessage, 247) // Hello World