You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
12 KiB
JavaScript

9 months ago
"use strict";
/*
* ATTENTION: An "eval-source-map" devtool has been used.
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
exports.id = "vendor-chunks/micromark-util-combine-extensions";
exports.ids = ["vendor-chunks/micromark-util-combine-extensions"];
exports.modules = {
/***/ "(ssr)/./node_modules/micromark-util-combine-extensions/index.js":
/*!*****************************************************************!*\
!*** ./node_modules/micromark-util-combine-extensions/index.js ***!
\*****************************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ combineExtensions: () => (/* binding */ combineExtensions),\n/* harmony export */ combineHtmlExtensions: () => (/* binding */ combineHtmlExtensions)\n/* harmony export */ });\n/* harmony import */ var micromark_util_chunked__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-chunked */ \"(ssr)/./node_modules/micromark-util-chunked/dev/index.js\");\n/**\n * @typedef {import('micromark-util-types').NormalizedExtension} NormalizedExtension\n * @typedef {import('micromark-util-types').Extension} Extension\n * @typedef {import('micromark-util-types').Construct} Construct\n * @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension\n */ \nconst hasOwnProperty = {}.hasOwnProperty;\n/**\n * Combine several syntax extensions into one.\n *\n * @param {Extension[]} extensions List of syntax extensions.\n * @returns {NormalizedExtension} A single combined extension.\n */ function combineExtensions(extensions) {\n /** @type {NormalizedExtension} */ const all = {};\n let index = -1;\n while(++index < extensions.length){\n syntaxExtension(all, extensions[index]);\n }\n return all;\n}\n/**\n * Merge `extension` into `all`.\n *\n * @param {NormalizedExtension} all Extension to merge into.\n * @param {Extension} extension Extension to merge.\n * @returns {void}\n */ function syntaxExtension(all, extension) {\n /** @type {string} */ let hook;\n for(hook in extension){\n const maybe = hasOwnProperty.call(all, hook) ? all[hook] : undefined;\n const left = maybe || (all[hook] = {});\n const right = extension[hook];\n /** @type {string} */ let code;\n for(code in right){\n if (!hasOwnProperty.call(left, code)) left[code] = [];\n const value = right[code];\n constructs(// @ts-expect-error Looks like a list.\n left[code], Array.isArray(value) ? value : value ? [\n value\n ] : []);\n }\n }\n}\n/**\n * Merge `list` into `existing` (both lists of constructs).\n * Mutates `existing`.\n *\n * @param {unknown[]} existing\n * @param {unknown[]} list\n * @returns {void}\n */ function constructs(existing, list) {\n let index = -1;\n /** @type {unknown[]} */ const before = [];\n while(++index < list.length){\n // @ts-expect-error Looks like an object.\n ;\n (list[index].add === \"after\" ? existing : before).push(list[index]);\n }\n (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_0__.splice)(existing, 0, 0, before);\n}\n/**\n * Combine several HTML extensions into one.\n *\n * @param {HtmlExtension[]} htmlExtensions List of HTML extensions.\n * @returns {HtmlExtension} A single combined extension.\n */ function combineHtmlExtensions(htmlExtensions) {\n /** @type {HtmlExtension} */ const handlers = {};\n let index = -1;\n while(++index < htmlExtensions.length){\n htmlExtension(handlers, htmlExtensions[index]);\n }\n return handlers;\n}\n/**\n * Merge `extension` into `all`.\n *\n * @param {HtmlExtension} all Extension to merge into.\n * @param {HtmlExtension} extension Extension to merge.\n * @returns {void}\n */ function htmlExtension(all, extension) {\n /** @type {string} */ let hook;\n for(hook in extension){\n const maybe = hasOwnProperty.call(all, hook) ? all[hook] : undefined;\n const left = maybe || (all[hook] = {});\n const right = extension[hook];\n /** @type {string} */ let type;\n if (right) {\n for(type in right){\n left[type] = right[type];\n }\n }\n }\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHNzcikvLi9ub2RlX21vZHVsZXMvbWljcm9tYXJrLXV0aWwtY29tYmluZS1leHRlbnNpb25zL2luZGV4LmpzIiwibWFwcGluZ3MiOiI7Ozs7OztBQUFBOzs7OztDQUtDLEdBRTRDO0FBRTdDLE1BQU1DLGlCQUFpQixDQUFDLEVBQUVBLGNBQWM7QUFFeEM7Ozs7O0NBS0MsR0FDTSxTQUFTQyx
/***/ })
};
;