mirror of
https://github.com/SukkaW/Surge.git
synced 2026-02-02 20:11:54 +08:00
Chore: some minor changes
This commit is contained in:
@@ -9,6 +9,7 @@ import type { TreeType, TreeTypeArray } from './lib/tree-dir';
|
||||
import { OUTPUT_MOCK_DIR, OUTPUT_MODULES_DIR, PUBLIC_DIR, ROOT_DIR } from './constants/dir';
|
||||
import { fastStringCompare, mkdirp, writeFile } from './lib/misc';
|
||||
import picocolors from 'picocolors';
|
||||
import { tagged as html } from 'foxts/tagged';
|
||||
import { compareAndWriteFile } from './lib/create-file';
|
||||
|
||||
const mockDir = path.join(ROOT_DIR, 'Mock');
|
||||
@@ -94,8 +95,6 @@ const priorityOrder: Record<'default' | string & {}, number> = {
|
||||
};
|
||||
const prioritySorter = (a: TreeType, b: TreeType) => ((priorityOrder[a.name] || priorityOrder.default) - (priorityOrder[b.name] || priorityOrder.default)) || fastStringCompare(a.name, b.name);
|
||||
|
||||
const html = (string: TemplateStringsArray, ...values: any[]) => string.reduce((acc, str, i) => acc + str + (values[i] ?? ''), '');
|
||||
|
||||
function walk(tree: TreeTypeArray) {
|
||||
let result = '';
|
||||
tree.sort(prioritySorter);
|
||||
|
||||
Reference in New Issue
Block a user