Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

std/path/_common/to_file_url.ts

Deno standard library
Go to Latest
File
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.// This module is browser compatible.
const WHITESPACE_ENCODINGS: Record<string, string> = { "\u0009": "%09", "\u000A": "%0A", "\u000B": "%0B", "\u000C": "%0C", "\u000D": "%0D", "\u0020": "%20",};
export function encodeWhitespace(string: string): string { return string.replaceAll(/[\s]/g, (c) => { return WHITESPACE_ENCODINGS[c] ?? c; });}