-
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into postcss-bundler--sinc…
…ere-bolognese-dog-7bd235cc5f
- Loading branch information
Showing
7 changed files
with
51 additions
and
9 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
/** | ||
* Returns a posix path for the directory of the given file path. | ||
* | ||
* @param {string} x The file path to normalize. | ||
* @returns {string} The normalized directory path. | ||
*/ | ||
export declare function normalizedDir(x: string): string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,9 @@ | ||
/** | ||
* Serialize a string as a quoted CSS string. | ||
* | ||
* @param {string} str The contents for the string value. | ||
* @returns {string} The quoted CSS string. | ||
* | ||
* @see https://www.w3.org/TR/cssom-1/#common-serializing-idioms | ||
*/ | ||
export declare function serializeString(str: string): string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,18 @@ | ||
import path from 'path'; | ||
|
||
/** | ||
* Returns a posix path for the directory of the given file path. | ||
* | ||
* @param {string} x The file path to normalize. | ||
* @returns {string} The normalized directory path. | ||
*/ | ||
export function normalizedDir(x: string): string { | ||
return path.parse(path.resolve(x.trim())).dir.split(path.sep).join(path.posix.sep); | ||
// Resolve the path to eliminate any relative path components. | ||
const dir = path.parse(path.resolve(x.trim())).dir; | ||
// Split the path by the native path separator | ||
const dirPathComponents = dir.split(path.sep); | ||
// Join the path components with the posix path separator | ||
const posixDir = dirPathComponents.join(path.posix.sep); | ||
|
||
return posixDir; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters