Skip to content

Commit

Permalink
Latest patches (#1434)
Browse files Browse the repository at this point in the history
* chore(dev-deps): to latest

* chore: adapt for typescript 5.6

* fix(internal): assertPlainObject error message remove explicit undefined union

* fix(internal): remove un-needed undefined for optional unions

* fix(internal): remove un-needed undefined for optional unions
  • Loading branch information
belgattitude authored Sep 10, 2024
1 parent 2985974 commit 6bd5105
Show file tree
Hide file tree
Showing 22 changed files with 196 additions and 205 deletions.
5 changes: 5 additions & 0 deletions .changeset/five-pants-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@httpx/dsn-parser": patch
---

[internal cleanup] refactor some unions with undefined for optional parameters
5 changes: 5 additions & 0 deletions .changeset/mean-ears-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@httpx/plain-object": patch
---

internal: assertPlainObject error message remove explicit undefined union
5 changes: 5 additions & 0 deletions .changeset/shy-trees-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@httpx/assert": patch
---

[internal cleanup] refactor some unions with undefined for optional parameters
6 changes: 3 additions & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"clean": "rimraf ./.next ./out /coverage ./tsconfig.tsbuildinfo"
},
"dependencies": {
"next": "14.2.8",
"next": "14.2.9",
"nextra": "2.13.4",
"nextra-theme-docs": "2.13.4",
"react": "18.3.1",
Expand All @@ -23,7 +23,7 @@
"devDependencies": {
"@belgattitude/eslint-config-bases": "6.0.0-canary.9",
"eslint": "8.57.0",
"eslint-config-next": "14.2.8",
"eslint-config-next": "14.2.9",
"eslint-plugin-tailwindcss": "3.17.4",
"postcss": "8.4.45",
"postcss-nesting": "13.0.0",
Expand All @@ -32,6 +32,6 @@
"sirv": "2.0.4",
"sirv-cli": "2.0.2",
"tailwindcss": "3.4.10",
"typescript": "5.5.4"
"typescript": "5.6.2"
}
}
6 changes: 3 additions & 3 deletions examples/nextjs-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"axios": "1.7.7",
"clsx": "2.1.1",
"ky": "1.7.2",
"next": "14.2.8",
"next": "14.2.9",
"pino": "9.4.0",
"primeicons": "7.0.0",
"primereact": "10.8.2",
Expand All @@ -48,12 +48,12 @@
"@vitest/ui": "2.0.5",
"cross-env": "7.0.3",
"eslint": "8.57.0",
"eslint-config-next": "14.2.8",
"eslint-config-next": "14.2.9",
"happy-dom": "15.7.3",
"postcss": "8.4.45",
"rimraf": "6.0.1",
"tailwindcss": "3.4.10",
"typescript": "5.5.4",
"typescript": "5.6.2",
"vite": "5.4.3",
"vite-plugin-svgr": "4.2.0",
"vite-tsconfig-paths": "5.0.1",
Expand Down
2 changes: 1 addition & 1 deletion integrations/prisma-exception/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"tsup": "8.2.4",
"typedoc": "0.26.7",
"typedoc-plugin-markdown": "4.2.7",
"typescript": "5.5.4",
"typescript": "5.6.2",
"vite": "5.4.3",
"vite-tsconfig-paths": "5.0.1",
"vitest": "2.0.5",
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"@commitlint/cli": "19.4.1",
"@commitlint/config-conventional": "19.4.1",
"@types/shell-quote": "1.7.5",
"@typescript-eslint/eslint-plugin": "8.5.0",
"@typescript-eslint/parser": "8.5.0",
"cross-env": "7.0.3",
"eslint": "8.57.0",
Expand All @@ -74,7 +75,7 @@
"rollup": "4.21.2",
"shell-quote": "1.8.1",
"syncpack": "13.0.0",
"typescript": "5.5.4"
"typescript": "5.6.2"
},
"engines": {
"node": ">=18.18"
Expand Down
6 changes: 4 additions & 2 deletions packages/assert/bench/comparative.bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ describe(`Compare calling ${realLifeScenarios.length}x isPlainObject with mixed
});
const is = await import('@sindresorhus/is').then((mod) => mod.default);
const isPlainObj = await import('is-plain-obj').then((mod) => mod.default);
const lodash = await import('lodash-es').then((mod) => mod.default);
const lodashIsPlainObject = await import('lodash-es').then(
(mod) => mod.isPlainObject
);

bench('@httpx/assert: `isPlainObject(v)`', () => {
for (const value of realLifeScenarios) {
Expand All @@ -57,7 +59,7 @@ describe(`Compare calling ${realLifeScenarios.length}x isPlainObject with mixed

bench('lodash-es: `_.isPlainObject(v)`', () => {
for (const value of realLifeScenarios) {
lodash.isPlainObject(value);
lodashIsPlainObject(value);
}
});

Expand Down
2 changes: 1 addition & 1 deletion packages/assert/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"type-fest": "4.26.1",
"typedoc": "0.26.7",
"typedoc-plugin-markdown": "4.2.7",
"typescript": "5.5.4",
"typescript": "5.6.2",
"valibot": "0.41.0",
"vite": "5.4.3",
"vite-tsconfig-paths": "5.0.1",
Expand Down
12 changes: 6 additions & 6 deletions packages/assert/src/uuid.asserts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {
UuidVersion,
} from './uuid.types';

const errMsg = (version?: UuidVersion | undefined) =>
const errMsg = (version?: UuidVersion) =>
[`uuid`, version === undefined ? undefined : `v${version}`]
.filter(Boolean)
.join(' ');
Expand All @@ -23,7 +23,7 @@ const errMsg = (version?: UuidVersion | undefined) =>
*/
export function assertUuid(
v: unknown,
msgOrErrorFactory?: MsgOrErrorFactory | undefined,
msgOrErrorFactory?: MsgOrErrorFactory,
options?: {
version?: UuidVersion;
}
Expand All @@ -43,7 +43,7 @@ export function assertUuid(
*/
export function assertUuidV1(
v: unknown,
msgOrErrorFactory?: MsgOrErrorFactory | undefined
msgOrErrorFactory?: MsgOrErrorFactory
): asserts v is UuidV1 {
assertUuid(v, msgOrErrorFactory, {
version: 1,
Expand All @@ -57,7 +57,7 @@ export function assertUuidV1(

export function assertUuidV3(
v: unknown,
msgOrErrorFactory?: MsgOrErrorFactory | undefined
msgOrErrorFactory?: MsgOrErrorFactory
): asserts v is UuidV3 {
assertUuid(v, msgOrErrorFactory, {
version: 3,
Expand All @@ -70,7 +70,7 @@ export function assertUuidV3(
*/
export function assertUuidV4(
v: unknown,
msgOrErrorFactory?: MsgOrErrorFactory | undefined
msgOrErrorFactory?: MsgOrErrorFactory
): asserts v is UuidV4 {
assertUuid(v, msgOrErrorFactory, {
version: 4,
Expand All @@ -83,7 +83,7 @@ export function assertUuidV4(
*/
export function assertUuidV5(
v: unknown,
msgOrErrorFactory?: MsgOrErrorFactory | undefined
msgOrErrorFactory?: MsgOrErrorFactory
): asserts v is UuidV5 {
assertUuid(v, msgOrErrorFactory, {
version: 5,
Expand Down
2 changes: 1 addition & 1 deletion packages/dsn-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"tsup": "8.2.4",
"typedoc": "0.26.7",
"typedoc-plugin-markdown": "4.2.7",
"typescript": "5.5.4",
"typescript": "5.6.2",
"vite": "5.4.3",
"vite-tsconfig-paths": "5.0.1",
"vitest": "2.0.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/dsn-parser/src/parse-dsn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const defaultOptions = {

export const parseDsn = (
dsn: unknown,
options?: ParseDsnOptions | undefined
options?: ParseDsnOptions
): ParserResult => {
if (!isNonEmptyString(dsn)) {
return createErrorResult(
Expand Down
2 changes: 1 addition & 1 deletion packages/exception/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
"tupleson": "0.23.1",
"typedoc": "0.26.7",
"typedoc-plugin-markdown": "4.2.7",
"typescript": "5.5.4",
"typescript": "5.6.2",
"vite": "5.4.3",
"vite-tsconfig-paths": "5.0.1",
"vitest": "2.0.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/exception/src/factory/createHttpException.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import type { HttpErrorStatusCodeOrNumber } from '../types/HttpErrorStatusCodeOr

export const createHttpException = <T extends HttpErrorStatusCodeOrNumber>(
statusCode: T,
msgOrParams?: HttpExceptionParamsFromStatus<T> | string | undefined
msgOrParams?: HttpExceptionParamsFromStatus<T> | string
): HttpExceptionFromStatus<T> => {
if (isHttpErrorStatusCode<AssignedErrorStatusCodes>(statusCode)) {
const cls = statusMap?.[statusCode];
Expand Down
2 changes: 1 addition & 1 deletion packages/json-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"tsup": "8.2.4",
"typedoc": "0.26.7",
"typedoc-plugin-markdown": "4.2.7",
"typescript": "5.5.4",
"typescript": "5.6.2",
"vite": "5.4.3",
"vite-tsconfig-paths": "5.0.1",
"vitest": "2.0.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/memo-intl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"tsup": "8.2.4",
"typedoc": "0.26.7",
"typedoc-plugin-markdown": "4.2.7",
"typescript": "5.5.4",
"typescript": "5.6.2",
"vite": "5.4.3",
"vite-tsconfig-paths": "5.0.1",
"vitest": "2.0.5",
Expand Down
6 changes: 4 additions & 2 deletions packages/plain-object/bench/comparative.bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ describe(`Compare calling isPlainObject with ${realLifeScenarios.length}x mixed
});
const is = await import('@sindresorhus/is').then((mod) => mod.default);
const isPlainObj = await import('is-plain-obj').then((mod) => mod.default);
const lodash = await import('lodash-es').then((mod) => mod.default);
const lodashIsPlainObject = await import('lodash-es').then(
(mod) => mod.isPlainObject
);
const esToolkitIsPlainObject = await import('es-toolkit').then(
(mod) => mod.isPlainObject
);
Expand Down Expand Up @@ -92,7 +94,7 @@ describe(`Compare calling isPlainObject with ${realLifeScenarios.length}x mixed

bench('lodash-es: `_.isPlainObject(v)`', () => {
for (const value of realLifeScenarios) {
lodash.isPlainObject(value);
lodashIsPlainObject(value);
}
});
});
2 changes: 1 addition & 1 deletion packages/plain-object/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"tsup": "8.2.4",
"typedoc": "0.26.7",
"typedoc-plugin-markdown": "4.2.7",
"typescript": "5.5.4",
"typescript": "5.6.2",
"vite": "5.4.3",
"vite-tsconfig-paths": "5.0.1",
"vitest": "2.0.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/plain-object/src/assert-plain-object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function assertPlainObject<
TValue extends BasePlainObject = DefaultBasePlainObject,
>(
v: unknown,
msgOrErrorFactory?: MsgOrErrorFactory | undefined
msgOrErrorFactory?: MsgOrErrorFactory
): asserts v is TValue extends DefaultBasePlainObject
? BasePlainObject
: PlainObject<TValue> {
Expand Down
2 changes: 1 addition & 1 deletion packages/treeu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"tsup": "8.2.4",
"typedoc": "0.26.7",
"typedoc-plugin-markdown": "4.2.7",
"typescript": "5.5.4",
"typescript": "5.6.2",
"vite": "5.4.3",
"vite-tsconfig-paths": "5.0.1",
"vitest": "2.0.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/treeu/src/search/dfs-tree-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class DfsTreeSearch<
| TKey
| NativeNodeSearchKeys
| ((treeNode: TreeNode<TValue, TKey>) => boolean),
params?: TreeSearchFindParams | undefined
params?: TreeSearchFindParams
// eslint-disable-next-line sonarjs/cognitive-complexity
): TreeNodeOptionalChildren<TValue, TKey> | undefined => {
const { includeChildren = false, reverse = false } = { ...params };
Expand Down
Loading

0 comments on commit 6bd5105

Please sign in to comment.