UNPKG

@schemifyjs/core

Version:

Core module of the SchemifyJS CLI. Provides reusable functions such as scaffolding, template handling, and general utilities.

11 lines (10 loc) 332 B
export function validateName(value) { const regex = /^[a-z][a-z0-9\-]*$/; if (!value || typeof value !== 'string') { return 'Name is required and must be a string.'; } if (!regex.test(value)) { return 'Use only lowercase letters, numbers, and hyphens. Start with a letter.'; } return true; }