Socket
Socket
Sign inDemoInstall

@mdx-js/loader

Package Overview
Dependencies
Maintainers
4
Versions
216
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mdx-js/loader - npm Package Compare versions

Comparing version 2.1.3 to 2.1.4

7

index.d.ts
import type {ProcessorOptions} from '@mdx-js/mdx/lib/core.js'
import type {LoaderContext} from 'webpack'
type LoaderContext = import('webpack').LoaderContext<unknown>
/**

@@ -10,3 +9,3 @@ * A Webpack loader to compile MDX to JavaScript.

*
* @this {LoaderContext}
* @this {LoaderContext<unknown>}
* @param {string} value

@@ -16,3 +15,3 @@ * The original module source code.

*/
declare function mdxLoader(this: LoaderContext, value: string): void
declare function mdxLoader(this: LoaderContext<unknown>, value: string): void

@@ -19,0 +18,0 @@ export default mdxLoader

@@ -13,2 +13,3 @@ /**

export type VFile = import('vfile').VFile;
export type VFileMessage = import('vfile-message').VFileMessage;
export type CompileOptions = import('@mdx-js/mdx').CompileOptions;

@@ -15,0 +16,0 @@ export type Defaults = Pick<CompileOptions, 'SourceMapGenerator'>;

/**
* @typedef {import('vfile').VFileCompatible} VFileCompatible
* @typedef {import('vfile').VFile} VFile
* @typedef {import('vfile-message').VFileMessage} VFileMessage
* @typedef {import('@mdx-js/mdx').CompileOptions} CompileOptions

@@ -13,2 +14,3 @@ * @typedef {Pick<CompileOptions, 'SourceMapGenerator'>} Defaults

import {createHash} from 'node:crypto'
import path from 'node:path'
import {SourceMapGenerator} from 'source-map'

@@ -66,6 +68,12 @@ import {createFormatAwareProcessors} from '@mdx-js/mdx/lib/util/create-format-aware-processors.js'

process({value, path: this.resourcePath}).then((file) => {
callback(null, file.value, file.map)
return file
}, callback)
process({value, path: this.resourcePath}).then(
(file) => {
callback(null, file.value, file.map)
},
(/** @type VFileMessage */ error) => {
const fpath = path.relative(this.context, this.resourcePath)
error.message = `${fpath}:${error.name}: ${error.message}`
callback(error)
}
)
}

@@ -72,0 +80,0 @@

{
"name": "@mdx-js/loader",
"version": "2.1.3",
"version": "2.1.4",
"description": "Webpack loader for MDX",

@@ -5,0 +5,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc