@esydoc/doclet-parser
Advanced tools
Comparing version 2.1.0 to 2.1.3-beta.0
/*! | ||
* @edoc/doclet-parser | ||
* (c) 2020-2023 Alex | ||
* (c) 2020-2024 Alex | ||
* Released under the MIT License. | ||
@@ -12,3 +12,3 @@ */ | ||
/*! ***************************************************************************** | ||
/****************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
@@ -120,3 +120,3 @@ | ||
var resolveTag = function (tagNames) { | ||
var resolveTag$1 = function (tagNames) { | ||
var tagName; | ||
@@ -137,4 +137,4 @@ if (Array.isArray(tagNames) && tagNames.length > 1) { | ||
}; | ||
var DATA_NODE_ID_PREFIX = '_data_node_'; | ||
var createSimpleRawDataTreeNode = function (tagName) { | ||
var DATA_NODE_ID_PREFIX$1 = '_data_node_'; | ||
var createSimpleRawDataTreeNode$1 = function (tagName) { | ||
return { | ||
@@ -147,6 +147,6 @@ name: tagName, | ||
}; | ||
var POLYTYPE = '__polytype__'; | ||
var createNode = function (name, type, parent, properties, description, summary, optional, defaultValue) { | ||
var resolvedTag = resolveTag(type.names); | ||
var id = genUniId(DATA_NODE_ID_PREFIX); | ||
var POLYTYPE$1 = '__polytype__'; | ||
var createNode$1 = function (name, type, parent, properties, description, summary, optional, defaultValue) { | ||
var resolvedTag = resolveTag$1(type.names); | ||
var id = genUniId(DATA_NODE_ID_PREFIX$1); | ||
var tagName = resolvedTag.tagName; | ||
@@ -162,4 +162,4 @@ var rawTagName = undefined; | ||
.split('|') | ||
.map(function (v) { return createSimpleRawDataTreeNode(v); }); | ||
tagName = POLYTYPE; | ||
.map(function (v) { return createSimpleRawDataTreeNode$1(v); }); | ||
tagName = POLYTYPE$1; | ||
} | ||
@@ -186,3 +186,3 @@ return { | ||
type: tagName, | ||
properties: [createSimpleRawDataTreeNode(subTagName)], | ||
properties: [createSimpleRawDataTreeNode$1(subTagName)], | ||
description: description, | ||
@@ -194,4 +194,4 @@ summary: summary, | ||
}; | ||
var beMergedNode = null; | ||
function mergeNode(mainNode, extraNode) { | ||
var beMergedNode$1 = null; | ||
function mergeNode$1(mainNode, extraNode) { | ||
mainNode.properties = extraNode.properties; | ||
@@ -207,9 +207,9 @@ mainNode.description = mainNode.description || extraNode.description; | ||
} | ||
var transform = function (rawNode, dataMap, parent, fromDataMap) { | ||
var node = createNode(rawNode.name, rawNode.type, parent, rawNode.properties || rawNode.params, // 统一抽象为一个properties | ||
var transform$1 = function (rawNode, dataMap, parent, fromDataMap) { | ||
var node = createNode$1(rawNode.name, rawNode.type, parent, rawNode.properties || rawNode.params, // 统一抽象为一个properties | ||
rawNode.description, rawNode.summary, rawNode.optional, rawNode.defaultvalue); | ||
// should be hooks | ||
// node = decorateNode(node) | ||
if (fromDataMap && beMergedNode !== null) { | ||
node = mergeNode(beMergedNode, node); // 将离散在外部的node的属性转移到原来的树节点 | ||
if (fromDataMap && beMergedNode$1 !== null) { | ||
node = mergeNode$1(beMergedNode$1, node); // 将离散在外部的node的属性转移到原来的树节点 | ||
} | ||
@@ -223,7 +223,7 @@ var type = node.type; | ||
case 'function': // @callback type is function, it has properties of params | ||
case POLYTYPE: | ||
case POLYTYPE$1: | ||
if (node.properties) { | ||
// @ts-expect-error | ||
node.properties = node.properties.map(function (child) { | ||
return transform(child, dataMap, node); | ||
return transform$1(child, dataMap, node); | ||
}); | ||
@@ -247,4 +247,4 @@ } | ||
if (subRawTree) { | ||
beMergedNode = node; | ||
transform(subRawTree, dataMap, node, true); | ||
beMergedNode$1 = node; | ||
transform$1(subRawTree, dataMap, node, true); | ||
} | ||
@@ -269,3 +269,3 @@ else { | ||
function transofrmDocletRoot(rawDataRoot, dataMap) { | ||
return transform(rawDataRoot, dataMap, null); | ||
return transform$1(rawDataRoot, dataMap, null); | ||
} | ||
@@ -348,3 +348,3 @@ function createDocletRootMark(content, key, nodeType) { | ||
var resolveTag$1 = function (tagNames) { | ||
var resolveTag = function (tagNames) { | ||
var tagName; | ||
@@ -370,4 +370,4 @@ if (Array.isArray(tagNames) && tagNames.length > 1) { | ||
}; | ||
var DATA_NODE_ID_PREFIX$1 = '_data_node_'; | ||
var createSimpleRawDataTreeNode$1 = function (tagName) { | ||
var DATA_NODE_ID_PREFIX = '_data_node_'; | ||
var createSimpleRawDataTreeNode = function (tagName) { | ||
return { | ||
@@ -380,6 +380,6 @@ name: tagName, | ||
}; | ||
var POLYTYPE$1 = '__polytype__'; | ||
var createNode$1 = function (name, type, parent, properties, description, summary, optional, defaultValue) { | ||
var resolvedTag = resolveTag$1(type.names); | ||
var id = genUniId(DATA_NODE_ID_PREFIX$1); | ||
var POLYTYPE = '__polytype__'; | ||
var createNode = function (name, type, parent, properties, description, summary, optional, defaultValue) { | ||
var resolvedTag = resolveTag(type.names); | ||
var id = genUniId(DATA_NODE_ID_PREFIX); | ||
var tagName = resolvedTag.tagName; | ||
@@ -395,4 +395,4 @@ var rawTagName = undefined; | ||
.split('|') | ||
.map(function (v) { return createSimpleRawDataTreeNode$1(v); }); | ||
tagName = POLYTYPE$1; | ||
.map(function (v) { return createSimpleRawDataTreeNode(v); }); | ||
tagName = POLYTYPE; | ||
} | ||
@@ -419,3 +419,3 @@ return { | ||
type: tagName, | ||
properties: [createSimpleRawDataTreeNode$1(subTagName)], | ||
properties: [createSimpleRawDataTreeNode(subTagName)], | ||
description: description, | ||
@@ -427,4 +427,4 @@ summary: summary, | ||
}; | ||
var beMergedNode$1 = null; | ||
function mergeNode$1(mainNode, extraNode) { | ||
var beMergedNode = null; | ||
function mergeNode(mainNode, extraNode) { | ||
mainNode.properties = extraNode.properties; | ||
@@ -440,9 +440,9 @@ mainNode.description = mainNode.description || extraNode.description; | ||
} | ||
var transform$1 = function (rawNode, dataMap, parent, fromDataMap) { | ||
var node = createNode$1(rawNode.name, rawNode.type, parent, rawNode.properties || rawNode.params, // 统一抽象为一个properties | ||
var transform = function (rawNode, dataMap, parent, fromDataMap) { | ||
var node = createNode(rawNode.name, rawNode.type, parent, rawNode.properties || rawNode.params, // 统一抽象为一个properties | ||
rawNode.description, rawNode.summary, rawNode.optional, rawNode.defaultvalue); | ||
// should be hooks | ||
// node = decorateNode(node) | ||
if (fromDataMap && beMergedNode$1 !== null) { | ||
node = mergeNode$1(beMergedNode$1, node); // 将离散在外部的node的属性转移到原来的树节点 | ||
if (fromDataMap && beMergedNode !== null) { | ||
node = mergeNode(beMergedNode, node); // 将离散在外部的node的属性转移到原来的树节点 | ||
} | ||
@@ -456,7 +456,7 @@ var type = node.type; | ||
case 'function': // @callback type is function, it has properties of params | ||
case POLYTYPE$1: | ||
case POLYTYPE: | ||
if (node.properties) { | ||
// @ts-expect-error | ||
node.properties = node.properties.map(function (child) { | ||
return transform$1(child, dataMap, node); | ||
return transform(child, dataMap, node); | ||
}); | ||
@@ -480,4 +480,4 @@ } | ||
if (subRawTree) { | ||
beMergedNode$1 = node; | ||
transform$1(subRawTree, dataMap, node, true); | ||
beMergedNode = node; | ||
transform(subRawTree, dataMap, node, true); | ||
} | ||
@@ -625,3 +625,3 @@ else { | ||
type !== 'enum' && | ||
type !== POLYTYPE$1 && | ||
type !== POLYTYPE && | ||
type !== 'promise' && | ||
@@ -667,3 +667,3 @@ type !== 'function') { | ||
break; | ||
case POLYTYPE$1: | ||
case POLYTYPE: | ||
// side effect 对于多个类型,我们选取第一个作为默认值输出 | ||
@@ -709,3 +709,3 @@ node.properties = properties === null || properties === void 0 ? void 0 : properties.slice(0, 1); | ||
function isDateTreeNode(v) { | ||
return share.isObject(v) && v.id != null && String(v.id).startsWith(DATA_NODE_ID_PREFIX$1); | ||
return share.isObject(v) && v.id != null && String(v.id).startsWith(DATA_NODE_ID_PREFIX); | ||
} | ||
@@ -719,3 +719,3 @@ function getFirstChild(node) { | ||
function isMutiValueNode(nodeType) { | ||
return nodeType === POLYTYPE$1 || nodeType === 'enum'; | ||
return nodeType === POLYTYPE || nodeType === 'enum'; | ||
} | ||
@@ -811,8 +811,8 @@ function unwrap(node) { | ||
exports.ApiReflectConfig = ApiReflectConfig; | ||
exports.DATA_NODE_ID_PREFIX = DATA_NODE_ID_PREFIX$1; | ||
exports.DATA_NODE_ID_PREFIX = DATA_NODE_ID_PREFIX; | ||
exports.DocletParser = DocletParser; | ||
exports.POLYTYPE = POLYTYPE$1; | ||
exports.POLYTYPE = POLYTYPE; | ||
exports.clean = clean; | ||
exports.createJudgeNodeFn = createJudgeNodeFn; | ||
exports.default = DocletParser; | ||
exports["default"] = DocletParser; | ||
exports.genUniId = genUniId; | ||
@@ -829,3 +829,3 @@ exports.getDescVal = getDescVal; | ||
exports.sharedDataScope = sharedDataScope; | ||
exports.transform = transform$1; | ||
exports.transform = transform; | ||
exports.transofrmDataTreeNode2Value = transofrmDataTreeNode2Value; | ||
@@ -832,0 +832,0 @@ exports.traverseNode = traverseNode; |
{ | ||
"name": "@esydoc/doclet-parser", | ||
"version": "2.1.0", | ||
"version": "2.1.3-beta.0", | ||
"description": "The parser for doclet that it resolved by jsdoc", | ||
@@ -28,5 +28,5 @@ "author": "Alex <857276958@qq.com>", | ||
"dependencies": { | ||
"@esydoc/share": "^2.1.0" | ||
"@esydoc/share": "^2.1.3-beta.0" | ||
}, | ||
"gitHead": "237ea2e3d3fcd07d8b43b08134bfda3109b3f161" | ||
"gitHead": "1e6634f7fc1771e8039d74821c8f33b80b5d8b8f" | ||
} |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
40297
2
Updated@esydoc/share@^2.1.3-beta.0