Skip to content

Commit

Permalink
Revision 0.34.13 (#1124)
Browse files Browse the repository at this point in the history
* Fix: Convert Symbol Check for TypeScript 5.8.0

* Version

* ChangeLog
  • Loading branch information
sinclairzx81 authored Dec 20, 2024
1 parent 598c1d3 commit 6d54d12
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
2 changes: 2 additions & 0 deletions changelog/0.34.0.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
7 changes: 1 addition & 6 deletions src/value/convert/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
// ------------------------------------------------------------------
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6d54d12

Please sign in to comment.