| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
|
||
| function resolveFileNameFromImport(importSource: string, fileName: string): string { | ||
| let stack = importSource.split(path.separator), | ||
| parts = fileName.split(path.separator); |
There was a problem hiding this comment.
Since you changed them elsewhere, I think these should be const.
Sorry, something went wrong.
| return null; | ||
| } | ||
|
|
||
| function resolveFileNameFromImport(importSource: string, fileName: string): string { |
There was a problem hiding this comment.
add comments to explain how this works and format it (missing ;, let -> const, declare every variable with separate statement, etc.)
Sorry, something went wrong.
| } | ||
|
|
||
| export function resolveFileNameFromUrl(url: string, appDirectory: string, fileExists: (string) => boolean): string; | ||
| export function resolveFileNameFromUrl(url: string, appDirectory: string, fileExists: (string) => boolean, importSource?: string): string; |
There was a problem hiding this comment.
why is this exported?
Sorry, something went wrong.
| private static uriToRelativePath(uri: string): string { | ||
| let appRelativeUri = uri; | ||
| if (appRelativeUri.startsWith("/")) { | ||
| var app = knownFolders.currentApp().path + "/"; |
There was a problem hiding this comment.
const
Sorry, something went wrong.
There was a problem hiding this comment.
Stays let - four lines below there is a new assignment of appRelativeUri. Changed var app to let app.
Sorry, something went wrong.
| for (let i = 0; i < imports.length; i++) { | ||
| const importItem = imports[i]["import"]; | ||
|
|
||
| const importItemSource = imports[i]["position"]["source"]; |
There was a problem hiding this comment.
check if imports[i]["position"] is not undefined before accessing ["source"]
Sorry, something went wrong.
| if (url !== null && url !== undefined) { | ||
| const cssFile = CSSSource.fromURI(url, this._keyframes); | ||
| const file = CSSSource.resolveCSSPathFromURL(url, importItemSource); | ||
| const cssFile = new CSSSource(undefined, url, file, this._keyframes, undefined); |
There was a problem hiding this comment.
use the static method fromFile
Sorry, something went wrong.
|
|
||
| if (url !== null && url !== undefined) { | ||
| const cssFile = CSSSource.fromURI(url, this._keyframes); | ||
| const file = CSSSource.resolveCSSPathFromURL(url, importItemSource); |
There was a problem hiding this comment.
what will happen if file is null?
Sorry, something went wrong.
| @@ -1409,50 +1409,72 @@ export function test_CascadingClassNamesAppliesAfterPageLoad() { | |||
| } | |||
|
|
|||
| export function test_resolveFileNameFromUrl_local_file_tilda() { | |||
There was a problem hiding this comment.
Add tests for resolveFileNameFromUrl with the new argument (importSource) as well.
Sorry, something went wrong.
|
|
||
| const appPath = knownFolders.currentApp().path; | ||
| if (!uri.startsWith(appPath)) { | ||
| traceWrite("${uri} does not start with ${appPath}", traceCategories.Error, traceMessageType.error); |
There was a problem hiding this comment.
Backticks (`) instead of quotes (")
Sorry, something went wrong.
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Implements #6021.