extra-data-types
v4.0.0
Published
some frequently used ts data types
Maintainers
Readme
extra-data-types
Introduction
A simple lib, gather some useful data types of TS.
Use example
- type example
import type { EmailSchema } from "extra-data-types";
const exampleEmail: EmailSchema.StandardEmail_Type = "[email protected]";
const exampleGmail: EmailSchema.Gmail_Type = "[email protected]";- function example
import { is_StandardEmail_Type, is_Gmail_Type } from "extra-data-types";
if (is_StandardEmail_Type("[email protected]")) {
//do something when is valid of standard email type
} else {
//...
}
if (is_StandardEmail_Type("[email protected]")) {
//do something when is valid of gmail type
} else {
//...
}Currently Support
Email:
| Email Schema | Type_Name | Function | :white_check_mark: | :x: | | ------------- | ------------------ | --------------------- | ------------------ | ----------- | | StandardEmail | StandardEmail_Type | is_StandardEmail_Type | [email protected] | abc | | QQMail | QQmail_Type | is_QQmail_Type | [email protected] | [email protected] | | Gmail | Gmail_Type | is_Gmail_Type | [email protected] | [email protected] |
Date:
| Date Schema | Type_Name | Function | :white_check_mark: | :x: | | ----------- | -------------- | ----------------- | ------------------ | --------------- | | YYYY-MM-DD | YYYYMMDD_Type | is_YYYYMMDD_Type | 1970-01-01 | 19700101 | | YYYY-MMM-DD | YYYYMMMDD_Type | is_YYYYMMMDD_Type | 1970-JAN-01 | 1970-JANUARY-01 |
Testing
please use node version v16.18.0
Clone the repository and execute:
- npm install
- npm run build-pr
- npm run test
Contributing
Any type of contribution is welcome :)
- Submit issues to report bugs or ask questions.
- Propose pull requests to improve our code.
Code Contributors
- @chen1415
- @Leon-wyl
- @IAmJerryJ
