-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(config): update workspace configuration
- Loading branch information
1 parent
2318fee
commit 2b4c47f
Showing
5 changed files
with
399 additions
and
388 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,26 @@ | ||
const dnbConfig = require('@davidsneighbour/frontmatter-config'); | ||
const dnbConfig = require("@davidsneighbour/frontmatter-config"); | ||
|
||
module.exports = async function (config) { | ||
let resolvedDnbConfig; | ||
|
||
try { | ||
resolvedDnbConfig = await (typeof dnbConfig === "function" | ||
? dnbConfig() | ||
: dnbConfig); | ||
} catch (error) { | ||
throw new Error(`Failed to load dnbConfig: ${error.message}`); | ||
} | ||
|
||
if (typeof resolvedDnbConfig !== "object") { | ||
throw new Error("dnbConfig must resolve to an object."); | ||
} | ||
|
||
if (typeof config !== "object") { | ||
throw new Error("The provided config must be an object."); | ||
} | ||
|
||
return { | ||
...dnbConfig, | ||
...resolvedDnbConfig, | ||
...config, | ||
}; | ||
}; |
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 |
---|---|---|
|
@@ -23,3 +23,5 @@ Boxicons | |
Iconoir | ||
MIT License | ||
Lineicons | ||
SASS | ||
YouTube |
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
Oops, something went wrong.