0.2.25 • Published 11 months ago

@assetval/name v0.2.25

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months 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

11 months ago

0.2.24

11 months ago

0.2.23

11 months ago

0.2.22

11 months ago

0.2.21

11 months ago

0.2.20

11 months ago

0.2.19

11 months ago

0.2.18

11 months ago

0.2.17

11 months ago

0.2.16

11 months ago

0.2.15

11 months ago

0.2.14

11 months ago

0.2.13

11 months ago

0.2.11

11 months ago

0.2.9

11 months ago

0.2.4

11 months ago

0.2.3

11 months ago

0.0.5

11 months ago

0.0.4

11 months ago

0.0.3

11 months ago

0.0.2

11 months ago

0.0.1

11 months ago