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 - v4.2.2

Published by samchon about 1 year ago

What's Changed

Full Changelog: https://github.com/samchon/typia/compare/v4.2.1...v4.2.2

typia - v4.2.1

Published by samchon about 1 year ago

When typia.stringify<T>() be used for an object type which has template typed key containing a number type, and exponential log being used in the template key type, typia could not write the property because regex pattern for numeric value of typia had not supported the exponential log value.

This is an extremely rare case, but fixed for extensionality.

export interface ISomething {
    [key: `value_${number}`]: boolean | string | number;
}

const something: ISomething = {
    "5.175933557310941e-7": -0.170261004873707,
};
typia.stringify(something);

What's Changed

Full Changelog: https://github.com/samchon/typia/compare/v4.2.0...v4.2.1

typia - v4.2.0

Published by samchon about 1 year ago

Thanks to @enyineer for reporting.

  • Changed setup wizard
  • Introduce not to support yarn berry
  • Use npm run postinstall command instead

Unfortunately, ts-patch does not support yarn berry. Therefore, it is not possible to use transform mode of typia in the yarn berry. Therefore, to inform it and recommend not to use yarn berry in typia, I've changed setup wizard program. This change would be rolled back when ts-patch starts supporting the yarn berry.

Also, yarn berry does not support the npm run prepare command. I think this nonsensible story because the npm run prepare command is a standard feature of NPM, but this is the reality, so I can't help it. By the way, if ts-patch starts supporting yarn berry, configuring npm run prepare command by setup wizard can be a big problem. So, I've changed setup wizard to use npm run postinstall command instead of the previous npm run prepare command.

What's Changed

New Contributors

Full Changelog: https://github.com/samchon/typia/compare/v4.1.16...v4.2.0

typia - v4.1.16

Published by samchon about 1 year ago

https://dev.to/samchon/good-bye-typescript-is-ancestor-of-typia-20000x-faster-validator-49fi

typia had started from a helper library of fast-json-stringify. At that time, package name was typescript-json, and slogan was convenient JSON serialization boosting without JSON schema definition, but with pure TypeScript type. In such reason, typia still has same logic with fast-json-stringify about string type's JSON serialization.

In today, fast-json-stringify has changed their string type logic, and developer of fast-json-stringify informed me the update. I've measured benchmark with him, and could understand that the new logic is efficient than before. Therefore, updated typia to follow the fast-json-stringify.

Special thanks for fast-json-stringify developer @Uzlopak

v4.1.15 is a mis-published version. Do not use it please.

What's Changed

Full Changelog: https://github.com/samchon/typia/compare/v4.1.14...v4.1.16

typia - v4.1.14

Published by samchon about 1 year ago

What's Changed

Full Changelog: https://github.com/samchon/typia/compare/v4.1.13...v4.1.14

typia - v4.1.13

Published by samchon about 1 year ago

What's Changed

Full Changelog: https://github.com/samchon/typia/compare/v1.4.12...v4.1.13

typia - v1.4.12

Published by samchon about 1 year ago

What's Changed

Full Changelog: https://github.com/samchon/typia/compare/v1.4.11...v1.4.12

typia - v1.4.11

Published by samchon about 1 year ago

What's Changed

Full Changelog: https://github.com/samchon/typia/compare/v4.1.8...v1.4.11

typia - v4.1.8

Published by samchon about 1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/samchon/typia/compare/v4.1.7...v4.1.8

typia - v4.1.7

Published by samchon over 1 year ago

What's Changed

Full Changelog: https://github.com/samchon/typia/compare/v4.1.6...v4.1.7

typia - v4.1.6

Published by samchon over 1 year ago

What's Changed

Full Changelog: https://github.com/samchon/typia/compare/v4.1.5...v4.1.6

typia - v4.1.5

Published by samchon over 1 year ago

What's Changed

Full Changelog: https://github.com/samchon/typia/compare/v4.1.4...v4.1.5

typia - v4.1.4

Published by samchon over 1 year ago

What's Changed

Full Changelog: https://github.com/samchon/typia/compare/v4.1.3...v4.1.4

typia - v4.1.3

Published by samchon over 1 year ago

What's Changed

Full Changelog: https://github.com/samchon/typia/compare/v4.1.2...v4.1.3

typia - v4.1.2

Published by samchon over 1 year ago

Started supporting repeated intersection type like below:

export type ISetupConfig =
  | ({
      type: 'Main';
    } & ISetupConfigMain)
  | ({
      type: 'Before';
    } & ISetupConfigBefore)
  | ({
      type: 'After';
    } & ISetupConfigAfter);

export type ISetupConfigMain = {
  content: ISetupConfig;
};

export type ISetupConfigBefore = {
  content: ISetupConfig;
};

export type ISetupConfigAfter = {
  content: ISetupConfig;
};

What's Changed

New Contributors

Full Changelog: https://github.com/samchon/typia/compare/v4.1.1...v4.1.2

typia - v4.1.1

Published by samchon over 1 year ago

image

https://[typia.io/playground](https://typia.io/playground)

From now on, you can easily enjoy typia just in website.

Let's test how typia compiles validation code in the playground website.

Special thanks to @GoogleFeud for hint about that.

What's Changed

New Contributors

Full Changelog: https://github.com/samchon/typia/compare/v4.1.0...v4.1.1

typia - v4.1.0

Published by samchon over 1 year ago

Enhance JSON schema generator, especially about AJV mode.

Also, @webNeat enhanced validate() function a little bit faster.

What's Changed

New Contributors

Full Changelog: https://github.com/samchon/typia/compare/v4.0.6...v4.1.0

typia - v4.0.6

Published by samchon over 1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/samchon/typia/compare/v4.0.5...v4.0.6

typia - v4.0.5

Published by samchon over 1 year ago

What's Changed

Full Changelog: https://github.com/samchon/typia/compare/v4.0.3...v4.0.5

typia - v4.0.3

Published by samchon over 1 year ago

Major update due to break changes on API, and 3rd party libraries like nestia being affected.

In prisma case, its JsonValue contains infinite repeated Array type like below.

If only infinite repeated array type comes, it is not allowed in TypeScript. However, if infinite repeated array type is capsuled in an union type like below JsonValue case, TypeScript allows it. I hadn't known such spec, and none of other validator libraries had supported it, either.

However, as prisma is using such type, I've tried typia to support such special type. And today, I've succeeded to fully implement it, with new 300K line of codes. The implementation difficulty of it was terribly high, but I'm glad I succeeded in implementing it in the end.

export type JsonValue =
    | string
    | number
    | boolean
    | JsonObject
    | JsonArray
    | null;
export interface JsonObject {
    [key: string]: JsonValue | undefined;
}
export type JsonArray = Array<JsonValue>;

Furthermore, typia supports extreme union type of infinite repeated union array type. Below ArrayRepeatedUnionWithTuple type is one of such extreme type used for automated testing program of typia. From now on, I can say again that, "typia" supports every TypeScript type".

export type ArrayRepeatedUnionWithTuple =
    | boolean
    | number
    | string[]
    | ArrayRepeatedUnionWithTuple[]
    | ArrayRepeatedUnionWithTuple.IBox3D[]
    | [string, number, boolean]
    | [
          ArrayRepeatedUnionWithTuple.IBox3D,
          ArrayRepeatedUnionWithTuple.IPoint3D,
      ];
export namespace ArrayRepeatedUnionWithTuple {
    export interface IBox3D {
        scale: IPoint3D;
        position: IPoint3D;
        rotate: IPoint3D;
        pivot: IPoint3D;
    }
    export interface IPoint3D {
        x: number;
        y: number;
        z: number;
    }
}

What's Changed

New Contributors

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

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