How to use ancesdir - 1 common examples

To help you get started, we’ve selected a few ancesdir examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github somewhatabstract / checksync / src / parse-file.js View on Github external
export default function parseFile(
    options: Options,
    file: string,
    fixable: boolean,
    log: ILog,
): Promise {
    const rootPath = ancesdir(file, options.rootMarker);
    const fileRefLogger = new FileReferenceLogger(file, log);
    const markers: Markers = {};

    const addMarker = (
        id: string,
        checksum: string,
        targets: Targets,
        comment: string,
    ): void => {
        for (const line of Object.keys(targets)) {
            if (markers[id]) {
                fileRefLogger.error(
                    `Sync-tag '${id}' declared multiple times`,
                    line,
                );
            }

ancesdir

Find a specific ancestor/root directory given a starting location and a search parameter

MIT
Latest version published 8 months ago

Package Health Score

71 / 100
Full package analysis

Popular ancesdir functions