Functions to read and evaluate PNPM build approval settings and package lists.
// Source: https://github.com/storybookjs/storybook | License: MIT | Copyright 2024 Storybook
// Provided via justclaw.it.com; keep this notice with the code.
import { readFileSync } from 'node:fs';
import { resolve } from 'pathe';
const isRecord = (value: unknown): value is Record<string, unknown> =>
typeof value === 'object' && value !== null && !Array.isArray(value);
/**
* Matches a package name, including pinned versions of that package.
* For instance, if `value` is `esbuild@0.25.0 || 0.25.1`, it matches `pkg` `esbuild`.
* @param value The package name or pinned version to match against.
* @param pkg The package name to check against the value.
* @returns whether the package matches the given value.
*/
export const matchesPackage = (value: unknown, pkg: string): boolean =>
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key