teoldalad/lib/constraints.ts
2024-03-13 00:30:45 +01:00

112 lines
No EOL
1.5 KiB
TypeScript

const constraints = {
username: {
min: 2,
max: 32,
},
password: {
min: 8,
max: 64,
},
email: {
min: 3,
max: 64,
},
};
const widgetConstraints = {
externalSite: {
title: {
min: 0,
max: 32,
},
url: {
min: 0,
max: 250,
},
},
instagramPost: {
url: {
min: 0,
max: 250,
},
},
markdown: {
content: {
min: 0,
max: 1000,
},
},
pinterestPin: {
url: {
min: 0,
max: 250,
},
},
soundCloudTrack: {
url: {
min: 0,
max: 250,
},
},
title: {
content: {
min: 0,
max: 32,
},
},
twitchLive: {
url: {
min: 0,
max: 250,
},
},
twitterPost: {
url: {
min: 0,
max: 250,
},
},
youTubeVideo: {
url: {
min: 0,
max: 250,
},
},
};
export const editorConstraints = {
...constraints,
...widgetConstraints,
displayName: {
min: 0,
max: 30,
},
description: {
min: 0,
max: 250,
},
location: {
min: 0,
max: 20,
},
school: {
min: 0,
max: 30,
},
workplace: {
min: 0,
max: 30,
},
widgets: {
count: 15,
},
socialLinks: {
count: 12,
},
socialTexts: {
count: 5,
},
};
export default constraints;