normalizeGlob

import { normalizeGlob } from "jsr:@ende/path/posix/normalize-glob";

function

function normalizeGlob(glob: string, options: Pick<GlobOptions, "globstar"> = [UNSUPPORTED]): string

Like normalize(), but doesn't collapse "**/.." when globstar is true.

glob: string

The glob to normalize.

options: Pick<GlobOptions, "globstar"> = [UNSUPPORTED]

The options to use.

Returns

The normalized path.

Example: Usage

import { normalizeGlob } from "@ende/path/posix/normalize-glob";
import { assertEquals } from "@ende/assert";

const path = normalizeGlob("foo/bar/../*", { globstar: true });
assertEquals(path, "foo/*");

Source