Skip to main content
Module

x/enzastdlib/path/mod.ts>isSubPath

enzastdlib is a set of TypeScript modules that follow a common design API philosophy aiming at sane defaults and ease-of-use targeting the Deno TypeScript runtime.
Latest
function isSubPath
import { isSubPath } from "https://deno.land/x/enzastdlib@v0.0.4/path/mod.ts";

Returns if the child path is nested within the parent path.

Examples

Example 1

import { assertEquals } from 'https://deno.land/std/testing/asserts.ts';
import { isSubPath } from 'https://deno.land/x/enzastdlib/path/mod.ts';

assertEquals(
    isSubPath('/home/novacbn', '/home/novacbn/Pictures'),
    true
);

Parameters

parent: string
child: string

Returns

boolean