@based/schema v5.0.0-alpha.20
@based/schema
Display & format WIP
Using display will not validate or transform and will purely change how the value is shown in UI and API.
Use format to specify in which format the value has to represented and modified. This may impose some validation and will influence how the UI shows the value.
For example
{
    types: {
        article: {
            props: {
                price: {
                    type: 'int32',
                    display: 'euro',
                },
                authorEmail: {
                    type: 'string',
                    format: 'email',
                    display: 'lowercase',
                },
                lastModified: {
                    type: 'timestamp',
                    display: 'date-time'
                }
            }
        }
    }
}Display options
Timestamp
'date',
'date-time',
'date-time-text',
'human',
'time',
'time-precise',Number
'short',
'human',
'ratio',
'bytes',
'euro',
'dollar',
'pound',
'round-short',
'round-human',
'round-ratio',
'round-bytes',
'round-euro',
'round-dollar',
'round-pound',String
'lowercase',
'uppercase',
'capitalize',Format options
String
'email',
'URL',
'MACAddress',
'IP',
'IPRange',
'FQDN',
'IBAN',
'BIC',
'alpha',
'alphaLocales',
'alphanumeric',
'alphanumericLocales',
'passportNumber',
'port',
'lowercase',
'uppercase',
'ascii',
'semVer',
'surrogatePair',
'IMEI',
'hexadecimal',
'octal',
'hexColor',
'rgbColor',
'HSL',
'ISRC',
'MD5',
'JWT',
'UUID',
'luhnNumber',
'creditCard',
'identityCard',
'EAN',
'ISIN',
'ISBN',
'ISSN',
'mobilePhone',
'mobilePhoneLocales',
'postalCode',
'postalCodeLocales',
'ethereumAddress',
'currency',
'btcAddress',
'ISO6391',
'ISO8601',
'RFC3339',
'ISO31661Alpha2',
'ISO31661Alpha3',
'ISO4217',
'base32',
'base58',
'base64',
'dataURI',
'magnetURI',
'mimeType',
'latLong',
'slug',
'strongPassword',
'taxID',
'licensePlate',
'VAT',
'code',
'typescript',
'javascript',
'python',
'rust',
'css',
'html',
'json',
'markdown',
'clike'7 months ago
8 months ago
8 months ago
8 months ago
7 months ago
7 months ago
9 months ago
9 months ago
9 months ago
9 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
7 months ago
6 months ago
7 months ago
5 months ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago