-
-
Notifications
You must be signed in to change notification settings - Fork 604
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into compare-docs
- Loading branch information
Showing
16 changed files
with
926 additions
and
28 deletions.
There are no files selected for viewing
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
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 @@ | ||
19.0.0 | ||
19.1.0 |
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import fs from 'node:fs/promises'; | ||
import { join, resolve } from 'node:path'; | ||
|
||
export async function getBaseline(id, compareOptions) { | ||
try { | ||
return JSON.parse( | ||
await fs.readFile( | ||
resolve( | ||
join(compareOptions.baselinePath || process.cwd(), `${id}.json`) | ||
) | ||
) | ||
); | ||
} catch { | ||
return; | ||
} | ||
} | ||
/* | ||
async function getBaselineFromInternet(url) { | ||
try { | ||
const response = await fetch(url); | ||
return response.json(); | ||
} catch (error) { | ||
log.error('Could not fetch', error); | ||
} | ||
} | ||
async function getBaselineFromFile(path) {} | ||
/* | ||
export async function saveBaseline(json, options) { | ||
}*/ | ||
export async function saveBaseline(json, name) { | ||
return fs.writeFile(resolve(name), JSON.stringify(json)); | ||
} |
Oops, something went wrong.