@lowlighter/markdown 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/renderer.ts CHANGED
@@ -109,10 +109,10 @@ export class Renderer {
109
109
  */
110
110
  static async with({ plugins = [], throw: throws = true }: { plugins: Array<Plugin | URL | string>; throw?: boolean }): Promise<Renderer> {
111
111
  plugins = plugins.map((plugin) => plugin instanceof URL ? plugin.href : plugin)
112
- const imported = await Promise.allSettled(plugins.map((plugin) => (typeof plugin === "string") ? import(plugin) : plugin))
112
+ const imported = await Promise.allSettled(plugins.map((plugin) => (typeof plugin === "string") ? import(plugin) : { default: plugin }))
113
113
  const resolved = imported
114
- .filter((result): result is PromiseFulfilledResult<Plugin> => result.status === "fulfilled")
115
- .map(({ value }) => value)
114
+ .filter((result): result is PromiseFulfilledResult<{ default: Plugin }> => result.status === "fulfilled")
115
+ .map(({ value }) => value.default)
116
116
  if (throws && (imported.some(({ status }) => status === "rejected"))) {
117
117
  const errors = imported
118
118
  .filter((result): result is PromiseRejectedResult => result.status === "rejected")