Skip to content

Commit

Permalink
Make namedays.all a function
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptammergard committed Apr 16, 2024
1 parent dd8bc19 commit fbcbe10
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/four-pans-bathe.md
@@ -0,0 +1,5 @@
---
"namedays": major
---

Make namedays.all a function.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -46,7 +46,7 @@ import { Nameday } from "namedays"

#### Parameters

`namedays.all()` takes no parameters.
- Optional `settings`: An object where country code can be set.

#### Returns

Expand Down
7 changes: 7 additions & 0 deletions src/all.ts
@@ -0,0 +1,7 @@
import { filterByCountryCode } from "./lib/filterByCountryCode"
import type { CountryCode } from "./types"

export function all(settings?: { countryCode?: CountryCode }) {
const filteredNamedays = filterByCountryCode(settings?.countryCode)
return filteredNamedays
}
2 changes: 1 addition & 1 deletion src/index.ts
@@ -1,4 +1,4 @@
import { namedays as all } from "./namedays/index"
import { all } from "./all"
import { on } from "./on"
import { today } from "./today"
import { when } from "./when"
Expand Down

0 comments on commit fbcbe10

Please sign in to comment.