import { extname } from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/path.js";
Returns the extension of the path
with leading period.
Examples
Example 1
Example 1
import { extname } from "@ayonli/jsext/path";
console.log(extname("/foo/bar.txt")); // ".txt"
console.log(extname("c:\\foo\\bar.txt")); // ".txt"
console.log(extname("file:///foo/bar.txt")); // ".txt"
console.log(extname("http://example.com/foo/bar.txt")); // ".txt"
console.log(extname("http://example.com/foo/bar.txt?foo=bar#baz")); // ".txt"