UNPKG

claude-code-company

Version:

Multi-agent tmux coordination system for Claude Code with perfect Unicode support

33 lines (29 loc) 898 B
function validateNotNull(param, paramName) { if (param === null || param === undefined) { throw new Error(`${paramName} is null or undefined`); } } function validateType(param, expectedType, paramName) { if (typeof param !== expectedType) { throw new Error(`${paramName} must be ${expectedType}, got ${typeof param}`); } } function validateNumber(param, min, max, paramName) { const num = parseInt(param); if (isNaN(num) || num < min || num > max) { throw new Error(`${paramName} must be a number between ${min} and ${max}`); } return num; } function validateString(param, paramName, allowEmpty = false) { validateType(param, 'string', paramName); if (!allowEmpty && param.trim().length === 0) { throw new Error(`${paramName} must be a non-empty string`); } } module.exports = { validateNotNull, validateType, validateNumber, validateString };