Skip to content

Commit

Permalink
ss
Browse files Browse the repository at this point in the history
  • Loading branch information
selfrefactor committed Sep 23, 2024
1 parent d43ace3 commit 00f3000
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions files/NEXT_VERSION_CHECKLIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,34 @@ chech in to read for examples
}
},
---

export const getTestData = <K extends keyof TestData>(key: K) => {
if (!TEST_DATA) return null
const value = TEST_DATA[key]
if (!value) return null

return value
}

export function findNth <T extends unknown>(
predicate: (input: T) => boolean
list: T[]
nth: number
): {value: T, index: number} | null {
let counter = 0
let result: {value: T, index: number} | null = null
input.list.forEach((value, index) => {
if(result) return
if (input.predicate(value)){
counter++
}
if (counter === input.nth){
result = {value, index}
}
})
return result
}
---
fix pluck and others where Record is used wrong
// import { pipe, pluck, prop } from "ramda"
import { pipe, pluck, prop } from "rambdax"
Expand Down

0 comments on commit 00f3000

Please sign in to comment.