0.2.25 • Published 1 year ago

@assetval/name v0.2.25

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Name

This is the Veritas Name Schema workspace.

Installation

yarn add @assetval/name

Usage

As a Class (Front End)

import { Name } from '@assetval/name';

const name = new Name({
  first: 'John',
  last: 'Doe',
  middle: 'A',
  preferred: 'Johnny'
});

As Schema (Back End)

import { NameSchema, Name } from '@assetval/name';
import { model } from 'mongoose';

export const NameModel = model<Name>('names', NameSchema);

As Validation (Back End)

import { nameSchemaValidation } from '@assetval/name';
import { z } from 'zod';
import { MagikRoutes } from '../middleware/RouterManager.js';

const ProfileRoute = MagikRoutes.getRouter('/profile');

ProfileRoute.post('/updateName', {
  auth: 'ensureAuthenticated',
  validationSchema: z.object({
    body: nameSchemaValidation
  }),
  route: async (req, res): Promise<void> => {
    // Do something
  }
});

License

MIT

Authors

Contributing

Download the Schema repository and make sure you have the following installed:

  • asdf
  • NodeJS (ASDF)
  • Yarn (Corepack / Node / ASDF)
  • moonrepo
  • git-chglog (ASDF)

Then run the following commands:

yarn install
0.2.25

1 year ago

0.2.24

1 year ago

0.2.23

1 year ago

0.2.22

1 year ago

0.2.21

1 year ago

0.2.20

1 year ago

0.2.19

1 year ago

0.2.18

1 year ago

0.2.17

1 year ago

0.2.16

1 year ago

0.2.15

1 year ago

0.2.14

1 year ago

0.2.13

1 year ago

0.2.11

1 year ago

0.2.9

1 year ago

0.2.4

1 year ago

0.2.3

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago