pixelplux-dk-common
v1.0.7
Published
Internally we share some code between server, mobile application, and front-end apps. So we decided to put these codes here on this repository.
Downloads
3
Readme
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.