typia

Super-fast/easy runtime validations and serializations through transformation

MIT License

Downloads
429.9K
Stars
4.4K
Committers
87

Bot releases are hidden (Show)

typia - v3.8.9

Published by samchon over 1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/samchon/typia/compare/v3.8.6...v3.8.9

typia - v3.8.6

Published by samchon over 1 year ago

What's Changed

Full Changelog: https://github.com/samchon/typia/compare/v3.8.5...v3.8.6

typia - v3.8.5

Published by samchon over 1 year ago

There are some fucking documentation libraries enforcing user to write invalid @type tagged comments like below, even in TypeScript.

In such reason, typia stops throwing compilation error when invalid @type tag comes.

Of course, validation and random generation logic would not be affected by the invalid @type tag.

What's Changed

Full Changelog: https://github.com/samchon/typia/compare/v3.8.4...v3.8.5

typia - v3.8.4

Published by samchon over 1 year ago

What's Changed

Full Changelog: https://github.com/samchon/typia/compare/v3.8.3...v3.8.4

typia - v3.8.3

Published by samchon over 1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/samchon/typia/compare/v3.8.2...v3.8.3

typia - v3.8.2

Published by samchon over 1 year ago

What's Changed

Full Changelog: https://github.com/samchon/typia/compare/v3.8.1...v3.8.2

typia - v3.8.1

Published by samchon over 1 year ago

From now on, typia abandons ttypescript and utilizes ts-patch only.

It's the reason why ttypescript has stopped maintaining, but ts-patch is on going.

Thanks for keeping such wonderful library ts-patch @nonara.

What's Changed

Full Changelog: https://github.com/samchon/typia/compare/v3.7.6...v3.8.1

typia - v3.7.6

Published by samchon over 1 year ago

I've published Guide Documents on https://typia.io/docs/ domain.

Also, @LorenzHenk had fixed npx typia generate command on ESM environments. Thanks for contribution.

What's Changed

New Contributors

Full Changelog: https://github.com/samchon/typia/compare/v3.7.4...v3.7.6

typia - v3.7.4

Published by samchon over 1 year ago

What's Changed

Full Changelog: https://github.com/samchon/typia/compare/v3.7.3...v3.7.4

typia - v3.7.3

Published by samchon over 1 year ago

From now on, assert() and validate() functions are superfast like is() function.

What's Changed

Full Changelog: https://github.com/samchon/typia/compare/v3.7.2...v3.7.3

typia - v3.7.2

Published by samchon over 1 year ago

New function typia.literals():

export function literals<T extends Atomic.Type>(): T[];

literals<"A" | 2 | false>(); // ["A", 2, false] as const

What's Changed

Full Changelog: https://github.com/samchon/typia/compare/v3.7.1...v3.7.2

typia - v3.7.1

Published by samchon over 1 year ago

From now on, customization of random data generation is possible:

import typia from "typia";

export interface TagCustom {
    /**
     * Regular feature supported by typia
     *
     * @format uuid
     */
    id: string;

    /**
     * Custom feature composed with "$" + number
     *
     * @dollar
     */
    dollar: string;

    /**
     * Custom feature composed with string + "abcd"
     *
     * @postfix abcd
     */
    postfix: string;

    /**
     * Custom feature meaning x^y
     *
     * @powerOf 10
     */
    log: number;
}

const data: TagCustom = typia.random<TagCustom>({
    customs: {
        string: (tags: typia.IRandomGenerator.ICommentTag[]) => {
            if (tags.find((t) => t.name === "dollar") !== undefined)
                return "$" + RandomGenerator.integer();

            const postfix = tags.find((t) => t.name === "postfix");
            if (postfix !== undefined)
                return RandomGenerator.string() + postfix.value;
        },
        number: (tags: typia.IRandomGenerator.ICommentTag[]) => {
            const powerOf = tags.find((t) => t.name === "powerOf");
            if (powerOf !== undefined)
                return Math.pow(
                    Number(powerOf.value),
                    RandomGenerator.integer(1, 4),
                );
        },
    }
});

What's Changed

Full Changelog: https://github.com/samchon/typia/compare/v3.7.0...v3.7.1

typia - v3.7.0

Published by samchon over 1 year ago

From now on, you can add custom validation function utilizing comment tags like below:

typia.customValidators.insert("powerOf")("number")(
    (text: string) => {
        const denominator: number = Math.log(Number(text));
        return (value: number) => {
            value = Math.log(value) / denominator;
            return value === Math.floor(value);
        };
    }
);
typia.customValidators.insert("dollar")("string")(
    () => (value: string) => value.startsWith("$"),
);

interface TagCustom {
   /**
    * @powerOf 10
    */
   powerOf: number;

   /**
    * @dollar
    */
   dollar: string;
}

What's Changed

Full Changelog: https://github.com/samchon/typia/compare/v3.6.9...v3.7.0

typia - v3.6.9

Published by samchon over 1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/samchon/typia/compare/v3.6.8...v3.6.9

typia - v3.6.8

Published by samchon over 1 year ago

What's Changed

Full Changelog: https://github.com/samchon/typia/compare/v3.6.7...v3.6.8

typia - v3.6.7

Published by samchon over 1 year ago

What's Changed

Full Changelog: https://github.com/samchon/typia/compare/v3.6.6...v3.6.7

typia - v3.6.6

Published by samchon over 1 year ago

What's Changed

Full Changelog: https://github.com/samchon/typia/compare/v3.6.4...v3.6.6

typia - v3.6.4

Published by samchon over 1 year ago

What's Changed

Full Changelog: https://github.com/samchon/typia/compare/v3.6.3...v3.6.4

typia - v3.6.3

Published by samchon over 1 year ago

What's Changed

Full Changelog: https://github.com/samchon/typia/compare/v3.6.2...v3.6.3

typia - v3.6.2

Published by samchon over 1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/samchon/typia/compare/v3.6.1...v3.6.2

Package Rankings
Top 1.44% on Npmjs.org
Badges
Extracted from project README
GitHub license npm version Downloads Build Status Guide Documents Sponsers