5.0.0-alpha.20 • Published 5 months ago

@based/schema v5.0.0-alpha.20

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

@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'
5.0.0-alpha.7

7 months ago

5.0.0-alpha.6

8 months ago

5.0.0-alpha.5

8 months ago

5.0.0-alpha.4

8 months ago

5.0.0-alpha.9

7 months ago

5.0.0-alpha.8

7 months ago

5.0.0-alpha.3

9 months ago

5.0.0-alpha.2

9 months ago

5.0.0-alpha.1

9 months ago

5.0.0-alpha.0

9 months ago

5.0.0-alpha.17

6 months ago

5.0.0-alpha.18

6 months ago

5.0.0-alpha.15

6 months ago

5.0.0-alpha.16

6 months ago

5.0.0-alpha.13

6 months ago

5.0.0-alpha.14

6 months ago

5.0.0-alpha.11

7 months ago

5.0.0-alpha.12

6 months ago

5.0.0-alpha.10

7 months ago

5.0.0-alpha.20

5 months ago

4.1.0

1 year ago

4.1.1

1 year ago

3.2.0

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.7.1

2 years ago

3.1.0

2 years ago

2.7.0

2 years ago

2.6.0

2 years ago

2.5.0

2 years ago

2.5.2

2 years ago

2.5.1

2 years ago

2.5.3

2 years ago

2.4.0

2 years ago

2.3.0

2 years ago

2.2.13

2 years ago

2.2.14

2 years ago

2.2.11

2 years ago

2.2.12

2 years ago

2.2.10

2 years ago

2.2.7

2 years ago

2.2.9

2 years ago

2.2.8

2 years ago

2.2.1

2 years ago

2.2.3

2 years ago

2.2.2

2 years ago

2.2.5

2 years ago

2.2.4

2 years ago

2.2.6

2 years ago

2.2.0

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.15

2 years ago

1.1.14

2 years ago

1.1.13

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago