Skip to content

Commit

Permalink
Update Nano Stores and other dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Aug 3, 2024
1 parent 87d8a28 commit 13e08ec
Show file tree
Hide file tree
Showing 4 changed files with 393 additions and 428 deletions.
10 changes: 6 additions & 4 deletions count/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@ import type { AssertTrue as Assert, IsExact } from 'conditional-type-checks'
import type { TranslationFunction } from '../create-i18n/index.js'
import { count, params } from '../index.js'

const f1 = count({
let f1 = count({
many: '{count} pages',
one: 'One page'
})
const f2 = count(
let f2 = count(
params<{ category: number }>({
many: '{count} pages in {category}',
one: 'One page in {category}'
})
)
const f21 = f2({ category: 12 })
const f22 = f2(12)
let f21 = f2({ category: 12 })
let f22 = f2(12)

console.log(f1, f21, f22)

// eslint-disable-next-line @typescript-eslint/no-unused-vars
type cases = [
Expand Down
31 changes: 12 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,36 +41,29 @@
}
],
"peerDependencies": {
"nanostores": "^0.9.0 || ^0.10.0"
"nanostores": "^0.9.0 || ^0.10.0 || ^0.11.0"
},
"devDependencies": {
"@logux/eslint-config": "^53.2.0",
"@nanostores/persistent": "^0.10.1",
"@logux/eslint-config": "^53.3.0",
"@nanostores/persistent": "^0.10.2",
"@size-limit/preset-small-lib": "^11.1.4",
"@types/node": "^20.14.8",
"@typescript-eslint/eslint-plugin": "^7.14.1",
"@typescript-eslint/parser": "^7.14.1",
"@types/node": "^22.1.0",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
"better-node-test": "^0.5.1",
"c8": "^10.1.2",
"check-dts": "^0.8.0",
"clean-publish": "^5.0.0",
"conditional-type-checks": "^1.0.6",
"eslint": "^9.5.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^17.9.0",
"eslint-plugin-node-imports": "^1.0.2",
"eslint-plugin-perfectionist": "^2.11.0",
"eslint-plugin-prefer-let": "^3.0.1",
"eslint-plugin-promise": "^6.2.0",
"globals": "^15.6.0",
"eslint": "^9.8.0",
"globals": "^15.9.0",
"nanodelay": "^2.0.2",
"nanospy": "^1.0.0",
"nanostores": "^0.10.3",
"nanostores": "^0.11.0",
"size-limit": "^11.1.4",
"tsx": "^4.15.7",
"typescript": "^5.5.2",
"vite": "^5.3.1"
"tsx": "^4.16.5",
"typescript": "^5.5.4",
"vite": "^5.3.5"
},
"prettier": {
"arrowParens": "avoid",
Expand Down
14 changes: 8 additions & 6 deletions params/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,21 @@ import {
type TranslationFunction
} from '../index.js'

const f1 = params('Pages in {category}')
const f2 = params<{ category: number }>(
let f1 = params('Pages in {category}')
let f2 = params<{ category: number }>(
count({
many: '{count} pages in {category}',
one: 'One page in {category}'
})
)
const f21 = f2({ category: 12 })
const f22 = f2(12)
const incorrectParamsType = params<{ incorrect_param: number }>(
let f21 = f2({ category: 12 })
let f22 = f2(12)
let incorrectParamsType = params<{ incorrect_param: number }>(
'Pages in {category}'
)
const noParams = params('No params')
let noParams = params('No params')

console.log(f1, f21, f22, incorrectParamsType, noParams)

// eslint-disable-next-line @typescript-eslint/no-unused-vars
type cases = [
Expand Down
Loading

0 comments on commit 13e08ec

Please sign in to comment.