From dcbf44c0e37e0ca86f8ed211b86a9ff6e740f800 Mon Sep 17 00:00:00 2001 From: Guga Guichard Date: Mon, 18 Mar 2024 17:25:44 -0300 Subject: [PATCH] fix: Update packages and fix TSC --- package-lock.json | 20 ++++++++++---------- package.json | 4 ++-- src/utils/word-case/capitalize.ts | 5 ++++- src/utils/word-case/uncapitalize.ts | 5 ++++- 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index bfb11dd..775a613 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,12 +10,12 @@ "license": "MIT", "devDependencies": { "@typescript-eslint/eslint-plugin": "latest", - "@vitest/coverage-v8": "^1.0.2", - "eslint": "*", + "@vitest/coverage-v8": "^1.4.0", + "eslint": "latest", "prettier": "latest", "tsup": "latest", - "typescript": "^5.1.6", - "vitest": "*" + "typescript": "^5.4.2", + "vitest": "latest" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -3329,9 +3329,9 @@ } }, "node_modules/typescript": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", - "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "version": "5.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", + "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -5959,9 +5959,9 @@ "dev": true }, "typescript": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", - "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "version": "5.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", + "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", "dev": true }, "ufo": { diff --git a/package.json b/package.json index 5059cbd..8acda14 100644 --- a/package.json +++ b/package.json @@ -17,11 +17,11 @@ }, "devDependencies": { "@typescript-eslint/eslint-plugin": "latest", - "@vitest/coverage-v8": "^1.0.2", + "@vitest/coverage-v8": "^1.4.0", "eslint": "latest", "prettier": "latest", "tsup": "latest", - "typescript": "^5.1.6", + "typescript": "^5.4.2", "vitest": "latest" }, "files": [ diff --git a/src/utils/word-case/capitalize.ts b/src/utils/word-case/capitalize.ts index b050822..cf0536f 100644 --- a/src/utils/word-case/capitalize.ts +++ b/src/utils/word-case/capitalize.ts @@ -10,5 +10,8 @@ import { toUpperCase } from '../../native/to-upper-case.js' * @example capitalize('hello world') // 'Hello world' */ export function capitalize(str: T) { - return join([toUpperCase(charAt(str, 0)), slice(str, 1)]) as Capitalize + return join([ + toUpperCase(charAt(str, 0) ?? ''), + slice(str, 1), + ]) as Capitalize } diff --git a/src/utils/word-case/uncapitalize.ts b/src/utils/word-case/uncapitalize.ts index ef5c698..a8a951b 100644 --- a/src/utils/word-case/uncapitalize.ts +++ b/src/utils/word-case/uncapitalize.ts @@ -10,5 +10,8 @@ import { toLowerCase } from '../../native/to-lower-case.js' * @example uncapitalize('Hello world') // 'hello world' */ export function uncapitalize(str: T) { - return join([toLowerCase(charAt(str, 0)), slice(str, 1)]) as Uncapitalize + return join([ + toLowerCase(charAt(str, 0) ?? ''), + slice(str, 1), + ]) as Uncapitalize }