2a602d7477
- 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>
23 lines
638 B
JavaScript
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 };
|