ShtukbaseStandard
archivo del paquete→ .shtukbase/packages/code-functional-core/checks/lib.ts

checks/lib.ts

12 líneas, 873 B.

El archivo tal como está en el paquete: el código y sus comentarios no se traducen.

  1. // Shared part of the functional-core checks: which files are the core. The core is named in the package
  2. // settings, /norms/code/code-functional-core.md, field `core:` (globs or folders from the project root).
  3. // Nothing named — the checks have nothing to judge and say so once.
  4. import { matcher, type Settings, type Source } from '../../code-lib/checks/lib/scan.ts';
  5. export function coreOf(srcs: Source[], set: Settings): { core: Source[]; isCore: (rel: string) => boolean; named: boolean } {
  6. const globs = (Array.isArray(set.core) ? set.core : set.core ? [set.core] : []).map(String).filter(Boolean);
  7. const isCore = matcher(globs);
  8. return { core: srcs.filter((s) => isCore(s.rel)), isCore, named: globs.length > 0 };
  9. }
  10. export const NOT_NAMED = 'the core is not named: write the paths of the pure code in core: on the page /norms/code/code-functional-core.md';