19 lines
509 B
TypeScript
19 lines
509 B
TypeScript
export type DirectorScript = {
|
|
id: string
|
|
name: string
|
|
text: string
|
|
createdAt: number
|
|
updatedAt: number
|
|
}
|
|
|
|
export const DIRECTOR_SCRIPT_NAME_MAX = 80
|
|
export const DIRECTOR_SCRIPT_TEXT_MAX = 200_000
|
|
|
|
export function normalizeDirectorScriptName(raw: unknown) {
|
|
return String(raw || '').trim().replace(/\s+/g, ' ').slice(0, DIRECTOR_SCRIPT_NAME_MAX)
|
|
}
|
|
|
|
export function normalizeDirectorScriptText(raw: unknown) {
|
|
return String(raw || '').replace(/\r\n/g, '\n').slice(0, DIRECTOR_SCRIPT_TEXT_MAX)
|
|
}
|