1.0.7 • Published 5 years ago

pixelplux-dk-common v1.0.7

Weekly downloads
4
License
ISC
Repository
github
Last release
5 years ago

dk-common

Internally we share some code between server, mobile application, and front-end apps. So we decided to put these codes here on this repository.

Installing

Depending on the location of repository, you might be able to install it using npm:

npm install pixelplux-dk-common --save

yachtValidator

Validates a yacht entity, and returns an object of errors if there will be some errors.

export function yachtValidator(yacht, translate)

example how to use:

import { yachtValidator } from 'pixelplux-dk-common';
yachtValidator({name: 'Sample boat'}, translate => translate);

Yacht information

boatTypes

You can get and Array of <label, value> of boat types that we support.

import { boatTypes, boatLengths } from 'pixelplux-dk-common'

example:

export const boatTypes = [
  {
    label: 'Sailboat',
    value: 'sailboat'
  },
  ...
];

Note: translate is a callback, which will be used to translate each field. It should accept a param for key, and return the translated value.

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago