Files
autodoc/tests/unit/helpers.js
T
Iisyourdad 2a602d7477 Add core domain layer: schema, store, sanitizer, placeholders, settings
- Folder-based GuideStore with atomic writes, trash/restore, duplicate,
  substep reparenting, folders/favorites, working-image crop/reset
- Allowlist HTML sanitizer applied on every store write
- Placeholder scopes (guide > global > system) and collection
- Persisted app settings with deep default merge
- 16 workflow tests exercising real on-disk round-trips

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 16:34:15 -05:00

23 lines
638 B
JavaScript

'use strict';
const fs = require('node:fs');
const os = require('node:os');
const path = require('node:path');
/** Create a unique temp directory, auto-registered for cleanup by caller. */
function makeTmpDir(label) {
return fs.mkdtempSync(path.join(os.tmpdir(), `stepforge-${label}-`));
}
function rmrf(dir) {
fs.rmSync(dir, { recursive: true, force: true });
}
// Minimal valid 1x1 red PNG, used where pixel content doesn't matter.
const TINY_PNG = Buffer.from(
'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==',
'base64'
);
module.exports = { makeTmpDir, rmrf, TINY_PNG };