@schemifyjs/core
Version:
Core module of the SchemifyJS CLI. Provides reusable functions such as scaffolding, template handling, and general utilities.
11 lines (10 loc) • 362 B
JavaScript
import fs from 'fs';
import path from 'path';
export class ArtifactAlreadyExistsValidator {
static validate(name, type, basePath) {
const artifactPath = path.join(basePath, type, name);
if (fs.existsSync(artifactPath)) {
throw new Error(`Artifact "${name}" of type "${type}" already exists at ${artifactPath}`);
}
}
}