Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions lib/helpers/functions.helpers.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
head,
tail,
isString,
isArray,
isObject,
Expand Down Expand Up @@ -40,13 +39,6 @@ test('head(), should return the first element in an array', () => {
expect(head(randArr)).toBe(randVal)
})

test('tail(), should return the last element in an array', () => {
const randArr = Array(getRandomInt(100))
const randVal = getRandomInt(100)
randArr[randArr.length - 1] = randVal
expect(tail(randArr)).toBe(randVal)
})

describe('isString(), should be true only for strings', () => {
test.each(objectTypesTests)('Testing %s', (type, value) => {
expect(type !== 'string' || (type === 'string' && isString(value))).toBe(
Expand Down
8 changes: 0 additions & 8 deletions lib/helpers/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ export interface FetchDataOptions<T = UnknownObject> {

export const head = <T>([first]: T[]): T => first

export const tail = <T>(arr: T[]): T => arr[arr.length - 1]

export const isString = (str: unknown): boolean =>
typeof str === 'string' || str instanceof String

Expand Down Expand Up @@ -154,12 +152,6 @@ export const sortBy = <T = UnknownObject>(
export const cleanLonelyInt = (val: string): boolean =>
!(val && /^\d+$/.test(val))

export const debugPrint = (...args: unknown[]): void => {
if (process.env.NODE_ENV !== 'production') {
console.log(...args)
}
}

export const errorPrint = (...args: unknown[]): void => {
console.error(...args)
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"linkifyjs": "^4.3.2"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
"react": "^19.0.0"
},
"devDependencies": {
"@eslint-react/eslint-plugin": "^4.2.3",
Expand Down
Loading