From 6d54d12420ee8badaa4cb2a3492af4cba214eb95 Mon Sep 17 00:00:00 2001 From: sinclairzx81 Date: Sat, 21 Dec 2024 03:40:45 +0900 Subject: [PATCH] Revision 0.34.13 (#1124) * Fix: Convert Symbol Check for TypeScript 5.8.0 * Version * ChangeLog --- changelog/0.34.0.md | 2 ++ package-lock.json | 4 ++-- package.json | 2 +- src/value/convert/convert.ts | 7 +------ 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/changelog/0.34.0.md b/changelog/0.34.0.md index 4f7a9f48..3c68b589 100644 --- a/changelog/0.34.0.md +++ b/changelog/0.34.0.md @@ -1,4 +1,6 @@ ### 0.34.0 +- [Revision 0.34.13](https://github.com/sinclairzx81/typebox/pull/1124) + - Pre emptive fix for TypeScript 5.8.0-nightly to resolve symbol narrowing on Convert. - [Revision 0.34.12](https://github.com/sinclairzx81/typebox/pull/1120) - [1119](https://github.com/sinclairzx81/typebox/issues/1119) Fix for Mutate Object Comparison - [1117](https://github.com/sinclairzx81/typebox/issues/1117) Re-Add Type.Recursive Documentation diff --git a/package-lock.json b/package-lock.json index 42b48a00..82a40a27 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@sinclair/typebox", - "version": "0.34.12", + "version": "0.34.13", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@sinclair/typebox", - "version": "0.34.12", + "version": "0.34.13", "license": "MIT", "devDependencies": { "@arethetypeswrong/cli": "^0.13.2", diff --git a/package.json b/package.json index 1bac1b69..e4078594 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sinclair/typebox", - "version": "0.34.12", + "version": "0.34.13", "description": "Json Schema Type Builder with Static Type Resolution for TypeScript", "keywords": [ "typescript", diff --git a/src/value/convert/convert.ts b/src/value/convert/convert.ts index 1cfaa108..9461bd7d 100644 --- a/src/value/convert/convert.ts +++ b/src/value/convert/convert.ts @@ -57,11 +57,6 @@ import type { TUndefined } from '../../type/undefined/index' // ------------------------------------------------------------------ import { IsArray, IsObject, IsDate, IsUndefined, IsString, IsNumber, IsBoolean, IsBigInt, IsSymbol, HasPropertyKey } from '../guard/index' -// ------------------------------------------------------------------ -// TypeGuard -// ------------------------------------------------------------------ -import { IsOptional } from '../../type/guard/kind' - // ------------------------------------------------------------------ // Conversions // ------------------------------------------------------------------ @@ -124,7 +119,7 @@ function TryConvertBigInt(value: unknown) { return IsStringNumeric(value) ? BigInt(truncateInteger(value)) : IsNumber(value) ? BigInt(Math.trunc(value)) : IsValueFalse(value) ? BigInt(0) : IsValueTrue(value) ? BigInt(1) : value } function TryConvertString(value: unknown) { - return IsValueToString(value) ? value.toString() : IsSymbol(value) && value.description !== undefined ? value.description.toString() : value + return IsSymbol(value) && value.description !== undefined ? value.description.toString() : IsValueToString(value) ? value.toString() : value } function TryConvertNumber(value: unknown) { return IsStringNumeric(value) ? parseFloat(value) : IsValueTrue(value) ? 1 : IsValueFalse(value) ? 0 : value