Open ofekisr opened 1 year ago
from the README
import { Assign } from 'utility-types'; type Props = { name: string; age: number; visible: boolean }; type NewProps = { age: string; other: string }; // Expect: { name: string; age: string; visible: boolean; other: string; } type ExtendedProps = Assign<Props, NewProps>;
age type value in expect is string
from src/mapped-types.ts
/** * Assign * @desc From `U` assign properties to `T` (just like object assign) * @example * type Props = { name: string; age: number; visible: boolean }; * type NewProps = { age: string; other: string }; * * // Expect: { name: string; age: number; visible: boolean; other: string; } * type ExtendedProps = Assign<Props, NewProps>; */
age type value in expect is number
Good catch, thanks for reporting.
Description
from the README
age type value in expect is string
from src/mapped-types.ts
age type value in expect is number
Steps to Reproduce