refactor: migrate to ES modules

This commit is contained in:
Jeff Williams 2023-02-28 20:12:24 -08:00
parent 32f6a41080
commit c04508f295
No known key found for this signature in database
158 changed files with 11886 additions and 10526 deletions

View File

@ -13,16 +13,17 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
import { LicenseChecker } from 'js-green-licenses';
import path from 'node:path';
import { execa } from 'execa';
import path from 'path';
import { task } from 'hereby';
import { LicenseChecker } from 'js-green-licenses';
const BIN_DIR = 'node_modules/.bin';
const JSDOC_BIN = 'packages/jsdoc/jsdoc.js';
const NODE_BIN = process.execPath;
const sourceGlob = ['*.js', '*.mjs', 'packages/**/*.js'];
const sourceGlob = ['*.cjs', '*.js', 'packages/**/*/*.cjs', 'packages/**/*.js'];
function bin(name) {
return path.join(BIN_DIR, name);
@ -32,7 +33,7 @@ export const coverage = task({
name: 'coverage',
run: async () => {
await execa(bin('c8'), [
'--exclude=Herebyfile.mjs',
'--exclude=Herebyfile.js',
"--exclude='**/test{,s}/**'",
'--reporter=html',
bin('hereby'),
@ -99,7 +100,7 @@ export const licenseCheck = task({
export const lint = task({
name: 'lint',
run: async () => {
await execa(bin('eslint'), [...sourceGlob]);
await execa(bin('eslint'), [...sourceGlob], { stdout: 'inherit', stderr: 'inherit' });
},
});

14731
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -3,6 +3,7 @@
"private": true,
"license": "Apache-2.0",
"devDependencies": {
"@babel/eslint-parser": "7.19.1",
"@jsdoc/ast": "^0.1.0",
"@jsdoc/cli": "^0.2.10",
"@jsdoc/core": "^0.4.5",
@ -20,9 +21,10 @@
"eslint": "^8.35.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-simple-import-sort": "^10.0.0",
"execa": "^7.0.0",
"hereby": "^1.8.0",
"jasmine": "^3.99.0",
"jasmine": "^4.5.0",
"jasmine-console-reporter": "^3.1.0",
"js-green-licenses": "^4.0.0",
"klaw-sync": "^6.0.0",
@ -33,6 +35,7 @@
"prettier": "^2.8.4",
"taffydb": "2.6.2"
},
"type": "module",
"engines": {
"node": ">=v18.12.0"
},
@ -45,5 +48,8 @@
"license-headers": "node_modules/.bin/hereby license-headers",
"lint": "node_modules/.bin/hereby lint",
"test": "node_modules/.bin/hereby test"
},
"dependencies": {
"@babel/eslint-parser": "^7.19.1"
}
}

View File

@ -13,14 +13,10 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const { AstBuilder } = require('./lib/ast-builder');
const astNode = require('./lib/ast-node');
const { Syntax } = require('./lib/syntax');
const { Walker } = require('./lib/walker');
import { AstBuilder } from './lib/ast-builder.js';
import * as astNode from './lib/ast-node.js';
import { Syntax } from './lib/syntax.js';
import { Walker } from './lib/walker.js';
module.exports = {
AstBuilder,
astNode,
Syntax,
Walker,
};
export { AstBuilder, astNode, Syntax, Walker };
export default { AstBuilder, astNode, Syntax, Walker };

View File

@ -13,12 +13,12 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const _ = require('lodash');
const babelParser = require('@babel/parser');
const { log } = require('@jsdoc/util');
import babelParser from '@babel/parser';
import { log } from '@jsdoc/util';
import _ from 'lodash';
// Exported so we can use them in tests.
const parserOptions = (exports.parserOptions = {
export const parserOptions = {
allowAwaitOutsideFunction: true,
allowImportExportEverywhere: true,
allowReturnOutsideFunction: true,
@ -60,7 +60,7 @@ const parserOptions = (exports.parserOptions = {
'throwExpressions',
],
ranges: true,
});
};
function parse(source, filename, sourceType) {
let ast;
@ -76,10 +76,9 @@ function parse(source, filename, sourceType) {
}
// TODO: docs
class AstBuilder {
export class AstBuilder {
// TODO: docs
static build(source, filename, sourceType) {
return parse(source, filename, sourceType);
}
}
exports.AstBuilder = AstBuilder;

View File

@ -14,10 +14,13 @@
limitations under the License.
*/
// TODO: docs
const _ = require('lodash');
const { cast } = require('@jsdoc/util');
const { SCOPE } = require('@jsdoc/core').name;
const { Syntax } = require('./syntax');
import { name } from '@jsdoc/core';
import { cast } from '@jsdoc/util';
import _ from 'lodash';
import { Syntax } from './syntax.js';
const { SCOPE } = name;
// Counter for generating unique node IDs.
let uid = 100000000;
@ -28,7 +31,7 @@ let uid = 100000000;
* @param {(Object|string)} node - The AST node to check, or the `type` property of a node.
* @return {boolean} Set to `true` if the node is a function or `false` in all other cases.
*/
const isFunction = (exports.isFunction = (node) => {
export function isFunction(node) {
let type;
if (!node) {
@ -47,7 +50,7 @@ const isFunction = (exports.isFunction = (node) => {
type === Syntax.MethodDefinition ||
type === Syntax.ArrowFunctionExpression
);
});
}
/**
* Check whether an AST node creates a new scope.
@ -55,18 +58,20 @@ const isFunction = (exports.isFunction = (node) => {
* @param {Object} node - The AST node to check.
* @return {Boolean} Set to `true` if the node creates a new scope, or `false` in all other cases.
*/
exports.isScope = (
node // TODO: handle blocks with "let" declarations
) =>
Boolean(node) &&
typeof node === 'object' &&
(node.type === Syntax.CatchClause ||
node.type === Syntax.ClassDeclaration ||
node.type === Syntax.ClassExpression ||
isFunction(node));
// TODO: handle blocks with "let" declarations
export function isScope(node) {
return (
Boolean(node) &&
typeof node === 'object' &&
(node.type === Syntax.CatchClause ||
node.type === Syntax.ClassDeclaration ||
node.type === Syntax.ClassExpression ||
isFunction(node))
);
}
// TODO: docs
exports.addNodeProperties = (node) => {
export function addNodeProperties(node) {
const newProperties = {};
if (!node || typeof node !== 'object') {
@ -117,10 +122,10 @@ exports.addNodeProperties = (node) => {
Object.defineProperties(node, newProperties);
return node;
};
}
// TODO: docs
const nodeToValue = (exports.nodeToValue = (node) => {
export function nodeToValue(node) {
let key;
let parent;
let str;
@ -326,13 +331,12 @@ const nodeToValue = (exports.nodeToValue = (node) => {
}
return str;
});
}
// backwards compatibility
exports.nodeToString = nodeToValue;
export { nodeToValue as nodeToString };
// TODO: docs
const getParamNames = (exports.getParamNames = (node) => {
export function getParamNames(node) {
let params;
if (!node || !node.params) {
@ -342,26 +346,32 @@ const getParamNames = (exports.getParamNames = (node) => {
params = node.params.slice();
return params.map((param) => nodeToValue(param));
});
}
// TODO: docs
const isAccessor = (exports.isAccessor = (node) =>
Boolean(node) &&
typeof node === 'object' &&
(node.type === Syntax.Property || node.type === Syntax.MethodDefinition) &&
(node.kind === 'get' || node.kind === 'set'));
export function isAccessor(node) {
return (
Boolean(node) &&
typeof node === 'object' &&
(node.type === Syntax.Property || node.type === Syntax.MethodDefinition) &&
(node.kind === 'get' || node.kind === 'set')
);
}
// TODO: docs
exports.isAssignment = (node) =>
Boolean(node) &&
typeof node === 'object' &&
(node.type === Syntax.AssignmentExpression || node.type === Syntax.VariableDeclarator);
export function isAssignment(node) {
return (
Boolean(node) &&
typeof node === 'object' &&
(node.type === Syntax.AssignmentExpression || node.type === Syntax.VariableDeclarator)
);
}
// TODO: docs
/**
* Retrieve information about the node, including its name and type.
*/
exports.getInfo = (node) => {
export function getInfo(node) {
const info = {};
switch (node.type) {
@ -572,4 +582,4 @@ exports.getInfo = (node) => {
}
return info;
};
}

View File

@ -14,7 +14,7 @@
limitations under the License.
*/
// TODO: docs
exports.Syntax = {
export const Syntax = {
ArrayExpression: 'ArrayExpression',
ArrayPattern: 'ArrayPattern',
ArrowFunctionExpression: 'ArrowFunctionExpression',

View File

@ -16,9 +16,10 @@
/**
* Traversal utilities for ASTs that are compatible with the ESTree API.
*/
const astNode = require('./ast-node');
const { log } = require('@jsdoc/util');
const { Syntax } = require('./syntax');
import { log } from '@jsdoc/util';
import * as astNode from './ast-node.js';
import { Syntax } from './syntax.js';
// TODO: docs
function getCurrentScope(scopes) {
@ -57,7 +58,7 @@ function leafNode(node, parent, state, cb) {}
/* eslint-enable no-empty-function, no-unused-vars */
// TODO: docs
const walkers = (exports.walkers = {});
export const walkers = {};
walkers[Syntax.ArrayExpression] = (node, parent, state, cb) => {
for (let element of node.elements) {
@ -642,7 +643,7 @@ walkers[Syntax.YieldExpression] = (node, parent, state, cb) => {
/**
* A walker that can traverse an ESTree AST.
*/
class Walker {
export class Walker {
// TODO: docs
constructor(walkerFuncs = walkers) {
this._walkers = walkerFuncs;
@ -714,4 +715,3 @@ class Walker {
return ast;
}
}
exports.Walker = Walker;

View File

@ -21,6 +21,15 @@
"bugs": {
"url": "https://github.com/jsdoc/jsdoc/issues"
},
"type": "module",
"exports": {
".": {
"import": "./index.js"
},
"./lib/*": {
"import": "./lib/*"
}
},
"dependencies": {
"@babel/parser": "^7.21.2",
"@jsdoc/core": "^0.4.6",

View File

@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const ast = require('../../index');
import ast from '../../index.js';
describe('@jsdoc/ast', () => {
it('is an object', () => {
@ -21,34 +21,34 @@ describe('@jsdoc/ast', () => {
});
describe('AstBuilder', () => {
it('is lib/ast-builder.AstBuilder', () => {
const { AstBuilder } = require('../../lib/ast-builder');
it('is lib/ast-builder.AstBuilder', async () => {
const { AstBuilder } = await import('../../lib/ast-builder.js');
expect(ast.AstBuilder).toBe(AstBuilder);
expect(ast.AstBuilder).toEqual(AstBuilder);
});
});
describe('astNode', () => {
it('is lib/ast-node', () => {
const astNode = require('../../lib/ast-node');
it('is lib/ast-node', async () => {
const astNode = await import('../../lib/ast-node.js');
expect(ast.astNode).toBe(astNode);
expect(ast.astNode).toEqual(astNode);
});
});
describe('Syntax', () => {
it('is lib/syntax.Syntax', () => {
const { Syntax } = require('../../lib/syntax');
it('is lib/syntax.Syntax', async () => {
const { Syntax } = await import('../../lib/syntax.js');
expect(ast.Syntax).toBe(Syntax);
expect(ast.Syntax).toEqual(Syntax);
});
});
describe('Walker', () => {
it('is lib/walker.Walker', () => {
const { Walker } = require('../../lib/walker');
it('is lib/walker.Walker', async () => {
const { Walker } = await import('../../lib/walker.js');
expect(ast.Walker).toBe(Walker);
expect(ast.Walker).toEqual(Walker);
});
});
});

View File

@ -14,9 +14,9 @@
limitations under the License.
*/
/* global jsdoc */
describe('@jsdoc/ast/lib/ast-builder', () => {
const astBuilder = require('../../../lib/ast-builder');
import * as astBuilder from '../../../lib/ast-builder.js';
describe('@jsdoc/ast/lib/ast-builder', () => {
it('is an object', () => {
expect(astBuilder).toBeObject();
});
@ -50,7 +50,5 @@ describe('@jsdoc/ast/lib/ast-builder', () => {
});
});
xdescribe('parserOptions', () => {
// TODO: tests
});
// TODO: parserOptions tests
});

View File

@ -13,12 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
describe('@jsdoc/ast/lib/ast-node', () => {
const astNode = require('../../../lib/ast-node');
const babelParser = require('@babel/parser');
const { parserOptions } = require('../../../lib/ast-builder');
const { Syntax } = require('../../../lib/syntax');
import babelParser from '@babel/parser';
import { parserOptions } from '../../../lib/ast-builder.js';
import * as astNode from '../../../lib/ast-node.js';
import { Syntax } from '../../../lib/syntax.js';
describe('@jsdoc/ast/lib/ast-node', () => {
function parse(str) {
return babelParser.parse(str, parserOptions).program.body[0];
}

View File

@ -13,9 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
describe('@jsdoc/ast.Syntax', () => {
const { Syntax } = require('../../../index');
import { Syntax } from '../../../lib/syntax.js';
describe('@jsdoc/ast.Syntax', () => {
it('is an object', () => {
expect(Syntax).toBeObject();
});

View File

@ -13,9 +13,10 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
describe('@jsdoc/ast/lib/walker', () => {
const walker = require('../../../lib/walker');
import { Syntax } from '../../../lib/syntax.js';
import * as walker from '../../../lib/walker.js';
describe('@jsdoc/ast/lib/walker', () => {
it('is an object', () => {
expect(walker).toBeObject();
});
@ -29,8 +30,6 @@ describe('@jsdoc/ast/lib/walker', () => {
});
describe('walkers', () => {
const { Syntax } = require('../../../lib/syntax');
// TODO: tests for default functions
it('has a function for each known node type', () => {
@ -40,7 +39,5 @@ describe('@jsdoc/ast/lib/walker', () => {
});
});
xdescribe('Walker', () => {
// TODO
});
// TODO: Walker tests
});

View File

@ -13,6 +13,6 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const Engine = require('./lib/engine');
import engine from './lib/engine.js';
module.exports = Engine;
export default engine;

View File

@ -13,13 +13,14 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const _ = require('lodash');
const { EventBus } = require('@jsdoc/util');
const flags = require('./flags');
const help = require('./help');
const { LEVELS, Logger } = require('./logger');
const { default: ow } = require('ow');
const yargs = require('yargs-parser');
import { EventBus } from '@jsdoc/util';
import _ from 'lodash';
import ow from 'ow';
import yargs from 'yargs-parser';
import flags from './flags.js';
import help from './help.js';
import { LEVELS, Logger } from './logger.js';
function validateChoice(flagInfo, choices, values) {
let flagNames = flagInfo.alias ? `-${flagInfo.alias}/` : '';
@ -98,7 +99,7 @@ const { KNOWN_FLAGS, YARGS_FLAGS } = (() => {
*
* @alias module:@jsdoc/cli
*/
class Engine {
export default class Engine {
/**
* Create an instance of the CLI engine.
*
@ -240,5 +241,3 @@ class Engine {
}
Engine.LOG_LEVELS = LEVELS;
module.exports = Engine;

View File

@ -13,8 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const { cast } = require('@jsdoc/util');
const querystring = require('querystring');
import querystring from 'node:querystring';
import { cast } from '@jsdoc/util';
// TODO: Document the format of this object, then update the docs for `Engine`.
/**
@ -22,7 +23,7 @@ const querystring = require('querystring');
*
* @alias module:@jsdoc/cli/lib/flags
*/
module.exports = {
export default {
access: {
alias: 'a',
array: true,

View File

@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const flags = require('./flags');
import flags from './flags.js';
function padLeft(str, length) {
return str.padStart(str.length + length);
@ -109,7 +109,7 @@ function formatHelpInfo({ names, descriptions }, { maxLength }) {
* @return {string} The formatted help text.
* @private
*/
module.exports = ({ maxLength }) => {
export default function help({ maxLength }) {
const flagInfo = {
names: [],
descriptions: [],
@ -147,4 +147,4 @@ module.exports = ({ maxLength }) => {
});
return `${formatHelpInfo(flagInfo, { maxLength }).join('\n')}`;
};
}

View File

@ -13,8 +13,8 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const _ = require('lodash');
const { default: ow } = require('ow');
import _ from 'lodash';
import ow from 'ow';
/**
* Logging levels for the JSDoc logger. The default logging level is
@ -24,7 +24,7 @@ const { default: ow } = require('ow');
* @enum
* @type {number}
*/
const LEVELS = {
export const LEVELS = {
/**
* Do not log any messages.
*
@ -109,7 +109,7 @@ function addPrefix(level, args) {
return args;
}
class Logger {
export class Logger {
constructor(opts) {
ow(opts, ow.object);
// We validate `opts.level` in the setter, so no need to validate it here.
@ -169,8 +169,3 @@ class Logger {
this._level = level;
}
}
module.exports = {
LEVELS,
Logger,
};

View File

@ -9,8 +9,10 @@
"version": "0.2.11",
"license": "Apache-2.0",
"dependencies": {
"@jsdoc/core": "^0.4.6",
"@jsdoc/util": "^0.2.8",
"lodash": "^4.17.21",
"ow": "^0.28.2",
"ow": "^1.1.1",
"strip-bom": "^4.0.0",
"yargs-parser": "^21.1.1"
},
@ -18,10 +20,71 @@
"node": ">=v18.12.0"
}
},
"node_modules/@sindresorhus/is": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.2.0.tgz",
"integrity": "sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw==",
"node_modules/@babel/code-frame": {
"version": "7.18.6",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz",
"integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==",
"dependencies": {
"@babel/highlight": "^7.18.6"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-validator-identifier": {
"version": "7.19.1",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz",
"integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==",
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/highlight": {
"version": "7.18.6",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz",
"integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==",
"dependencies": {
"@babel/helper-validator-identifier": "^7.18.6",
"chalk": "^2.0.0",
"js-tokens": "^4.0.0"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@jsdoc/core": {
"version": "0.4.6",
"resolved": "https://registry.npmjs.org/@jsdoc/core/-/core-0.4.6.tgz",
"integrity": "sha512-i9clwgss2upkeejiYosLo2pUXJ47K2W82ppBjEnEW+hzN1Ob/QRSwxR6IRs/bxaenK2fT7W5Esq/LEpGKrNbpw==",
"dependencies": {
"bottlejs": "^2.0.1",
"cosmiconfig": "^7.1.0",
"escape-string-regexp": "^4.0.0",
"lodash": "^4.17.21",
"strip-bom": "^4.0.0",
"strip-json-comments": "^3.1.1"
},
"engines": {
"node": ">=v18.12.0"
}
},
"node_modules/@jsdoc/util": {
"version": "0.2.8",
"resolved": "https://registry.npmjs.org/@jsdoc/util/-/util-0.2.8.tgz",
"integrity": "sha512-Uqerf+cakeAbFC5JRA087v9ul+7Tu4xzTaSO9vW6i7b0+b8z6qT1rVmX/xrAfco9uyiQDSm68xm9ovR3C0HviA==",
"dependencies": {
"klaw-sync": "^6.0.0",
"lodash": "^4.17.21",
"ow": "^0.28.2"
},
"engines": {
"node": ">=v18.12.0"
}
},
"node_modules/@jsdoc/util/node_modules/@sindresorhus/is": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz",
"integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==",
"engines": {
"node": ">=10"
},
@ -29,7 +92,7 @@
"url": "https://github.com/sindresorhus/is?sponsor=1"
}
},
"node_modules/callsites": {
"node_modules/@jsdoc/util/node_modules/callsites": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
@ -37,7 +100,7 @@
"node": ">=6"
}
},
"node_modules/dot-prop": {
"node_modules/@jsdoc/util/node_modules/dot-prop": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz",
"integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==",
@ -51,6 +114,182 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/@jsdoc/util/node_modules/ow": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/ow/-/ow-0.28.2.tgz",
"integrity": "sha512-dD4UpyBh/9m4X2NVjA+73/ZPBRF+uF4zIMFvvQsabMiEK8x41L3rQ8EENOi35kyyoaJwNxEeJcP6Fj1H4U409Q==",
"dependencies": {
"@sindresorhus/is": "^4.2.0",
"callsites": "^3.1.0",
"dot-prop": "^6.0.1",
"lodash.isequal": "^4.5.0",
"vali-date": "^1.0.0"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/@sindresorhus/is": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.3.0.tgz",
"integrity": "sha512-CX6t4SYQ37lzxicAqsBtxA3OseeoVrh9cSJ5PFYam0GksYlupRfy1A+Q4aYD3zvcfECLc0zO2u+ZnR2UYKvCrw==",
"engines": {
"node": ">=14.16"
},
"funding": {
"url": "https://github.com/sindresorhus/is?sponsor=1"
}
},
"node_modules/@types/parse-json": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz",
"integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA=="
},
"node_modules/ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dependencies": {
"color-convert": "^1.9.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/bottlejs": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/bottlejs/-/bottlejs-2.0.1.tgz",
"integrity": "sha512-50T0bzqeAqZ+//kgjdDxNu7UP8Je04isNPyHPwwOOPoeZmtVESkuF9nwkWEqSEd9Sw1yJ1oaoHBAMxe/wG4Zzg=="
},
"node_modules/callsites": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-4.0.0.tgz",
"integrity": "sha512-y3jRROutgpKdz5vzEhWM34TidDU8vkJppF8dszITeb1PQmSqV3DTxyV8G/lyO/DNvtE1YTedehmw9MPZsCBHxQ==",
"engines": {
"node": ">=12.20"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/chalk": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"dependencies": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/chalk/node_modules/escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
"engines": {
"node": ">=0.8.0"
}
},
"node_modules/color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"dependencies": {
"color-name": "1.1.3"
}
},
"node_modules/color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="
},
"node_modules/cosmiconfig": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz",
"integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==",
"dependencies": {
"@types/parse-json": "^4.0.0",
"import-fresh": "^3.2.1",
"parse-json": "^5.0.0",
"path-type": "^4.0.0",
"yaml": "^1.10.0"
},
"engines": {
"node": ">=10"
}
},
"node_modules/dot-prop": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-7.2.0.tgz",
"integrity": "sha512-Ol/IPXUARn9CSbkrdV4VJo7uCy1I3VuSiWCaFSg+8BdUOzF9n3jefIpcgAydvUZbTdEBZs2vEiTiS9m61ssiDA==",
"dependencies": {
"type-fest": "^2.11.2"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/error-ex": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
"integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
"dependencies": {
"is-arrayish": "^0.2.1"
}
},
"node_modules/escape-string-regexp": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
"integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/graceful-fs": {
"version": "4.2.10",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz",
"integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA=="
},
"node_modules/has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
"engines": {
"node": ">=4"
}
},
"node_modules/import-fresh": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
"integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
"dependencies": {
"parent-module": "^1.0.0",
"resolve-from": "^4.0.0"
},
"engines": {
"node": ">=6"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/is-arrayish": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
"integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg=="
},
"node_modules/is-obj": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz",
@ -59,6 +298,29 @@
"node": ">=8"
}
},
"node_modules/js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
},
"node_modules/json-parse-even-better-errors": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
"integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w=="
},
"node_modules/klaw-sync": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz",
"integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==",
"dependencies": {
"graceful-fs": "^4.1.11"
}
},
"node_modules/lines-and-columns": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz",
"integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg=="
},
"node_modules/lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
@ -70,23 +332,75 @@
"integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA="
},
"node_modules/ow": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/ow/-/ow-0.28.2.tgz",
"integrity": "sha512-dD4UpyBh/9m4X2NVjA+73/ZPBRF+uF4zIMFvvQsabMiEK8x41L3rQ8EENOi35kyyoaJwNxEeJcP6Fj1H4U409Q==",
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ow/-/ow-1.1.1.tgz",
"integrity": "sha512-sJBRCbS5vh1Jp9EOgwp1Ws3c16lJrUkJYlvWTYC03oyiYVwS/ns7lKRWow4w4XjDyTrA2pplQv4B2naWSR6yDA==",
"dependencies": {
"@sindresorhus/is": "^4.2.0",
"callsites": "^3.1.0",
"dot-prop": "^6.0.1",
"@sindresorhus/is": "^5.3.0",
"callsites": "^4.0.0",
"dot-prop": "^7.2.0",
"lodash.isequal": "^4.5.0",
"vali-date": "^1.0.0"
},
"engines": {
"node": ">=12"
"node": ">=14.16"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/parent-module": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
"integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
"dependencies": {
"callsites": "^3.0.0"
},
"engines": {
"node": ">=6"
}
},
"node_modules/parent-module/node_modules/callsites": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
"engines": {
"node": ">=6"
}
},
"node_modules/parse-json": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz",
"integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==",
"dependencies": {
"@babel/code-frame": "^7.0.0",
"error-ex": "^1.3.1",
"json-parse-even-better-errors": "^2.3.0",
"lines-and-columns": "^1.1.6"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/path-type": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
"integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
"engines": {
"node": ">=8"
}
},
"node_modules/resolve-from": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
"integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
"engines": {
"node": ">=4"
}
},
"node_modules/strip-bom": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz",
@ -95,6 +409,39 @@
"node": ">=8"
}
},
"node_modules/strip-json-comments": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
"integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"dependencies": {
"has-flag": "^3.0.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/type-fest": {
"version": "2.19.0",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz",
"integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==",
"engines": {
"node": ">=12.20"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/vali-date": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz",
@ -103,6 +450,14 @@
"node": ">=0.10.0"
}
},
"node_modules/yaml": {
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
"integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==",
"engines": {
"node": ">= 6"
}
},
"node_modules/yargs-parser": {
"version": "21.1.1",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",
@ -113,29 +468,227 @@
}
},
"dependencies": {
"@babel/code-frame": {
"version": "7.18.6",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz",
"integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==",
"requires": {
"@babel/highlight": "^7.18.6"
}
},
"@babel/helper-validator-identifier": {
"version": "7.19.1",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz",
"integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w=="
},
"@babel/highlight": {
"version": "7.18.6",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz",
"integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==",
"requires": {
"@babel/helper-validator-identifier": "^7.18.6",
"chalk": "^2.0.0",
"js-tokens": "^4.0.0"
}
},
"@jsdoc/core": {
"version": "0.4.6",
"resolved": "https://registry.npmjs.org/@jsdoc/core/-/core-0.4.6.tgz",
"integrity": "sha512-i9clwgss2upkeejiYosLo2pUXJ47K2W82ppBjEnEW+hzN1Ob/QRSwxR6IRs/bxaenK2fT7W5Esq/LEpGKrNbpw==",
"requires": {
"bottlejs": "^2.0.1",
"cosmiconfig": "^7.1.0",
"escape-string-regexp": "^4.0.0",
"lodash": "^4.17.21",
"strip-bom": "^4.0.0",
"strip-json-comments": "^3.1.1"
}
},
"@jsdoc/util": {
"version": "0.2.8",
"resolved": "https://registry.npmjs.org/@jsdoc/util/-/util-0.2.8.tgz",
"integrity": "sha512-Uqerf+cakeAbFC5JRA087v9ul+7Tu4xzTaSO9vW6i7b0+b8z6qT1rVmX/xrAfco9uyiQDSm68xm9ovR3C0HviA==",
"requires": {
"klaw-sync": "^6.0.0",
"lodash": "^4.17.21",
"ow": "^0.28.2"
},
"dependencies": {
"@sindresorhus/is": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz",
"integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw=="
},
"callsites": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="
},
"dot-prop": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz",
"integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==",
"requires": {
"is-obj": "^2.0.0"
}
},
"ow": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/ow/-/ow-0.28.2.tgz",
"integrity": "sha512-dD4UpyBh/9m4X2NVjA+73/ZPBRF+uF4zIMFvvQsabMiEK8x41L3rQ8EENOi35kyyoaJwNxEeJcP6Fj1H4U409Q==",
"requires": {
"@sindresorhus/is": "^4.2.0",
"callsites": "^3.1.0",
"dot-prop": "^6.0.1",
"lodash.isequal": "^4.5.0",
"vali-date": "^1.0.0"
}
}
}
},
"@sindresorhus/is": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.2.0.tgz",
"integrity": "sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw=="
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.3.0.tgz",
"integrity": "sha512-CX6t4SYQ37lzxicAqsBtxA3OseeoVrh9cSJ5PFYam0GksYlupRfy1A+Q4aYD3zvcfECLc0zO2u+ZnR2UYKvCrw=="
},
"@types/parse-json": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz",
"integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA=="
},
"ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"requires": {
"color-convert": "^1.9.0"
}
},
"bottlejs": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/bottlejs/-/bottlejs-2.0.1.tgz",
"integrity": "sha512-50T0bzqeAqZ+//kgjdDxNu7UP8Je04isNPyHPwwOOPoeZmtVESkuF9nwkWEqSEd9Sw1yJ1oaoHBAMxe/wG4Zzg=="
},
"callsites": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-4.0.0.tgz",
"integrity": "sha512-y3jRROutgpKdz5vzEhWM34TidDU8vkJppF8dszITeb1PQmSqV3DTxyV8G/lyO/DNvtE1YTedehmw9MPZsCBHxQ=="
},
"chalk": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"requires": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
},
"dependencies": {
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg=="
}
}
},
"color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"requires": {
"color-name": "1.1.3"
}
},
"color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="
},
"cosmiconfig": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz",
"integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==",
"requires": {
"@types/parse-json": "^4.0.0",
"import-fresh": "^3.2.1",
"parse-json": "^5.0.0",
"path-type": "^4.0.0",
"yaml": "^1.10.0"
}
},
"dot-prop": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz",
"integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==",
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-7.2.0.tgz",
"integrity": "sha512-Ol/IPXUARn9CSbkrdV4VJo7uCy1I3VuSiWCaFSg+8BdUOzF9n3jefIpcgAydvUZbTdEBZs2vEiTiS9m61ssiDA==",
"requires": {
"is-obj": "^2.0.0"
"type-fest": "^2.11.2"
}
},
"error-ex": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
"integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
"requires": {
"is-arrayish": "^0.2.1"
}
},
"escape-string-regexp": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
"integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA=="
},
"graceful-fs": {
"version": "4.2.10",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz",
"integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA=="
},
"has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw=="
},
"import-fresh": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
"integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
"requires": {
"parent-module": "^1.0.0",
"resolve-from": "^4.0.0"
}
},
"is-arrayish": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
"integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg=="
},
"is-obj": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz",
"integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w=="
},
"js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
},
"json-parse-even-better-errors": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
"integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w=="
},
"klaw-sync": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz",
"integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==",
"requires": {
"graceful-fs": "^4.1.11"
}
},
"lines-and-columns": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz",
"integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg=="
},
"lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
@ -147,27 +700,86 @@
"integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA="
},
"ow": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/ow/-/ow-0.28.2.tgz",
"integrity": "sha512-dD4UpyBh/9m4X2NVjA+73/ZPBRF+uF4zIMFvvQsabMiEK8x41L3rQ8EENOi35kyyoaJwNxEeJcP6Fj1H4U409Q==",
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ow/-/ow-1.1.1.tgz",
"integrity": "sha512-sJBRCbS5vh1Jp9EOgwp1Ws3c16lJrUkJYlvWTYC03oyiYVwS/ns7lKRWow4w4XjDyTrA2pplQv4B2naWSR6yDA==",
"requires": {
"@sindresorhus/is": "^4.2.0",
"callsites": "^3.1.0",
"dot-prop": "^6.0.1",
"@sindresorhus/is": "^5.3.0",
"callsites": "^4.0.0",
"dot-prop": "^7.2.0",
"lodash.isequal": "^4.5.0",
"vali-date": "^1.0.0"
}
},
"parent-module": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
"integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
"requires": {
"callsites": "^3.0.0"
},
"dependencies": {
"callsites": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="
}
}
},
"parse-json": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz",
"integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==",
"requires": {
"@babel/code-frame": "^7.0.0",
"error-ex": "^1.3.1",
"json-parse-even-better-errors": "^2.3.0",
"lines-and-columns": "^1.1.6"
}
},
"path-type": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
"integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw=="
},
"resolve-from": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
"integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g=="
},
"strip-bom": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz",
"integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w=="
},
"strip-json-comments": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
"integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig=="
},
"supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"requires": {
"has-flag": "^3.0.0"
}
},
"type-fest": {
"version": "2.19.0",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz",
"integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA=="
},
"vali-date": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz",
"integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY="
},
"yaml": {
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
"integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg=="
},
"yargs-parser": {
"version": "21.1.1",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",

View File

@ -21,11 +21,20 @@
"bugs": {
"url": "https://github.com/jsdoc/jsdoc/issues"
},
"type": "module",
"exports": {
".": {
"import": "./index.js"
},
"./lib/*": {
"import": "./lib/*"
}
},
"dependencies": {
"@jsdoc/core": "^0.4.6",
"@jsdoc/util": "^0.2.8",
"lodash": "^4.17.21",
"ow": "^0.28.2",
"ow": "^1.1.1",
"strip-bom": "^4.0.0",
"yargs-parser": "^21.1.1"
},

View File

@ -13,12 +13,11 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const Engine = require('../../index');
import Engine from '../../index.js';
import engine from '../../lib/engine.js';
describe('@jsdoc/cli', () => {
it('is lib/engine', () => {
const engine = require('../../lib/engine');
expect(Engine).toBe(engine);
expect(Engine).toEqual(engine);
});
});

View File

@ -13,9 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const RealEngine = require('../../../lib/engine');
const flags = require('../../../lib/flags');
const { LEVELS } = require('../../../lib/logger');
import RealEngine from '../../../lib/engine.js';
import flags from '../../../lib/flags.js';
import { LEVELS } from '../../../lib/logger.js';
const TYPE_ERROR = 'TypeError';

View File

@ -13,8 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const flags = require('../../../lib/flags');
const { default: ow } = require('ow');
import ow from 'ow';
import flags from '../../../lib/flags.js';
function validate(name, opts) {
name = `--${name}`;

View File

@ -13,8 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const { EventBus } = require('@jsdoc/util');
const { LEVELS, Logger } = require('../../../lib/logger');
import { EventBus } from '@jsdoc/util';
import { LEVELS, Logger } from '../../../lib/logger.js';
const ARGUMENT_ERROR = 'ArgumentError';
const TYPE_ERROR = 'TypeError';

View File

@ -18,17 +18,11 @@
*
* @module @jsdoc/core
*/
import * as config from './lib/config.js';
import Dependencies from './lib/dependencies.js';
import env from './lib/env.js';
import * as name from './lib/name.js';
import * as plugins from './lib/plugins.js';
const config = require('./lib/config');
const Dependencies = require('./lib/dependencies');
const env = require('./lib/env');
const name = require('./lib/name');
const plugins = require('./lib/plugins');
module.exports = {
config,
Dependencies,
env,
name,
plugins,
};
export { config, Dependencies, env, name, plugins };
export default { config, Dependencies, env, name, plugins };

View File

@ -18,15 +18,14 @@
*
* @alias module:@jsdoc/core.config
*/
const _ = require('lodash');
const { cosmiconfigSync, defaultLoaders } = require('cosmiconfig');
const stripBom = require('strip-bom');
const stripJsonComments = require('strip-json-comments');
import { cosmiconfigSync, defaultLoaders } from 'cosmiconfig';
import _ from 'lodash';
import stripBom from 'strip-bom';
import stripJsonComments from 'strip-json-comments';
const MODULE_NAME = 'jsdoc';
const defaults = (exports.defaults = {
export const defaults = {
// TODO(hegemonic): Integrate CLI options with other options.
opts: {
destination: './out',
@ -77,7 +76,7 @@ const defaults = (exports.defaults = {
*/
monospaceLinks: false,
},
});
};
// TODO: Consider exporting this class.
class Config {
@ -114,7 +113,7 @@ const explorerSync = cosmiconfigSync(MODULE_NAME, {
],
});
exports.loadSync = (filepath) => {
export function loadSync(filepath) {
let loaded;
if (filepath) {
@ -124,4 +123,4 @@ exports.loadSync = (filepath) => {
}
return new Config(loaded.filepath, _.defaultsDeep({}, loaded.config, defaults));
};
}

View File

@ -13,15 +13,15 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const _ = require('lodash');
const Bottle = require('bottlejs');
import Bottle from 'bottlejs';
import _ from 'lodash';
/**
* Container for JSDoc classes, objects, and values that can be injected into other modules.
*
* @alias module:@jsdoc/core.deps
*/
class Dependencies {
export default class Dependencies {
constructor() {
// This class provides a lightweight facade for the `bottlejs` package.
this._bottle = new Bottle();
@ -90,5 +90,3 @@ class Dependencies {
this._bottle.resetProviders(names);
}
}
module.exports = Dependencies;

View File

@ -19,7 +19,7 @@
*
* @alias @jsdoc/core.env
*/
module.exports = {
export default {
/**
* The times at which JSDoc started and finished.
*

View File

@ -18,8 +18,8 @@
*
* @alias @jsdoc/core.name
*/
const _ = require('lodash');
const escape = require('escape-string-regexp');
import escape from 'escape-string-regexp';
import _ from 'lodash';
/**
* Longnames that have a special meaning in JSDoc.
@ -28,7 +28,7 @@ const escape = require('escape-string-regexp');
* @static
* @memberof module:jsdoc/name
*/
exports.LONGNAMES = {
export const LONGNAMES = {
/** Longname used for doclets that do not have a longname, such as anonymous functions. */
ANONYMOUS: '<anonymous>',
/** Longname that represents global scope. */
@ -36,7 +36,7 @@ exports.LONGNAMES = {
};
// Module namespace prefix.
exports.MODULE_NAMESPACE = 'module:';
export const MODULE_NAMESPACE = 'module:';
/**
* Names and punctuation marks that identify doclet scopes.
@ -45,7 +45,7 @@ exports.MODULE_NAMESPACE = 'module:';
* @static
* @memberof module:jsdoc/name
*/
const SCOPE = (exports.SCOPE = {
export const SCOPE = {
NAMES: {
GLOBAL: 'global',
INNER: 'inner',
@ -57,16 +57,16 @@ const SCOPE = (exports.SCOPE = {
INSTANCE: '#',
STATIC: '.',
},
});
};
// Keys must be lowercase.
const SCOPE_TO_PUNC = (exports.SCOPE_TO_PUNC = {
export const SCOPE_TO_PUNC = {
inner: SCOPE.PUNC.INNER,
instance: SCOPE.PUNC.INSTANCE,
static: SCOPE.PUNC.STATIC,
});
};
exports.PUNC_TO_SCOPE = _.invert(SCOPE_TO_PUNC);
export const PUNC_TO_SCOPE = _.invert(SCOPE_TO_PUNC);
const SCOPE_PUNC = _.values(SCOPE.PUNC);
const SCOPE_PUNC_STRING = `[${SCOPE_PUNC.join()}]`;
@ -90,11 +90,11 @@ const REGEXP_NAME_DESCRIPTION = new RegExp(`^(\\[[^\\]]+\\]|\\S+)${DESCRIPTION}`
* @returns {boolean} `true` if the name represents a complete longname that is a member of the
* parent; otherwise, `false`.
*/
exports.nameIsLongname = (name, memberof) => {
export function nameIsLongname(name, memberof) {
const regexp = new RegExp(`^${escape(memberof)}${SCOPE_PUNC_STRING}`);
return regexp.test(name);
};
}
/**
* For names that identify a property of a prototype, replace the `prototype` portion of the name
@ -104,14 +104,14 @@ exports.nameIsLongname = (name, memberof) => {
* @param {string} name - The name in which to change `prototype` to `#`.
* @returns {string} The updated name.
*/
const prototypeToPunc = (exports.prototypeToPunc = (name) => {
export function prototypeToPunc(name) {
// Don't mangle symbols named `prototype`.
if (name === 'prototype') {
return name;
}
return name.replace(/(?:^|\.)prototype\.?/g, SCOPE.PUNC.INSTANCE);
});
}
/**
* Check whether a name begins with a character that identifies a scope.
@ -119,7 +119,7 @@ const prototypeToPunc = (exports.prototypeToPunc = (name) => {
* @param {string} name - The name to check.
* @returns {boolean} `true` if the name begins with a scope character; otherwise, `false`.
*/
exports.hasLeadingScope = (name) => REGEXP_LEADING_SCOPE.test(name);
export const hasLeadingScope = (name) => REGEXP_LEADING_SCOPE.test(name);
/**
* Check whether a name ends with a character that identifies a scope.
@ -127,7 +127,7 @@ exports.hasLeadingScope = (name) => REGEXP_LEADING_SCOPE.test(name);
* @param {string} name - The name to check.
* @returns {boolean} `true` if the name ends with a scope character; otherwise, `false`.
*/
exports.hasTrailingScope = (name) => REGEXP_TRAILING_SCOPE.test(name);
export const hasTrailingScope = (name) => REGEXP_TRAILING_SCOPE.test(name);
/**
* Get a symbol's basename, which is the first part of its full name before any punctuation (other
@ -141,16 +141,16 @@ exports.hasTrailingScope = (name) => REGEXP_TRAILING_SCOPE.test(name);
* @param {?string} [name] - The symbol's full name.
* @returns {?string} The symbol's basename.
*/
exports.getBasename = (name) => {
export function getBasename(name) {
if (!name) {
return null;
}
return name.replace(/^([$a-z_][$a-z_0-9]*).*?$/i, '$1');
};
}
// TODO: docs
exports.stripNamespace = (longname) => longname.replace(/^[a-zA-Z]+:/, '');
export const stripNamespace = (longname) => longname.replace(/^[a-zA-Z]+:/, '');
// TODO: docs
function slice(longname, sliceChars, forcedMemberof) {
@ -242,7 +242,7 @@ function slice(longname, sliceChars, forcedMemberof) {
* @param {string} forcedMemberof
* @returns {object} Representing the properties of the given name.
*/
exports.toParts = (longname, forcedMemberof) => slice(longname, null, forcedMemberof);
export const toParts = (longname, forcedMemberof) => slice(longname, null, forcedMemberof);
// TODO: docs
/**
@ -250,7 +250,7 @@ exports.toParts = (longname, forcedMemberof) => slice(longname, null, forcedMemb
* @param {string} ns The namespace to be applied.
* @returns {string} The longname with the namespace applied.
*/
exports.applyNamespace = (longname, ns) => {
export function applyNamespace(longname, ns) {
const nameParts = slice(longname);
const name = nameParts.name;
@ -261,7 +261,7 @@ exports.applyNamespace = (longname, ns) => {
}
return longname;
};
}
/**
* Check whether a parent longname is an ancestor of a child longname.
@ -270,42 +270,43 @@ exports.applyNamespace = (longname, ns) => {
* @param {string} child - The child longname.
* @return {boolean} `true` if the parent is an ancestor of the child; otherwise, `false`.
*/
exports.hasAncestor = (parent, child) => {
let hasAncestor = false;
export function hasAncestor(parent, child) {
let parentIsAncestor = false;
let memberof = child;
if (!parent || !child) {
return hasAncestor;
return parentIsAncestor;
}
// Fast path for obvious non-ancestors.
if (child.indexOf(parent) !== 0) {
return hasAncestor;
return parentIsAncestor;
}
do {
memberof = slice(memberof).memberof;
if (memberof === parent) {
hasAncestor = true;
parentIsAncestor = true;
}
} while (!hasAncestor && memberof);
} while (!parentIsAncestor && memberof);
return hasAncestor;
};
return parentIsAncestor;
}
// TODO: docs
const fromParts = (exports.fromParts = ({ memberof, scope, name, variation }) =>
[memberof || '', scope || '', name || '', variation ? `(${variation})` : ''].join(''));
export function fromParts({ memberof, scope, name, variation }) {
return [memberof || '', scope || '', name || '', variation ? `(${variation})` : ''].join('');
}
// TODO: docs
exports.stripVariation = (name) => {
export function stripVariation(name) {
const parts = slice(name);
parts.variation = '';
return fromParts(parts);
};
}
function splitLongname(longname, options) {
const chunks = [];
@ -415,7 +416,7 @@ function splitLongname(longname, options) {
* longname.
* @return {Object} A tree with information about each longname in the format shown above.
*/
exports.longnamesToTree = (longnames, doclets) => {
export function longnamesToTree(longnames, doclets) {
const splitOptions = { includeVariation: false };
const tree = {};
@ -453,7 +454,7 @@ exports.longnamesToTree = (longnames, doclets) => {
});
return tree;
};
}
/**
* Split a string that starts with a name and ends with a description into its parts. Allows the
@ -494,10 +495,11 @@ function splitNameMatchingBrackets(nameDesc) {
return null;
}
nameDesc.substr(i).match(REGEXP_DESCRIPTION);
nameDesc.substring(i).match(REGEXP_DESCRIPTION);
return {
name: buffer.join(''),
// TODO: Don't use global RegExp properties.
description: RegExp.$1,
};
}
@ -507,7 +509,7 @@ function splitNameMatchingBrackets(nameDesc) {
* @param {string} str - The string that contains the name and description.
* @returns {object} An object with `name` and `description` properties.
*/
exports.splitNameAndDescription = (str) => {
export function splitNameAndDescription(str) {
// Like: `name`, `[name]`, `name text`, `[name] text`, `name - text`, or `[name] - text`.
// To ensure that we don't get confused by leading dashes in Markdown list items, the hyphen
// must be on the same line as the name.
@ -525,7 +527,8 @@ exports.splitNameAndDescription = (str) => {
str.match(REGEXP_NAME_DESCRIPTION);
return {
// TODO: Don't use global RegExp properties.
name: RegExp.$1,
description: RegExp.$2,
};
};
}

View File

@ -23,12 +23,12 @@ function addHandlers(handlers, parser, deps) {
});
}
exports.installPlugins = (plugins, parser, deps) => {
export async function installPlugins(plugins, parser, deps) {
let dictionary;
let plugin;
for (let pluginModule of plugins) {
plugin = require(pluginModule);
plugin = await import(pluginModule); // eslint-disable-line no-await-in-loop
// allow user-defined plugins to...
// ...register event handlers
@ -47,4 +47,4 @@ exports.installPlugins = (plugins, parser, deps) => {
parser.addAstNodeVisitor(plugin.astNodeVisitor, deps);
}
}
};
}

View File

@ -10,11 +10,11 @@
"license": "Apache-2.0",
"dependencies": {
"bottlejs": "^2.0.1",
"cosmiconfig": "^7.1.0",
"escape-string-regexp": "^4.0.0",
"cosmiconfig": "^8.1.0",
"escape-string-regexp": "^5.0.0",
"lodash": "^4.17.21",
"strip-bom": "^4.0.0",
"strip-json-comments": "^3.1.1"
"strip-bom": "^5.0.0",
"strip-json-comments": "^5.0.0"
},
"engines": {
"node": ">=v18.12.0"
@ -52,11 +52,6 @@
"node": ">=6.9.0"
}
},
"node_modules/@types/parse-json": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz",
"integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA=="
},
"node_modules/ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
@ -68,6 +63,11 @@
"node": ">=4"
}
},
"node_modules/argparse": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
},
"node_modules/bottlejs": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/bottlejs/-/bottlejs-2.0.1.tgz",
@ -116,18 +116,20 @@
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
},
"node_modules/cosmiconfig": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz",
"integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==",
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.1.0.tgz",
"integrity": "sha512-0tLZ9URlPGU7JsKq0DQOQ3FoRsYX8xDZ7xMiATQfaiGMz7EHowNkbU9u1coAOmnh9p/1ySpm0RB3JNWRXM5GCg==",
"dependencies": {
"@types/parse-json": "^4.0.0",
"import-fresh": "^3.2.1",
"js-yaml": "^4.1.0",
"parse-json": "^5.0.0",
"path-type": "^4.0.0",
"yaml": "^1.10.0"
"path-type": "^4.0.0"
},
"engines": {
"node": ">=10"
"node": ">=14"
},
"funding": {
"url": "https://github.com/sponsors/d-fischer"
}
},
"node_modules/error-ex": {
@ -139,11 +141,11 @@
}
},
"node_modules/escape-string-regexp": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
"integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz",
"integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==",
"engines": {
"node": ">=10"
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
@ -182,6 +184,17 @@
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
},
"node_modules/js-yaml": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
"integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
"dependencies": {
"argparse": "^2.0.1"
},
"bin": {
"js-yaml": "bin/js-yaml.js"
}
},
"node_modules/json-parse-even-better-errors": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
@ -242,19 +255,22 @@
}
},
"node_modules/strip-bom": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz",
"integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==",
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-5.0.0.tgz",
"integrity": "sha512-p+byADHF7SzEcVnLvc/r3uognM1hUhObuHXxJcgLCfD194XAkaLbjq3Wzb0N5G2tgIjH0dgT708Z51QxMeu60A==",
"engines": {
"node": ">=8"
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/strip-json-comments": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
"integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-5.0.0.tgz",
"integrity": "sha512-V1LGY4UUo0jgwC+ELQ2BNWfPa17TIuwBLg+j1AA/9RPzKINl1lhxVEu2r+ZTTO8aetIsUzE5Qj6LMSBkoGYKKw==",
"engines": {
"node": ">=8"
"node": ">=14.16"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
@ -270,14 +286,6 @@
"engines": {
"node": ">=4"
}
},
"node_modules/yaml": {
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
"integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==",
"engines": {
"node": ">= 6"
}
}
},
"dependencies": {
@ -304,11 +312,6 @@
"js-tokens": "^4.0.0"
}
},
"@types/parse-json": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz",
"integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA=="
},
"ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
@ -317,6 +320,11 @@
"color-convert": "^1.9.0"
}
},
"argparse": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
},
"bottlejs": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/bottlejs/-/bottlejs-2.0.1.tgz",
@ -358,15 +366,14 @@
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
},
"cosmiconfig": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz",
"integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==",
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.1.0.tgz",
"integrity": "sha512-0tLZ9URlPGU7JsKq0DQOQ3FoRsYX8xDZ7xMiATQfaiGMz7EHowNkbU9u1coAOmnh9p/1ySpm0RB3JNWRXM5GCg==",
"requires": {
"@types/parse-json": "^4.0.0",
"import-fresh": "^3.2.1",
"js-yaml": "^4.1.0",
"parse-json": "^5.0.0",
"path-type": "^4.0.0",
"yaml": "^1.10.0"
"path-type": "^4.0.0"
}
},
"error-ex": {
@ -378,9 +385,9 @@
}
},
"escape-string-regexp": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
"integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA=="
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz",
"integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw=="
},
"has-flag": {
"version": "3.0.0",
@ -406,6 +413,14 @@
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
},
"js-yaml": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
"integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
"requires": {
"argparse": "^2.0.1"
}
},
"json-parse-even-better-errors": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
@ -451,14 +466,14 @@
"integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g=="
},
"strip-bom": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz",
"integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w=="
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-5.0.0.tgz",
"integrity": "sha512-p+byADHF7SzEcVnLvc/r3uognM1hUhObuHXxJcgLCfD194XAkaLbjq3Wzb0N5G2tgIjH0dgT708Z51QxMeu60A=="
},
"strip-json-comments": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
"integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig=="
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-5.0.0.tgz",
"integrity": "sha512-V1LGY4UUo0jgwC+ELQ2BNWfPa17TIuwBLg+j1AA/9RPzKINl1lhxVEu2r+ZTTO8aetIsUzE5Qj6LMSBkoGYKKw=="
},
"supports-color": {
"version": "5.5.0",
@ -467,11 +482,6 @@
"requires": {
"has-flag": "^3.0.0"
}
},
"yaml": {
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
"integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg=="
}
}
}

View File

@ -21,13 +21,22 @@
"bugs": {
"url": "https://github.com/jsdoc/jsdoc/issues"
},
"type": "module",
"exports": {
".": {
"import": "./index.js"
},
"./lib/*": {
"import": "./lib/*"
}
},
"dependencies": {
"bottlejs": "^2.0.1",
"cosmiconfig": "^7.1.0",
"escape-string-regexp": "^4.0.0",
"cosmiconfig": "^8.1.0",
"escape-string-regexp": "^5.0.0",
"lodash": "^4.17.21",
"strip-bom": "^4.0.0",
"strip-json-comments": "^3.1.1"
"strip-bom": "^5.0.0",
"strip-json-comments": "^5.0.0"
},
"engines": {
"node": ">=v18.12.0"

View File

@ -13,20 +13,16 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const EventEmitter = require('events');
export const nodes = [];
class PluginTestAstVisitor extends EventEmitter {
constructor() {
super();
this.astNodeVisitor = {
visitNode: (node) => {
if (node.type === 'VariableDeclarator' && node.id.name === 'foo') {
this.emit('visitNode', node);
}
}
};
}
export function init() {
nodes.length = 0;
}
module.exports = new PluginTestAstVisitor();
export const astNodeVisitor = {
visitNode: (node) => {
if (node.type === 'VariableDeclarator' && node.id.name === 'foo') {
nodes.push(node);
}
}
}

View File

@ -13,8 +13,6 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const EventEmitter = require('events');
const events = [
'parseBegin',
'fileBegin',
@ -27,16 +25,14 @@ const events = [
'processingComplete',
];
class PluginTestHandlers extends EventEmitter {
constructor() {
super();
export const eventCounts = {};
this.handlers = events.reduce((h, eventName) => {
h[eventName] = () => this.emit(eventName);
return h;
}, {});
}
export function init() {
events.forEach((eventName) => (eventCounts[eventName] = 0));
}
module.exports = new PluginTestHandlers();
export const handlers = events.reduce((h, eventName) => {
h[eventName] = () => eventCounts[eventName]++;
return h;
}, {});

View File

@ -13,28 +13,10 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const EventEmitter = require('events');
const events = [
'parseBegin',
'fileBegin',
'beforeParse',
'jsdocCommentFound',
'symbolFound',
'newDoclet',
'fileComplete',
'parseComplete',
'processingComplete',
];
class PluginTestTags extends EventEmitter {
defineTags(dictionary) {
dictionary.defineTag('foo', {
onTagged: (doclet, tag) => {
doclet.foo = true;
},
});
}
export function defineTags(dictionary) {
dictionary.defineTag('foo', {
onTagged: (doclet) => {
doclet.foo = true;
},
});
}
module.exports = new PluginTestTags();

View File

@ -13,19 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const EventEmitter = require('events');
const events = [
'parseBegin',
'fileBegin',
'beforeParse',
'jsdocCommentFound',
'symbolFound',
'newDoclet',
'fileComplete',
'parseComplete',
'processingComplete',
];
import EventEmitter from 'node:events';
class PluginTestVisitors extends EventEmitter {
constructor() {
@ -37,4 +25,4 @@ class PluginTestVisitors extends EventEmitter {
}
}
module.exports = new PluginTestVisitors();
export default new PluginTestVisitors();

View File

@ -13,50 +13,41 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const core = require('../../index');
import core from '../../index.js';
import * as config from '../../lib/config.js';
import Dependencies from '../../lib/dependencies.js';
import env from '../../lib/env.js';
import * as name from '../../lib/name.js';
import * as plugins from '../../lib/plugins.js';
describe('@jsdoc/core', () => {
it('is an object', () => {
expect(core).toBeObject();
});
describe('config', () => {
it('is lib/config', () => {
const config = require('../../lib/config');
expect(core.config).toBe(config);
expect(core.config).toEqual(config);
});
});
describe('Dependencies', () => {
it('is lib/dependencies', () => {
const Dependencies = require('../../lib/dependencies');
expect(core.Dependencies).toBe(Dependencies);
expect(core.Dependencies).toEqual(Dependencies);
});
});
describe('env', () => {
it('is lib/env', () => {
const env = require('../../lib/env');
expect(core.env).toBe(env);
expect(core.env).toEqual(env);
});
});
describe('name', () => {
it('is lib/name', () => {
const name = require('../../lib/name');
expect(core.name).toBe(name);
expect(core.name).toEqual(name);
});
});
describe('plugins', () => {
it('is lib/plugins', () => {
const plugins = require('../../lib/plugins');
expect(core.plugins).toBe(plugins);
expect(core.plugins).toEqual(plugins);
});
});
});

View File

@ -13,13 +13,17 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const mockFs = require('mock-fs');
const config = require('../../../lib/config');
import { defaultLoaders } from 'cosmiconfig';
import mockFs from 'mock-fs';
import * as config from '../../../lib/config.js'; // eslint-disable-line sort-imports
describe('@jsdoc/core/lib/config', () => {
// Explicitly require `yaml` before we run any tests. `cosmiconfig` tries to load `yaml` lazily,
// but that doesn't work when the file system is mocked.
beforeAll(() => require('yaml'));
// Ensure that YAML parser is loaded before we run any tests. `cosmiconfig` tries to load it
// lazily, but that doesn't work when the file system is mocked.
beforeAll(() => {
defaultLoaders['.yaml']('fakefile.yaml', 'file: []');
});
afterEach(() => mockFs.restore());

View File

@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const Dependencies = require('../../../lib/dependencies');
import Dependencies from '../../../lib/dependencies.js';
describe('@jsdoc/core/lib/dependencies', () => {
let container;

View File

@ -13,9 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
describe('@jsdoc/core.env', () => {
const { env } = require('../../../index');
import env from '../../../lib/env.js';
describe('@jsdoc/core.env', () => {
it('exists', () => {
expect(env).toBeObject();
});

View File

@ -13,9 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
describe('@jsdoc/core.name', () => {
const { name } = require('../../../index');
import * as name from '../../../lib/name.js';
describe('@jsdoc/core.name', () => {
it('exists', () => {
expect(name).toBeObject();
});
@ -113,9 +113,7 @@ describe('@jsdoc/core.name', () => {
});
});
xdescribe('fromParts', () => {
// TODO: tests
});
// TODO: fromParts tests
describe('getBasename', () => {
it('returns null on empty input', () => {
@ -187,19 +185,13 @@ describe('@jsdoc/core.name', () => {
});
});
xdescribe('longnamesToTree', () => {
// TODO: tests
});
// TODO: longnamesToTree tests
// MODULE_NAMESPACE is just a string, so nothing to test.
xdescribe('nameIsLongname', () => {
// TODO(hegemonic)
});
// TODO: nameIsLongname tests
xdescribe('prototypeToPunc', () => {
// TODO(hegemonic)
});
// TODO: prototypeToPunc tests
describe('PUNC_TO_SCOPE', () => {
it('has the same number of properties as SCOPE_TO_PUNC', () => {

View File

@ -14,16 +14,18 @@
limitations under the License.
*/
/* global jsdoc */
describe('@jsdoc/core/lib/plugins', () => {
const path = require('path');
const plugins = require('../../../lib/plugins');
import path from 'node:path';
import * as plugins from '../../../lib/plugins.js';
const __dirname = jsdoc.dirname(import.meta.url);
describe('@jsdoc/core/lib/plugins', () => {
it('has an `installPlugins` method', () => {
expect(plugins.installPlugins).toBeFunction();
});
describe('installPlugins', () => {
let eventCounts;
let parser;
const events = [
@ -38,24 +40,17 @@ describe('@jsdoc/core/lib/plugins', () => {
'processingComplete',
];
function countEvents(emitter) {
events.forEach((eventName) => {
emitter.on(eventName, () => eventCounts[eventName]++);
});
}
beforeEach(() => {
eventCounts = {};
events.forEach((eventName) => (eventCounts[eventName] = 0));
parser = jsdoc.createParser();
});
it('adds event handlers to the parser', () => {
it('adds event handlers to the parser', async () => {
let pluginPath = path.resolve(__dirname, '../../fixtures/plugin-test-handlers.js');
const plugin = require(pluginPath);
const { eventCounts, init } = await import(pluginPath);
plugins.installPlugins([pluginPath], parser, jsdoc.deps);
countEvents(plugin);
init();
await plugins.installPlugins([pluginPath], parser, jsdoc.deps);
jsdoc.getDocSetFromFile(
path.resolve(__dirname, '../../fixtures/plugin-source-file.js'),
parser
@ -70,13 +65,13 @@ describe('@jsdoc/core/lib/plugins', () => {
});
});
it('adds AST node visitors to the parser', () => {
const nodes = [];
it('adds AST node visitors to the parser', async () => {
let pluginPath = path.resolve(__dirname, '../../fixtures/plugin-test-ast-visitor.js');
const plugin = require(pluginPath);
const { nodes, init } = await import(pluginPath);
plugins.installPlugins([pluginPath], parser, jsdoc.deps);
plugin.on('visitNode', (node) => nodes.push(node));
init();
await plugins.installPlugins([pluginPath], parser, jsdoc.deps);
jsdoc.getDocSetFromFile(
path.resolve(__dirname, '../../fixtures/plugin-source-file.js'),
parser
@ -86,11 +81,11 @@ describe('@jsdoc/core/lib/plugins', () => {
expect(nodes[0].init.value).toBe('bar');
});
it('adds tags to the dictionary', () => {
it('adds tags to the dictionary', async () => {
const doclets = [];
let pluginPath = path.resolve(__dirname, '../../fixtures/plugin-test-tags.js');
plugins.installPlugins([pluginPath], parser, jsdoc.deps);
await plugins.installPlugins([pluginPath], parser, jsdoc.deps);
parser.on('newDoclet', (e) => {
if (e.doclet.longname === 'test') {
doclets.push(e.doclet);

View File

@ -13,17 +13,11 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const augment = require('./lib/augment');
const { combine: combineDoclets, Doclet } = require('./lib/doclet');
const { Package } = require('./lib/package');
const { resolveBorrows } = require('./lib/borrow');
const schema = require('./lib/schema');
import * as augment from './lib/augment.js';
import { resolveBorrows } from './lib/borrow.js';
import { combineDoclets, Doclet } from './lib/doclet.js';
import { Package } from './lib/package.js';
import * as schema from './lib/schema.js';
module.exports = {
augment,
combineDoclets,
Doclet,
Package,
resolveBorrows,
schema,
};
export { augment, combineDoclets, Doclet, Package, resolveBorrows, schema };
export default { augment, combineDoclets, Doclet, Package, resolveBorrows, schema };

View File

@ -16,10 +16,12 @@
/**
* Provides methods for augmenting the parse results based on their content.
*/
import { name } from '@jsdoc/core';
import _ from 'lodash';
const _ = require('lodash');
const { combine: combineDoclets } = require('./doclet');
const { fromParts, SCOPE, toParts } = require('@jsdoc/core').name;
import { combineDoclets } from './doclet.js';
const { fromParts, SCOPE, toParts } = name;
function mapDependencies(index, propertyName) {
const dependencies = {};
@ -550,9 +552,9 @@ function augment(doclets, propertyName, docletFinder, jsdocDeps) {
* @param {!Object} doclets.index - The doclet index.
* @return {void}
*/
exports.addInherited = (doclets) => {
export function addInherited(doclets) {
augment(doclets, 'augments', getInheritedAdditions);
};
}
/**
* Add doclets to reflect mixins. When a symbol is mixed into a class, the class' version of the
@ -569,9 +571,9 @@ exports.addInherited = (doclets) => {
* @param {!Object} doclets.index - The doclet index.
* @return {void}
*/
exports.addMixedIn = (doclets) => {
export function addMixedIn(doclets) {
augment(doclets, 'mixes', getMixedInAdditions);
};
}
/**
* Add and update doclets to reflect implementations of interfaces.
@ -590,9 +592,9 @@ exports.addMixedIn = (doclets) => {
* @param {!Object} doclets.index - The doclet index.
* @return {void}
*/
exports.addImplemented = (doclets) => {
export function addImplemented(doclets) {
augment(doclets, 'implements', getImplementedAdditions);
};
}
/**
* Add and update doclets to reflect all of the following:
@ -605,10 +607,10 @@ exports.addImplemented = (doclets) => {
*
* @return {void}
*/
exports.augmentAll = (doclets) => {
exports.addMixedIn(doclets);
exports.addImplemented(doclets);
exports.addInherited(doclets);
export function augmentAll(doclets) {
addMixedIn(doclets);
addImplemented(doclets);
addInherited(doclets);
// look for implemented doclets again, in case we inherited an interface
exports.addImplemented(doclets);
};
addImplemented(doclets);
}

View File

@ -16,8 +16,10 @@
/**
* Functions that resolve `@borrows` tags in JSDoc comments.
*/
const _ = require('lodash');
const { SCOPE } = require('@jsdoc/core').name;
import { name } from '@jsdoc/core';
import _ from 'lodash';
const { SCOPE } = name;
function cloneBorrowedDoclets({ borrowed, longname }, doclets) {
borrowed.forEach(({ from, as }) => {
@ -55,11 +57,11 @@ function cloneBorrowedDoclets({ borrowed, longname }, doclets) {
moving docs from the "borrowed" array and into the general docs, then
deleting the "borrowed" array.
*/
exports.resolveBorrows = (doclets) => {
export function resolveBorrows(doclets) {
for (let doclet of doclets.index.borrowed) {
cloneBorrowedDoclets(doclet, doclets);
delete doclet.borrowed;
}
doclets.index.borrowed = [];
};
}

View File

@ -13,8 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const _ = require('lodash');
const { isFunction } = require('@jsdoc/ast').astNode;
import path from 'node:path';
import { astNode, Syntax } from '@jsdoc/ast';
import { name as jsdocName } from '@jsdoc/core';
import { Tag } from '@jsdoc/tag';
import _ from 'lodash';
const {
applyNamespace,
hasLeadingScope,
@ -27,10 +32,8 @@ const {
SCOPE,
SCOPE_TO_PUNC,
toParts,
} = require('@jsdoc/core').name;
const path = require('path');
const { Syntax } = require('@jsdoc/ast');
const { Tag } = require('@jsdoc/tag');
} = jsdocName;
const { isFunction } = astNode;
const DEFAULT_SCOPE = SCOPE.NAMES.STATIC;
@ -366,7 +369,7 @@ function copySpecificProperties(primary, secondary, target, include) {
*
* @alias module:@jsdoc/doclet.Doclet
*/
class Doclet {
export class Doclet {
/**
* Create a doclet.
*
@ -649,7 +652,6 @@ class Doclet {
}
}
}
exports.Doclet = Doclet;
/**
* Combine two doclets into a new doclet.
@ -660,8 +662,8 @@ exports.Doclet = Doclet;
* @returns {module:@jsdoc/doclet.Doclet} A new doclet that combines the primary and secondary
* doclets.
*/
exports.combine = (primary, secondary) => {
const copyMostPropertiesExclude = ['params', 'properties', 'undocumented'];
export function combineDoclets(primary, secondary) {
const copyMostPropertiesExclude = ['dependencies', 'params', 'properties', 'undocumented'];
const copySpecificPropertiesInclude = ['params', 'properties'];
const target = new Doclet('', null, secondary.dependencies);
@ -672,4 +674,4 @@ exports.combine = (primary, secondary) => {
copySpecificProperties(primary, secondary, target, copySpecificPropertiesInclude);
return target;
};
}

View File

@ -13,8 +13,8 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const { log } = require('@jsdoc/util');
const stripBom = require('strip-bom');
import { log } from '@jsdoc/util';
import stripBom from 'strip-bom';
/**
* Provides access to information about a JavaScript package.
@ -76,7 +76,7 @@ function getLicenses(packageInfo) {
* `package.json` file does not follow the npm specification, some properties of the `Package`
* object may not use the format documented here.
*/
class Package {
export class Package {
/**
* @param {string} json - The contents of the `package.json` file.
*/
@ -256,4 +256,3 @@ class Package {
}
}
}
exports.Package = Package;

View File

@ -37,7 +37,7 @@ const STRING_SCHEMA = {
};
// information about the code associated with a doclet
const META_SCHEMA = (exports.META_SCHEMA = {
export const META_SCHEMA = {
type: OBJECT,
additionalProperties: false,
properties: {
@ -99,10 +99,10 @@ const META_SCHEMA = (exports.META_SCHEMA = {
type: OBJECT,
},
},
});
};
// type property containing type names
const TYPE_PROPERTY_SCHEMA = (exports.TYPE_PROPERTY_SCHEMA = {
export const TYPE_PROPERTY_SCHEMA = {
type: OBJECT,
additionalProperties: false,
properties: {
@ -119,10 +119,10 @@ const TYPE_PROPERTY_SCHEMA = (exports.TYPE_PROPERTY_SCHEMA = {
additionalProperties: true,
},
},
});
};
// enumeration properties
const ENUM_PROPERTY_SCHEMA = (exports.ENUM_PROPERTY_SCHEMA = {
export const ENUM_PROPERTY_SCHEMA = {
type: OBJECT,
additionalProperties: false,
properties: {
@ -165,10 +165,10 @@ const ENUM_PROPERTY_SCHEMA = (exports.ENUM_PROPERTY_SCHEMA = {
type: BOOLEAN_OPTIONAL,
},
},
});
};
// function parameter, or object property defined with @property tag
const PARAM_SCHEMA = (exports.PARAM_SCHEMA = {
export const PARAM_SCHEMA = {
type: OBJECT,
additionalProperties: false,
properties: {
@ -197,9 +197,9 @@ const PARAM_SCHEMA = (exports.PARAM_SCHEMA = {
type: BOOLEAN_OPTIONAL,
},
},
});
};
const DOCLET_SCHEMA = (exports.DOCLET_SCHEMA = {
export const DOCLET_SCHEMA = {
type: OBJECT,
additionalProperties: false,
properties: {
@ -523,9 +523,9 @@ const DOCLET_SCHEMA = (exports.DOCLET_SCHEMA = {
items: PARAM_SCHEMA,
},
},
});
};
const CONTACT_INFO_SCHEMA = (exports.CONTACT_INFO_SCHEMA = {
export const CONTACT_INFO_SCHEMA = {
type: OBJECT,
additionalProperties: false,
properties: {
@ -540,9 +540,9 @@ const CONTACT_INFO_SCHEMA = (exports.CONTACT_INFO_SCHEMA = {
format: 'uri',
},
},
});
};
const BUGS_SCHEMA = (exports.BUGS_SCHEMA = {
export const BUGS_SCHEMA = {
type: OBJECT,
additionalProperties: false,
properties: {
@ -554,9 +554,9 @@ const BUGS_SCHEMA = (exports.BUGS_SCHEMA = {
format: 'uri',
},
},
});
};
const PACKAGE_SCHEMA = (exports.PACKAGE_SCHEMA = {
export const PACKAGE_SCHEMA = {
type: OBJECT,
additionalProperties: false,
properties: {
@ -652,9 +652,9 @@ const PACKAGE_SCHEMA = (exports.PACKAGE_SCHEMA = {
type: STRING,
},
},
});
};
exports.DOCLETS_SCHEMA = {
export const DOCLETS_SCHEMA = {
type: ARRAY,
items: {
anyOf: [DOCLET_SCHEMA, PACKAGE_SCHEMA],

View File

@ -21,6 +21,15 @@
"bugs": {
"url": "https://github.com/jsdoc/jsdoc/issues"
},
"type": "module",
"exports": {
".": {
"import": "./index.js"
},
"./lib/*": {
"import": "./lib/*"
}
},
"dependencies": {
"@jsdoc/ast": "^0.1.1",
"@jsdoc/core": "^0.4.6",

View File

@ -13,7 +13,12 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const doclet = require('../../index');
import doclet from '../../index.js';
import * as augment from '../../lib/augment.js';
import { resolveBorrows } from '../../lib/borrow.js';
import { combineDoclets, Doclet } from '../../lib/doclet.js';
import { Package } from '../../lib/package.js';
import * as schema from '../../lib/schema.js';
describe('@jsdoc/doclet', () => {
it('is an object', () => {
@ -22,49 +27,37 @@ describe('@jsdoc/doclet', () => {
describe('augment', () => {
it('is lib/augment', () => {
const augment = require('../../lib/augment');
expect(doclet.augment).toBe(augment);
expect(doclet.augment).toEqual(augment);
});
});
describe('combineDoclets', () => {
it('is lib/doclet.combine', () => {
const { combine } = require('../../lib/doclet');
expect(doclet.combineDoclets).toBe(combine);
it('is lib/doclet.combineDoclets', () => {
expect(doclet.combineDoclets).toEqual(combineDoclets);
});
});
describe('Doclet', () => {
it('is lib/doclet.Doclet', () => {
const { Doclet } = require('../../lib/doclet');
expect(doclet.Doclet).toBe(Doclet);
expect(doclet.Doclet).toEqual(Doclet);
});
});
describe('Package', () => {
it('is lib/package.Package', () => {
const { Package } = require('../../lib/package');
expect(doclet.Package).toBe(Package);
expect(doclet.Package).toEqual(Package);
});
});
describe('resolveBorrows', () => {
it('is lib/borrow.resolveBorrows', () => {
const { resolveBorrows } = require('../../lib/borrow');
expect(doclet.resolveBorrows).toBe(resolveBorrows);
expect(doclet.resolveBorrows).toEqual(resolveBorrows);
});
});
describe('schema', () => {
it('is lib/schema', () => {
const schema = require('../../lib/schema');
expect(doclet.schema).toBe(schema);
expect(doclet.schema).toEqual(schema);
});
});
});

View File

@ -14,11 +14,10 @@
limitations under the License.
*/
/* global jsdoc */
import * as augment from '../../../lib/augment.js';
describe('@jsdoc/doclet/lib/augment', () => {
// TODO: more tests
const augment = require('../../../lib/augment');
it('should exist', () => {
expect(augment).toBeObject();
});
@ -39,34 +38,13 @@ describe('@jsdoc/doclet/lib/augment', () => {
expect(augment.augmentAll).toBeFunction();
});
xdescribe('addImplemented', () => {
// TODO: add some basic tests (functionality is tested via @interface and @implements tags)
});
// TODO: basic addImplemented tests (functionality is tested via @interface and @implements tags)
xdescribe('addInherited', () => {
// TODO: add some basic tests (functionality is tested via @augments tag)
});
// TODO: basic addInherited tests (functionality is tested via @augments tag)
xdescribe('addMixedIn', () => {
// TODO: add some basic tests (functionality is tested via documentation/mixes spec)
});
// TODO: basic addMixedIn tests (functionality is tested via documentation/mixes spec)
describe('augmentAll', () => {
it('should call all other methods that the module exports', () => {
const docSet = jsdoc.getDocSetFromFile('test/fixtures/mixintag2.js', null, null, false);
const methodNames = Object.keys(augment).filter((name) => name !== 'augmentAll');
methodNames.forEach((name) => {
spyOn(augment, name);
});
augment.augmentAll(docSet.doclets);
methodNames.forEach((name) => {
expect(augment[name]).toHaveBeenCalled();
});
});
it('should work when a class extends another class that implements an interface', () => {
const docSet = jsdoc.getDocSetFromFile('test/fixtures/augmentall.js', null, null, false);
let open;

View File

@ -13,6 +13,4 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
xdescribe('@jsdoc/doclet/lib/borrow', () => {
// TODO
});
// TODO: Write tests

View File

@ -14,19 +14,22 @@
limitations under the License.
*/
/* global jsdoc */
import { name } from '@jsdoc/core';
import _ from 'lodash';
import * as doclet from '../../../lib/doclet.js';
const { Doclet } = doclet;
const { SCOPE } = name;
describe('@jsdoc/doclet/lib/doclet', () => {
// TODO: more tests
const _ = require('lodash');
const doclet = require('../../../lib/doclet');
const Doclet = doclet.Doclet;
const { SCOPE } = require('@jsdoc/core').name;
it('exists', () => {
expect(doclet).toBeObject();
});
it('has a combine method', () => {
expect(doclet.combine).toBeFunction();
it('has a combineDoclets method', () => {
expect(doclet.combineDoclets).toBeFunction();
});
it('has a Doclet class', () => {
@ -242,7 +245,7 @@ describe('@jsdoc/doclet/lib/doclet', () => {
});
});
describe('combine', () => {
describe('combineDoclets', () => {
it('overrides most properties of the secondary doclet', () => {
const primaryDoclet = new Doclet(
'/** New and improved!\n@version 2.0.0 */',
@ -250,7 +253,7 @@ describe('@jsdoc/doclet/lib/doclet', () => {
jsdoc.deps
);
const secondaryDoclet = new Doclet('/** Hello!\n@version 1.0.0 */', null, jsdoc.deps);
const newDoclet = doclet.combine(primaryDoclet, secondaryDoclet);
const newDoclet = doclet.combineDoclets(primaryDoclet, secondaryDoclet);
Object.getOwnPropertyNames(newDoclet).forEach((property) => {
expect(newDoclet[property]).toEqual(primaryDoclet[property]);
@ -260,7 +263,7 @@ describe('@jsdoc/doclet/lib/doclet', () => {
it('adds properties from the secondary doclet that are missing', () => {
const primaryDoclet = new Doclet('/** Hello!\n@version 2.0.0 */', null, jsdoc.deps);
const secondaryDoclet = new Doclet('/** Hello! */', null, jsdoc.deps);
const newDoclet = doclet.combine(primaryDoclet, secondaryDoclet);
const newDoclet = doclet.combineDoclets(primaryDoclet, secondaryDoclet);
expect(newDoclet.version).toBe('2.0.0');
});
@ -277,7 +280,7 @@ describe('@jsdoc/doclet/lib/doclet', () => {
' */',
].join('\n');
const secondaryDoclet = new Doclet(secondaryComment, null, jsdoc.deps);
const newDoclet = doclet.combine(primaryDoclet, secondaryDoclet);
const newDoclet = doclet.combineDoclets(primaryDoclet, secondaryDoclet);
properties.forEach((property) => {
expect(newDoclet[property]).toEqual(secondaryDoclet[property]);
@ -299,7 +302,7 @@ describe('@jsdoc/doclet/lib/doclet', () => {
' */',
].join('\n');
const secondaryDoclet = new Doclet(secondaryComment, null, jsdoc.deps);
const newDoclet = doclet.combine(primaryDoclet, secondaryDoclet);
const newDoclet = doclet.combineDoclets(primaryDoclet, secondaryDoclet);
properties.forEach((property) => {
expect(newDoclet[property]).toEqual(primaryDoclet[property]);

View File

@ -14,7 +14,8 @@
limitations under the License.
*/
/* global jsdoc */
const jsdocPackage = require('../../../lib/package');
import * as jsdocPackage from '../../../lib/package.js';
const { Package } = jsdocPackage;
describe('@jsdoc/doclet/lib/package', () => {

View File

@ -13,11 +13,11 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
import * as schema from '../../../lib/schema.js';
describe('@jsdoc/doclet/lib/schema', () => {
// We test the content of the schema in the `jsdoc` package, where we validate all of the parse
// results that were created while running other tests.
const schema = require('../../../lib/schema');
it('is an object', () => {
expect(schema).toBeObject();
});

View File

@ -20,10 +20,13 @@ module.exports = {
node: true,
},
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 'latest',
requireConfigFile: false,
sourceType: 'module',
},
plugins: ['simple-import-sort'],
rules: {
// Possible errors
@ -228,7 +231,7 @@ module.exports = {
'require-await': 'error',
'require-unicode-regexp': 'off',
'require-yield': 'error',
'sort-imports': 'error',
'sort-imports': 'off', // We use https://github.com/lydell/eslint-plugin-simple-import-sort instead
'sort-keys': 'off',
'sort-vars': 'off', // TODO: enable?
'spaced-comment': ['error', 'always'],
@ -264,7 +267,7 @@ module.exports = {
'dot-location': ['error', 'property'],
'eol-last': 'error',
'func-call-spacing': ['error', 'never'],
'function-call-argument-newline:': 'off',
'function-call-argument-newline': 'off',
'function-paren-newline': 'off',
'generator-star-spacing': [
'error',
@ -371,5 +374,9 @@ module.exports = {
'wrap-iife': ['error', 'inside'],
'wrap-regex': 'off',
'yield-star-spacing': ['error', 'before'],
// https://github.com/lydell/eslint-plugin-simple-import-sort
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
},
};

File diff suppressed because it is too large Load Diff

View File

@ -10,6 +10,10 @@
"homepage": "https://github.com/jsdoc/jsdoc#readme",
"license": "Apache-2.0",
"main": "index.js",
"dependencies": {
"@babel/eslint-parser": "^7.19.1",
"eslint-plugin-simple-import-sort": "^10.0.0"
},
"peerDependencies": {
"eslint": ">= 8.35.0"
},
@ -26,6 +30,7 @@
"bugs": {
"url": "https://github.com/jsdoc/jsdoc/issues"
},
"type": "commonjs",
"engines": {
"node": ">=v18.12.0"
},

View File

@ -13,13 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const { createParser, Parser } = require('./lib/parser');
const handlers = require('./lib/handlers');
const { Visitor } = require('./lib/visitor');
import * as handlers from './lib/handlers.js';
import { createParser, Parser } from './lib/parser.js';
import { Visitor } from './lib/visitor.js';
module.exports = {
createParser,
handlers,
Parser,
Visitor,
};
export { createParser, handlers, Parser, Visitor };
export default { createParser, handlers, Parser, Visitor };

View File

@ -13,11 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const { Doclet } = require('@jsdoc/doclet');
const escape = require('escape-string-regexp');
const { log } = require('@jsdoc/util');
const { SCOPE } = require('@jsdoc/core').name;
const { Syntax } = require('@jsdoc/ast');
import { Syntax } from '@jsdoc/ast';
import { name } from '@jsdoc/core';
import { Doclet } from '@jsdoc/doclet';
import { log } from '@jsdoc/util';
import escape from 'escape-string-regexp';
const { SCOPE } = name;
let currentModule = null;
@ -330,7 +332,7 @@ function newSymbolDoclet(parser, docletSrc, e) {
* Attach these event handlers to a particular instance of a parser.
* @param parser
*/
exports.attachTo = (parser) => {
export function attachTo(parser) {
// Handle JSDoc "virtual comments" that include one of the following:
// + A `@name` tag
// + Another tag that accepts a name, such as `@function`
@ -371,4 +373,4 @@ exports.attachTo = (parser) => {
parser.on('fileComplete', () => {
currentModule = null;
});
};
}

View File

@ -13,13 +13,17 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const _ = require('lodash');
const { AstBuilder, astNode, Syntax, Walker } = require('@jsdoc/ast');
const { EventEmitter } = require('events');
const fs = require('fs');
const { log } = require('@jsdoc/util');
const { getBasename, LONGNAMES, SCOPE, toParts } = require('@jsdoc/core').name;
const { Visitor } = require('./visitor');
import EventEmitter from 'node:events';
import fs from 'node:fs';
import { AstBuilder, astNode, Syntax, Walker } from '@jsdoc/ast';
import { name } from '@jsdoc/core';
import { log } from '@jsdoc/util';
import _ from 'lodash';
import { Visitor } from './visitor.js';
const { getBasename, LONGNAMES, SCOPE, toParts } = name;
// Prefix for JavaScript strings that were provided in lieu of a filename.
const SCHEMA = 'javascript:'; // eslint-disable-line no-script-url
@ -77,7 +81,7 @@ function definedInScope(doclet, basename) {
* @alias module:jsdoc/src/parser.Parser
* @extends module:events.EventEmitter
*/
class Parser extends EventEmitter {
export class Parser extends EventEmitter {
// TODO: docs
constructor(dependencies) {
super();
@ -636,12 +640,11 @@ class Parser extends EventEmitter {
});
}
}
exports.Parser = Parser;
// TODO: docs
exports.createParser = (deps) => {
export function createParser(deps) {
return new Parser(deps);
};
}
// TODO: document other events
/**

View File

@ -13,9 +13,11 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const { astNode, Syntax } = require('@jsdoc/ast');
const { combineDoclets } = require('@jsdoc/doclet');
const { getBasename, LONGNAMES } = require('@jsdoc/core').name;
import { astNode, Syntax } from '@jsdoc/ast';
import { name } from '@jsdoc/core';
import { combineDoclets } from '@jsdoc/doclet';
const { getBasename, LONGNAMES } = name;
/**
* Get the raw comment string for a block comment node.
@ -725,7 +727,7 @@ function makeSymbolFoundEvent(node, parser, filename) {
}
// TODO: docs
class Visitor {
export class Visitor {
// TODO: docs
constructor() {
this._parser = null;
@ -850,4 +852,3 @@ class Visitor {
return true;
}
}
exports.Visitor = Visitor;

View File

@ -28,5 +28,14 @@
},
"bugs": {
"url": "https://github.com/jsdoc/jsdoc/issues"
},
"type": "module",
"exports": {
".": {
"import": "./index.js"
},
"./lib/*": {
"import": "./lib/*"
}
}
}

View File

@ -13,7 +13,10 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const parse = require('../../index');
import parse from '../../index.js';
import * as handlers from '../../lib/handlers.js';
import { createParser, Parser } from '../../lib/parser.js';
import { Visitor } from '../../lib/visitor.js';
describe('@jsdoc/parse', () => {
it('is an object', () => {
@ -22,33 +25,25 @@ describe('@jsdoc/parse', () => {
describe('createParser', () => {
it('is lib/parser.createParser', () => {
const { createParser } = require('../../lib/parser');
expect(parse.createParser).toBe(createParser);
expect(parse.createParser).toEqual(createParser);
});
});
describe('handlers', () => {
it('is lib/handlers', () => {
const handlers = require('../../lib/handlers');
expect(parse.handlers).toBe(handlers);
expect(parse.handlers).toEqual(handlers);
});
});
describe('Parser', () => {
it('is lib/parser.Parser', () => {
const { Parser } = require('../../lib/parser');
expect(parse.Parser).toBe(Parser);
expect(parse.Parser).toEqual(Parser);
});
});
describe('Visitor', () => {
it('is lib/visitor.Visitor', () => {
const { Visitor } = require('../../lib/visitor');
expect(parse.Visitor).toBe(Visitor);
expect(parse.Visitor).toEqual(Visitor);
});
});
});

View File

@ -14,9 +14,9 @@
limitations under the License.
*/
/* global jsdoc */
describe('@jsdoc/parse/lib/handlers', () => {
const handlers = require('../../../lib/handlers');
import * as handlers from '../../../lib/handlers.js';
describe('@jsdoc/parse/lib/handlers', () => {
const testParser = jsdoc.createParser();
handlers.attachTo(testParser);
@ -63,7 +63,5 @@ describe('@jsdoc/parse/lib/handlers', () => {
});
});
xdescribe('`symbolFound` handler', () => {
// TODO
});
// TODO: tests for `symbolFound` handler
});

View File

@ -15,14 +15,18 @@
*/
/* eslint-disable no-script-url */
/* global jsdoc */
describe('@jsdoc/parse/lib/parser', () => {
const _ = require('lodash');
const { attachTo } = require('../../../lib/handlers');
const fs = require('fs');
const jsdocParser = require('../../../lib/parser');
const path = require('path');
import fs from 'node:fs';
import path from 'node:path';
const dirname = path.resolve(path.join(__dirname, '..', '..', '..'));
import { Syntax, Walker } from '@jsdoc/ast';
import _ from 'lodash';
import { attachTo } from '../../../lib/handlers.js';
import * as jsdocParser from '../../../lib/parser.js';
import { Visitor } from '../../../lib/visitor.js';
describe('@jsdoc/parse/lib/parser', () => {
const dirname = path.resolve(path.join(jsdoc.dirname(import.meta.url), '..', '..', '..'));
it('is an object', () => {
expect(jsdocParser).toBeObject();
@ -75,16 +79,12 @@ describe('@jsdoc/parse/lib/parser', () => {
describe('visitor', () => {
it('contains an appropriate visitor by default', () => {
const { Visitor } = require('../../../lib/visitor');
expect(parser.visitor instanceof Visitor).toBeTrue();
});
});
describe('walker', () => {
it('contains an appropriate walker by default', () => {
const { Walker } = require('@jsdoc/ast');
expect(parser.walker instanceof Walker).toBeTrue();
});
});
@ -158,8 +158,6 @@ describe('@jsdoc/parse/lib/parser', () => {
});
it('calls AST node visitors', () => {
const { Syntax } = require('@jsdoc/ast');
let args;
const sourceCode = ['javascript:/** foo */var foo;'];
const visitor = {

View File

@ -14,11 +14,11 @@
limitations under the License.
*/
/* global jsdoc */
import { Parser } from '../../../lib/parser.js';
import { Visitor } from '../../../lib/visitor.js';
describe('@jsdoc/parse/lib/visitor', () => {
// TODO: more tests
const { Parser } = require('../../../lib/parser');
const { Visitor } = require('../../../lib/visitor');
const parser = new Parser(jsdoc.deps);
const visitor = new Visitor();

View File

@ -13,18 +13,20 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
/* eslint-disable spaced-comment */
/**
* Demonstrate how to modify the source code before the parser sees it.
*
* @module @jsdoc/plugins/comment-convert
*/
exports.handlers = {
/* eslint-disable spaced-comment */
/** @alias module:@jsdoc/plugins/comment-convert.handlers */
export const handlers = {
///
/// Convert ///-style comments into jsdoc comments.
/// @param e
/// @param e.filename
/// @param e.source
/// @memberof module:@jsdoc/plugins/comment-convert.handlers
///
beforeParse(e) {
e.source = e.source.replace(/(\n[ \t]*\/\/\/[^\n]*)+/g, ($) => {

View File

@ -17,7 +17,7 @@
* Remove everything in a file except JSDoc-style comments. By enabling this plugin, you can
* document source files that are not valid JavaScript, including source files for other languages.
*/
exports.handlers = {
export const handlers = {
beforeParse(e) {
// a JSDoc comment looks like: /**[one or more chars]*/
const comments = e.source.match(/\/\*\*[\s\S]+?\*\//g);

View File

@ -16,7 +16,7 @@
/**
* Escape HTML tags in descriptions.
*/
exports.handlers = {
export const handlers = {
/**
* Translate HTML tags in descriptions into safe entities. Replaces <, & and newlines
*/

View File

@ -16,7 +16,7 @@
/**
* Dump information about parser events to the console.
*/
const _ = require('lodash');
import _ from 'lodash';
const EVENT_TYPES = [
'parseBegin',
@ -104,10 +104,10 @@ function cleanse(e, config) {
return result;
}
exports.handlers = {};
const handlers = {};
EVENT_TYPES.forEach((eventType) => {
exports.handlers[eventType] = (e, deps) => {
handlers[eventType] = (e, deps) => {
const config = deps.get('config').eventDumper;
if (shouldLog(eventType, config)) {
@ -122,3 +122,5 @@ EVENT_TYPES.forEach((eventType) => {
}
};
});
export { handlers };

View File

@ -176,7 +176,7 @@ function ensureUniqueLongname(newDoclet) {
return doclets.newDoclet;
}
exports.handlers = {
export const handlers = {
parseBegin() {
functionDoclets = {};
},

View File

@ -1,877 +0,0 @@
{
"name": "@jsdoc/plugins",
"version": "0.0.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@jsdoc/plugins",
"version": "0.0.1",
"license": "Apache-2.0",
"dependencies": {
"@jsdoc/util": "^0.2.8"
},
"devDependencies": {
"@jsdoc/core": "^0.4.6",
"@jsdoc/parse": "^0.2.0"
},
"engines": {
"node": ">=v18.12.0"
}
},
"node_modules/@babel/code-frame": {
"version": "7.18.6",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz",
"integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==",
"dev": true,
"dependencies": {
"@babel/highlight": "^7.18.6"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-validator-identifier": {
"version": "7.19.1",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz",
"integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==",
"dev": true,
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/highlight": {
"version": "7.18.6",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz",
"integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==",
"dev": true,
"dependencies": {
"@babel/helper-validator-identifier": "^7.18.6",
"chalk": "^2.0.0",
"js-tokens": "^4.0.0"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/parser": {
"version": "7.20.15",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.15.tgz",
"integrity": "sha512-DI4a1oZuf8wC+oAJA9RW6ga3Zbe8RZFt7kD9i4qAspz3I/yHet1VvC3DiSy/fsUvv5pvJuNPh0LPOdCcqinDPg==",
"dev": true,
"bin": {
"parser": "bin/babel-parser.js"
},
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/@jsdoc/ast": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/@jsdoc/ast/-/ast-0.1.1.tgz",
"integrity": "sha512-jl9084i06mSqogutDFeV8CauUUB+7iWvTXNs/4cB2KCWMb+72hmXIcbu36GJzLQTe5UJk9CMcMbO6SPf/tFmSQ==",
"dev": true,
"dependencies": {
"@babel/parser": "^7.20.5",
"@jsdoc/core": "^0.4.6",
"@jsdoc/util": "^0.2.8",
"lodash": "^4.17.21"
},
"engines": {
"node": ">=v18.12.0"
}
},
"node_modules/@jsdoc/core": {
"version": "0.4.6",
"resolved": "https://registry.npmjs.org/@jsdoc/core/-/core-0.4.6.tgz",
"integrity": "sha512-i9clwgss2upkeejiYosLo2pUXJ47K2W82ppBjEnEW+hzN1Ob/QRSwxR6IRs/bxaenK2fT7W5Esq/LEpGKrNbpw==",
"dev": true,
"dependencies": {
"bottlejs": "^2.0.1",
"cosmiconfig": "^7.1.0",
"escape-string-regexp": "^4.0.0",
"lodash": "^4.17.21",
"strip-bom": "^4.0.0",
"strip-json-comments": "^3.1.1"
},
"engines": {
"node": ">=v18.12.0"
}
},
"node_modules/@jsdoc/doclet": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/@jsdoc/doclet/-/doclet-0.1.2.tgz",
"integrity": "sha512-uGgDPv5MRn/Q+lkifYB/g5mRsjSgr39wwmKrHcXbbqSqTNRkoseA+pcv4nqQ6tnt9MRSLqacA9XDK7Dl2hxPyQ==",
"dev": true,
"dependencies": {
"@jsdoc/ast": "^0.1.1",
"@jsdoc/core": "^0.4.6",
"@jsdoc/tag": "^0.1.6",
"@jsdoc/util": "^0.2.8",
"lodash": "^4.17.21",
"strip-bom": "^4.0.0"
}
},
"node_modules/@jsdoc/parse": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/@jsdoc/parse/-/parse-0.2.0.tgz",
"integrity": "sha512-6+epdgVNy0JZl8gRhaGvFq9QVt8rC7yZJsczJgOTUNvHIpgVDsbmV0f1gfcfaFx24slblDRLZyQIxQFIAtrvPg==",
"dev": true,
"dependencies": {
"@jsdoc/ast": "^0.1.1",
"@jsdoc/core": "^0.4.6",
"@jsdoc/doclet": "^0.1.2",
"@jsdoc/util": "^0.2.8",
"escape-string-regexp": "^4.0.0"
}
},
"node_modules/@jsdoc/tag": {
"version": "0.1.6",
"resolved": "https://registry.npmjs.org/@jsdoc/tag/-/tag-0.1.6.tgz",
"integrity": "sha512-eYX1HOTzmhVvkez6MtDKy6A+v+EZkwA2vNvexzW3pIp4nXmQBav+0X2BR5VBAZMRqNIP5uKAsnNM0zxPZeW3eA==",
"dev": true,
"dependencies": {
"@jsdoc/ast": "^0.1.1",
"@jsdoc/core": "^0.4.6",
"@jsdoc/util": "^0.2.8",
"catharsis": "^0.9.0",
"common-path-prefix": "^3.0.0",
"lodash": "^4.17.21"
},
"engines": {
"node": ">=v18.12.0"
}
},
"node_modules/@jsdoc/util": {
"version": "0.2.8",
"resolved": "https://registry.npmjs.org/@jsdoc/util/-/util-0.2.8.tgz",
"integrity": "sha512-Uqerf+cakeAbFC5JRA087v9ul+7Tu4xzTaSO9vW6i7b0+b8z6qT1rVmX/xrAfco9uyiQDSm68xm9ovR3C0HviA==",
"dependencies": {
"klaw-sync": "^6.0.0",
"lodash": "^4.17.21",
"ow": "^0.28.2"
},
"engines": {
"node": ">=v18.12.0"
}
},
"node_modules/@sindresorhus/is": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz",
"integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==",
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sindresorhus/is?sponsor=1"
}
},
"node_modules/@types/parse-json": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz",
"integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==",
"dev": true
},
"node_modules/ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"dependencies": {
"color-convert": "^1.9.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/bottlejs": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/bottlejs/-/bottlejs-2.0.1.tgz",
"integrity": "sha512-50T0bzqeAqZ+//kgjdDxNu7UP8Je04isNPyHPwwOOPoeZmtVESkuF9nwkWEqSEd9Sw1yJ1oaoHBAMxe/wG4Zzg==",
"dev": true
},
"node_modules/callsites": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
"engines": {
"node": ">=6"
}
},
"node_modules/catharsis": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz",
"integrity": "sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A==",
"dev": true,
"dependencies": {
"lodash": "^4.17.15"
},
"engines": {
"node": ">= 10"
}
},
"node_modules/chalk": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"dev": true,
"dependencies": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/chalk/node_modules/escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
"dev": true,
"engines": {
"node": ">=0.8.0"
}
},
"node_modules/color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"dev": true,
"dependencies": {
"color-name": "1.1.3"
}
},
"node_modules/color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
"dev": true
},
"node_modules/common-path-prefix": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz",
"integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==",
"dev": true
},
"node_modules/cosmiconfig": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz",
"integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==",
"dev": true,
"dependencies": {
"@types/parse-json": "^4.0.0",
"import-fresh": "^3.2.1",
"parse-json": "^5.0.0",
"path-type": "^4.0.0",
"yaml": "^1.10.0"
},
"engines": {
"node": ">=10"
}
},
"node_modules/dot-prop": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz",
"integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==",
"dependencies": {
"is-obj": "^2.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/error-ex": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
"integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
"dev": true,
"dependencies": {
"is-arrayish": "^0.2.1"
}
},
"node_modules/escape-string-regexp": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
"integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
"dev": true,
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/graceful-fs": {
"version": "4.2.10",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz",
"integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA=="
},
"node_modules/has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
"dev": true,
"engines": {
"node": ">=4"
}
},
"node_modules/import-fresh": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
"integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
"dev": true,
"dependencies": {
"parent-module": "^1.0.0",
"resolve-from": "^4.0.0"
},
"engines": {
"node": ">=6"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/is-arrayish": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
"integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==",
"dev": true
},
"node_modules/is-obj": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz",
"integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==",
"engines": {
"node": ">=8"
}
},
"node_modules/js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
"dev": true
},
"node_modules/json-parse-even-better-errors": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
"integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==",
"dev": true
},
"node_modules/klaw-sync": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz",
"integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==",
"dependencies": {
"graceful-fs": "^4.1.11"
}
},
"node_modules/lines-and-columns": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz",
"integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==",
"dev": true
},
"node_modules/lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
},
"node_modules/lodash.isequal": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
"integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ=="
},
"node_modules/ow": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/ow/-/ow-0.28.2.tgz",
"integrity": "sha512-dD4UpyBh/9m4X2NVjA+73/ZPBRF+uF4zIMFvvQsabMiEK8x41L3rQ8EENOi35kyyoaJwNxEeJcP6Fj1H4U409Q==",
"dependencies": {
"@sindresorhus/is": "^4.2.0",
"callsites": "^3.1.0",
"dot-prop": "^6.0.1",
"lodash.isequal": "^4.5.0",
"vali-date": "^1.0.0"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/parent-module": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
"integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
"dev": true,
"dependencies": {
"callsites": "^3.0.0"
},
"engines": {
"node": ">=6"
}
},
"node_modules/parse-json": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz",
"integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==",
"dev": true,
"dependencies": {
"@babel/code-frame": "^7.0.0",
"error-ex": "^1.3.1",
"json-parse-even-better-errors": "^2.3.0",
"lines-and-columns": "^1.1.6"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/path-type": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
"integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/resolve-from": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
"integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
"dev": true,
"engines": {
"node": ">=4"
}
},
"node_modules/strip-bom": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz",
"integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/strip-json-comments": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
"integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
"dev": true,
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"dev": true,
"dependencies": {
"has-flag": "^3.0.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/vali-date": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz",
"integrity": "sha512-sgECfZthyaCKW10N0fm27cg8HYTFK5qMWgypqkXMQ4Wbl/zZKx7xZICgcoxIIE+WFAP/MBL2EFwC/YvLxw3Zeg==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/yaml": {
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
"integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==",
"dev": true,
"engines": {
"node": ">= 6"
}
}
},
"dependencies": {
"@babel/code-frame": {
"version": "7.18.6",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz",
"integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==",
"dev": true,
"requires": {
"@babel/highlight": "^7.18.6"
}
},
"@babel/helper-validator-identifier": {
"version": "7.19.1",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz",
"integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==",
"dev": true
},
"@babel/highlight": {
"version": "7.18.6",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz",
"integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.18.6",
"chalk": "^2.0.0",
"js-tokens": "^4.0.0"
}
},
"@babel/parser": {
"version": "7.20.15",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.15.tgz",
"integrity": "sha512-DI4a1oZuf8wC+oAJA9RW6ga3Zbe8RZFt7kD9i4qAspz3I/yHet1VvC3DiSy/fsUvv5pvJuNPh0LPOdCcqinDPg==",
"dev": true
},
"@jsdoc/ast": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/@jsdoc/ast/-/ast-0.1.1.tgz",
"integrity": "sha512-jl9084i06mSqogutDFeV8CauUUB+7iWvTXNs/4cB2KCWMb+72hmXIcbu36GJzLQTe5UJk9CMcMbO6SPf/tFmSQ==",
"dev": true,
"requires": {
"@babel/parser": "^7.20.5",
"@jsdoc/core": "^0.4.6",
"@jsdoc/util": "^0.2.8",
"lodash": "^4.17.21"
}
},
"@jsdoc/core": {
"version": "0.4.6",
"resolved": "https://registry.npmjs.org/@jsdoc/core/-/core-0.4.6.tgz",
"integrity": "sha512-i9clwgss2upkeejiYosLo2pUXJ47K2W82ppBjEnEW+hzN1Ob/QRSwxR6IRs/bxaenK2fT7W5Esq/LEpGKrNbpw==",
"dev": true,
"requires": {
"bottlejs": "^2.0.1",
"cosmiconfig": "^7.1.0",
"escape-string-regexp": "^4.0.0",
"lodash": "^4.17.21",
"strip-bom": "^4.0.0",
"strip-json-comments": "^3.1.1"
}
},
"@jsdoc/doclet": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/@jsdoc/doclet/-/doclet-0.1.2.tgz",
"integrity": "sha512-uGgDPv5MRn/Q+lkifYB/g5mRsjSgr39wwmKrHcXbbqSqTNRkoseA+pcv4nqQ6tnt9MRSLqacA9XDK7Dl2hxPyQ==",
"dev": true,
"requires": {
"@jsdoc/ast": "^0.1.1",
"@jsdoc/core": "^0.4.6",
"@jsdoc/tag": "^0.1.6",
"@jsdoc/util": "^0.2.8",
"lodash": "^4.17.21",
"strip-bom": "^4.0.0"
}
},
"@jsdoc/parse": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/@jsdoc/parse/-/parse-0.2.0.tgz",
"integrity": "sha512-6+epdgVNy0JZl8gRhaGvFq9QVt8rC7yZJsczJgOTUNvHIpgVDsbmV0f1gfcfaFx24slblDRLZyQIxQFIAtrvPg==",
"dev": true,
"requires": {
"@jsdoc/ast": "^0.1.1",
"@jsdoc/core": "^0.4.6",
"@jsdoc/doclet": "^0.1.2",
"@jsdoc/util": "^0.2.8",
"escape-string-regexp": "^4.0.0"
}
},
"@jsdoc/tag": {
"version": "0.1.6",
"resolved": "https://registry.npmjs.org/@jsdoc/tag/-/tag-0.1.6.tgz",
"integrity": "sha512-eYX1HOTzmhVvkez6MtDKy6A+v+EZkwA2vNvexzW3pIp4nXmQBav+0X2BR5VBAZMRqNIP5uKAsnNM0zxPZeW3eA==",
"dev": true,
"requires": {
"@jsdoc/ast": "^0.1.1",
"@jsdoc/core": "^0.4.6",
"@jsdoc/util": "^0.2.8",
"catharsis": "^0.9.0",
"common-path-prefix": "^3.0.0",
"lodash": "^4.17.21"
}
},
"@jsdoc/util": {
"version": "0.2.8",
"resolved": "https://registry.npmjs.org/@jsdoc/util/-/util-0.2.8.tgz",
"integrity": "sha512-Uqerf+cakeAbFC5JRA087v9ul+7Tu4xzTaSO9vW6i7b0+b8z6qT1rVmX/xrAfco9uyiQDSm68xm9ovR3C0HviA==",
"requires": {
"klaw-sync": "^6.0.0",
"lodash": "^4.17.21",
"ow": "^0.28.2"
}
},
"@sindresorhus/is": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz",
"integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw=="
},
"@types/parse-json": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz",
"integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==",
"dev": true
},
"ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"requires": {
"color-convert": "^1.9.0"
}
},
"bottlejs": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/bottlejs/-/bottlejs-2.0.1.tgz",
"integrity": "sha512-50T0bzqeAqZ+//kgjdDxNu7UP8Je04isNPyHPwwOOPoeZmtVESkuF9nwkWEqSEd9Sw1yJ1oaoHBAMxe/wG4Zzg==",
"dev": true
},
"callsites": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="
},
"catharsis": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz",
"integrity": "sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A==",
"dev": true,
"requires": {
"lodash": "^4.17.15"
}
},
"chalk": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"dev": true,
"requires": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
},
"dependencies": {
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
"dev": true
}
}
},
"color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"dev": true,
"requires": {
"color-name": "1.1.3"
}
},
"color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
"dev": true
},
"common-path-prefix": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz",
"integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==",
"dev": true
},
"cosmiconfig": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz",
"integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==",
"dev": true,
"requires": {
"@types/parse-json": "^4.0.0",
"import-fresh": "^3.2.1",
"parse-json": "^5.0.0",
"path-type": "^4.0.0",
"yaml": "^1.10.0"
}
},
"dot-prop": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz",
"integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==",
"requires": {
"is-obj": "^2.0.0"
}
},
"error-ex": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
"integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
"dev": true,
"requires": {
"is-arrayish": "^0.2.1"
}
},
"escape-string-regexp": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
"integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
"dev": true
},
"graceful-fs": {
"version": "4.2.10",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz",
"integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA=="
},
"has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
"dev": true
},
"import-fresh": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
"integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
"dev": true,
"requires": {
"parent-module": "^1.0.0",
"resolve-from": "^4.0.0"
}
},
"is-arrayish": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
"integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==",
"dev": true
},
"is-obj": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz",
"integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w=="
},
"js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
"dev": true
},
"json-parse-even-better-errors": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
"integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==",
"dev": true
},
"klaw-sync": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz",
"integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==",
"requires": {
"graceful-fs": "^4.1.11"
}
},
"lines-and-columns": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz",
"integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==",
"dev": true
},
"lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
},
"lodash.isequal": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
"integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ=="
},
"ow": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/ow/-/ow-0.28.2.tgz",
"integrity": "sha512-dD4UpyBh/9m4X2NVjA+73/ZPBRF+uF4zIMFvvQsabMiEK8x41L3rQ8EENOi35kyyoaJwNxEeJcP6Fj1H4U409Q==",
"requires": {
"@sindresorhus/is": "^4.2.0",
"callsites": "^3.1.0",
"dot-prop": "^6.0.1",
"lodash.isequal": "^4.5.0",
"vali-date": "^1.0.0"
}
},
"parent-module": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
"integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
"dev": true,
"requires": {
"callsites": "^3.0.0"
}
},
"parse-json": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz",
"integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.0.0",
"error-ex": "^1.3.1",
"json-parse-even-better-errors": "^2.3.0",
"lines-and-columns": "^1.1.6"
}
},
"path-type": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
"integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
"dev": true
},
"resolve-from": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
"integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
"dev": true
},
"strip-bom": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz",
"integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==",
"dev": true
},
"strip-json-comments": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
"integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
"dev": true
},
"supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"dev": true,
"requires": {
"has-flag": "^3.0.0"
}
},
"vali-date": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz",
"integrity": "sha512-sgECfZthyaCKW10N0fm27cg8HYTFK5qMWgypqkXMQ4Wbl/zZKx7xZICgcoxIIE+WFAP/MBL2EFwC/YvLxw3Zeg=="
},
"yaml": {
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
"integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==",
"dev": true
}
}
}

View File

@ -21,6 +21,12 @@
"bugs": {
"url": "https://github.com/jsdoc/jsdoc/issues"
},
"type": "module",
"exports": {
"./*": {
"import": "./*"
}
},
"engines": {
"node": ">=v18.12.0"
},

View File

@ -16,10 +16,10 @@
/**
* Adds support for reusable partial jsdoc files.
*/
const fs = require('fs');
const path = require('path');
import fs from 'node:fs';
import path from 'node:path';
exports.handlers = {
export const handlers = {
/**
* Include a partial jsdoc
*

View File

@ -15,14 +15,17 @@
*/
/**
* Strips the rails template tags from a js.erb file
* @module @jsdoc/plugins/railsTemplate
*/
exports.handlers = {
/** @alias module:@jsdoc/plugins/railsTemplate.handlers */
export const handlers = {
/**
* Remove rails tags from the source input (e.g. <% foo bar %>)
*
* @param e
* @param e.filename
* @param e.source
* @alias module:@jsdoc/plugins/railsTemplate.handlers.beforeParse
*/
beforeParse(e) {
if (e.filename.match(/\.erb$/)) {

View File

@ -13,9 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const { log } = require('@jsdoc/util');
import { log } from '@jsdoc/util';
exports.handlers = {
export const handlers = {
/**
* Support @source tag. Expected value like:
*

View File

@ -16,7 +16,7 @@
/**
* This plugin creates a summary tag, if missing, from the first sentence in the description.
*/
exports.handlers = {
export const handlers = {
/**
* Autogenerate summaries, if missing, from the description, if present.
*/

View File

@ -14,17 +14,20 @@
limitations under the License.
*/
/* global jsdoc */
import path from 'node:path';
import { plugins } from '@jsdoc/core';
describe('comment-convert plugin', () => {
const path = require('path');
const { plugins } = require('@jsdoc/core');
const __dirname = jsdoc.dirname(import.meta.url);
let docSet;
const parser = jsdoc.createParser();
const pluginPath = path.join(__dirname, '../../comment-convert.js');
plugins.installPlugins([pluginPath], parser, jsdoc.deps);
docSet = jsdoc.getDocSetFromFile(pluginPath, parser);
beforeAll(async () => {
await plugins.installPlugins([pluginPath], parser, jsdoc.deps);
docSet = jsdoc.getDocSetFromFile(pluginPath, parser);
});
it('converts ///-style comments into jsdoc comments', () => {
const doclet = docSet.getByLongname(

View File

@ -14,16 +14,20 @@
limitations under the License.
*/
/* global jsdoc */
describe('escape-html plugin', () => {
const path = require('path');
const { plugins } = require('@jsdoc/core');
import path from 'node:path';
import { plugins } from '@jsdoc/core';
describe('escape-html plugin', () => {
const __dirname = jsdoc.dirname(import.meta.url);
let docSet;
const parser = jsdoc.createParser();
const pluginPath = path.join(__dirname, '../../escape-html.js');
plugins.installPlugins([pluginPath], parser, jsdoc.deps);
docSet = jsdoc.getDocSetFromFile(pluginPath, parser);
beforeAll(async () => {
await plugins.installPlugins([pluginPath], parser, jsdoc.deps);
docSet = jsdoc.getDocSetFromFile(pluginPath, parser);
});
it('escapes `&`, `<`, and newlines in doclet descriptions', () => {
const doclet = docSet.getByLongname('handlers.newDoclet')[0];

View File

@ -14,20 +14,25 @@
limitations under the License.
*/
/* global jsdoc */
describe('overload-helper plugin', () => {
const path = require('path');
const { plugins } = require('@jsdoc/core');
import path from 'node:path';
import { plugins } from '@jsdoc/core';
describe('overload-helper plugin', () => {
const __dirname = jsdoc.dirname(import.meta.url);
let docSet;
const parser = jsdoc.createParser();
let plugin;
const pluginPath = path.join(__dirname, '../../overload-helper.js');
const plugin = require(pluginPath);
plugins.installPlugins([pluginPath], parser, jsdoc.deps);
docSet = jsdoc.getDocSetFromFile(
path.resolve(__dirname, '../fixtures/overload-helper.js'),
parser
);
beforeAll(async () => {
plugin = await import(pluginPath);
await plugins.installPlugins([pluginPath], parser, jsdoc.deps);
docSet = jsdoc.getDocSetFromFile(
path.resolve(__dirname, '../fixtures/overload-helper.js'),
parser
);
});
it('has a `handlers` object', () => {
expect(plugin.handlers).toBeDefined();

View File

@ -14,16 +14,20 @@
limitations under the License.
*/
/* global jsdoc */
describe('rails-template plugin', () => {
const { handlers } = require('@jsdoc/parse');
const path = require('path');
const { plugins } = require('@jsdoc/core');
import path from 'node:path';
import { plugins } from '@jsdoc/core';
import { handlers } from '@jsdoc/parse';
describe('rails-template plugin', () => {
const __dirname = jsdoc.dirname(import.meta.url);
const parser = jsdoc.createParser();
const pluginPath = path.join(__dirname, '../../rails-template.js');
plugins.installPlugins([pluginPath], parser, jsdoc.deps);
handlers.attachTo(parser);
beforeAll(async () => {
await plugins.installPlugins([pluginPath], parser, jsdoc.deps);
handlers.attachTo(parser);
});
it('removes <% %> rails template tags from the source of *.erb files', () => {
const docSet = parser.parse([path.resolve(__dirname, '../fixtures/rails-template.js.erb')]);

View File

@ -14,16 +14,20 @@
limitations under the License.
*/
/* global jsdoc */
describe('source-tag plugin', () => {
const path = require('path');
const { plugins } = require('@jsdoc/core');
import path from 'node:path';
import { plugins } from '@jsdoc/core';
describe('source-tag plugin', () => {
const __dirname = jsdoc.dirname(import.meta.url);
let docSet;
const parser = jsdoc.createParser();
const pluginPath = path.join(__dirname, '../../source-tag.js');
plugins.installPlugins([pluginPath], parser, jsdoc.deps);
docSet = jsdoc.getDocSetFromFile(pluginPath, parser);
beforeAll(async () => {
await plugins.installPlugins([pluginPath], parser, jsdoc.deps);
docSet = jsdoc.getDocSetFromFile(pluginPath, parser);
});
it("should set the lineno and filename of the doclet's meta property", () => {
const doclet = docSet.getByLongname('handlers.newDoclet')[0];

View File

@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const summarize = require('../../summarize');
import * as summarize from '../../summarize.js';
describe('summarize', () => {
it('should export handlers', () => {

View File

@ -14,16 +14,20 @@
limitations under the License.
*/
/* global jsdoc */
describe('underscore plugin', () => {
const path = require('path');
const { plugins } = require('@jsdoc/core');
import path from 'node:path';
import { plugins } from '@jsdoc/core';
describe('underscore plugin', () => {
const __dirname = jsdoc.dirname(import.meta.url);
let docSet;
const parser = jsdoc.createParser();
const pluginPath = path.resolve(__dirname, '../../underscore.js');
plugins.installPlugins([pluginPath], parser, jsdoc.deps);
docSet = jsdoc.getDocSetFromFile(path.resolve(__dirname, '../fixtures/underscore.js'), parser);
beforeAll(async () => {
await plugins.installPlugins([pluginPath], parser, jsdoc.deps);
docSet = jsdoc.getDocSetFromFile(path.resolve(__dirname, '../fixtures/underscore.js'), parser);
});
it('should not mark normal, public properties as private', () => {
// Base line tests

View File

@ -19,7 +19,7 @@
* automatically hides them.
*/
exports.handlers = {
export const handlers = {
newDoclet({ doclet }) {
// Ignore comment blocks for all symbols that begin with underscore
if (doclet.name.charAt(0) === '_' || doclet.name.substr(0, 6) === 'this._') {

View File

@ -27,5 +27,6 @@
},
"bugs": {
"url": "https://github.com/jsdoc/jsdoc/issues"
}
},
"type": "commonjs"
}

View File

@ -21,6 +21,7 @@
"bugs": {
"url": "https://github.com/jsdoc/jsdoc/issues"
},
"type": "commonjs",
"dependencies": {
"lodash": "^4.17.21"
},

View File

@ -13,18 +13,12 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const definitions = require('./lib/definitions');
const { Dictionary } = require('./lib/dictionary');
const inline = require('./lib/inline');
const { Tag } = require('./lib/tag');
const type = require('./lib/type');
const { validate } = require('./lib/validator');
import definitions from './lib/definitions/index.js';
import { Dictionary } from './lib/dictionary.js';
import * as inline from './lib/inline.js';
import { Tag } from './lib/tag.js';
import * as type from './lib/type.js';
import { validate } from './lib/validator.js';
module.exports = {
definitions,
Dictionary,
inline,
Tag,
type,
validate,
};
export { definitions, Dictionary, inline, Tag, type, validate };
export default { definitions, Dictionary, inline, Tag, type, validate };

View File

@ -14,8 +14,9 @@
limitations under the License.
*/
// Tag dictionary for Google Closure Compiler.
const core = require('./core');
const util = require('./util');
import { tags as core } from './core.js';
import * as util from './util.js';
const NOOP_TAG = {
onTagged: () => {
@ -23,175 +24,139 @@ const NOOP_TAG = {
},
};
exports.const = {
canHaveType: true,
onTagged(doclet, tag) {
doclet.kind = 'constant';
util.setDocletTypeToValueType(doclet, tag);
export const tags = {
const: {
canHaveType: true,
onTagged(doclet, tag) {
doclet.kind = 'constant';
util.setDocletTypeToValueType(doclet, tag);
},
// Closure Compiler only
synonyms: ['define'],
},
constructor: util.cloneTagDef(core.class),
deprecated: util.cloneTagDef(core.deprecated),
// Closure Compiler only
dict: NOOP_TAG,
enum: util.cloneTagDef(core.enum),
// Closure Compiler only
export: NOOP_TAG,
extends: util.cloneTagDef(core.augments),
// Closure Compiler only
externs: NOOP_TAG,
fileoverview: {
onTagged(doclet, tag) {
util.setNameToFile(doclet);
doclet.kind = 'file';
util.setDocletDescriptionToValue(doclet, tag);
doclet.preserveName = true;
},
},
final: util.cloneTagDef(core.readonly),
implements: util.cloneTagDef(core.implements),
// Closure Compiler only
implicitcast: NOOP_TAG,
inheritdoc: util.cloneTagDef(core.inheritdoc),
interface: util.cloneTagDef(core.interface, {
canHaveName: false,
mustNotHaveValue: true,
// Closure Compiler only
synonyms: ['record'],
}),
lends: util.cloneTagDef(core.lends),
license: util.cloneTagDef(core.license),
modifies: util.cloneTagDef(core.modifies),
// Closure Compiler only
noalias: NOOP_TAG,
// Closure Compiler only
nocollapse: NOOP_TAG,
// Closure Compiler only
nocompile: NOOP_TAG,
// Closure Compiler only
nosideeffects: {
onTagged(doclet) {
doclet.modifies = [];
},
},
// Closure Compiler only
synonyms: ['define'],
};
exports.constructor = util.cloneTagDef(core.class);
exports.deprecated = util.cloneTagDef(core.deprecated);
// Closure Compiler only
exports.dict = NOOP_TAG;
exports.enum = util.cloneTagDef(core.enum);
// Closure Compiler only
exports.export = NOOP_TAG;
exports.extends = util.cloneTagDef(core.augments);
// Closure Compiler only
exports.externs = NOOP_TAG;
exports.fileoverview = {
onTagged(doclet, tag) {
util.setNameToFile(doclet);
doclet.kind = 'file';
util.setDocletDescriptionToValue(doclet, tag);
doclet.preserveName = true;
override: {
mustNotHaveValue: true,
onTagged(doclet) {
doclet.override = true;
},
},
};
package: {
canHaveType: true,
onTagged(doclet, tag) {
doclet.access = 'package';
exports.final = util.cloneTagDef(core.readonly);
exports.implements = util.cloneTagDef(core.implements);
// Closure Compiler only
exports.implicitcast = NOOP_TAG;
exports.inheritdoc = util.cloneTagDef(core.inheritdoc);
exports.interface = util.cloneTagDef(core.interface, {
canHaveName: false,
mustNotHaveValue: true,
if (tag.value && tag.value.type) {
util.setDocletTypeToValueType(doclet, tag);
}
},
},
param: util.cloneTagDef(core.param),
// Closure Compiler only
synonyms: ['record'],
});
polymer: NOOP_TAG,
// Closure Compiler only
polymerBehavior: NOOP_TAG,
// Closure Compiler only
preserve: util.cloneTagDef(core.license),
private: {
canHaveType: true,
onTagged(doclet, tag) {
doclet.access = 'private';
exports.lends = util.cloneTagDef(core.lends);
exports.license = util.cloneTagDef(core.license);
exports.modifies = util.cloneTagDef(core.modifies);
// Closure Compiler only
exports.noalias = NOOP_TAG;
// Closure Compiler only
exports.nocollapse = NOOP_TAG;
// Closure Compiler only
exports.nocompile = NOOP_TAG;
// Closure Compiler only
exports.nosideeffects = {
onTagged(doclet) {
doclet.modifies = [];
if (tag.value && tag.value.type) {
util.setDocletTypeToValueType(doclet, tag);
}
},
},
};
protected: {
canHaveType: true,
onTagged(doclet, tag) {
doclet.access = 'protected';
// Closure Compiler only
exports.override = {
mustNotHaveValue: true,
onTagged(doclet) {
doclet.override = true;
if (tag.value && tag.value.type) {
util.setDocletTypeToValueType(doclet, tag);
}
},
},
};
public: {
canHaveType: true,
onTagged(doclet, tag) {
doclet.access = 'public';
exports.package = {
canHaveType: true,
onTagged(doclet, tag) {
doclet.access = 'package';
if (tag.value && tag.value.type) {
if (tag.value && tag.value.type) {
util.setDocletTypeToValueType(doclet, tag);
}
},
},
return: util.cloneTagDef(core.returns),
// Closure Compiler only
struct: NOOP_TAG,
// Closure Compiler only
suppress: NOOP_TAG,
// Closure Compiler only
template: NOOP_TAG,
this: {
canHaveType: true,
onTagged(doclet, tag) {
doclet.this = util.combineTypes(tag);
},
},
throws: util.cloneTagDef(core.throws),
type: util.cloneTagDef(core.type, {
mustNotHaveDescription: false,
}),
typedef: {
canHaveType: true,
onTagged(doclet, tag) {
util.setDocletKindToTitle(doclet, tag);
util.setDocletTypeToValueType(doclet, tag);
}
},
},
// Closure Compiler only
unrestricted: NOOP_TAG,
};
exports.param = util.cloneTagDef(core.param);
// Closure Compiler only
exports.polymer = NOOP_TAG;
// Closure Compiler only
exports.polymerBehavior = NOOP_TAG;
// Closure Compiler only
exports.preserve = util.cloneTagDef(core.license);
exports.private = {
canHaveType: true,
onTagged(doclet, tag) {
doclet.access = 'private';
if (tag.value && tag.value.type) {
util.setDocletTypeToValueType(doclet, tag);
}
},
};
exports.protected = {
canHaveType: true,
onTagged(doclet, tag) {
doclet.access = 'protected';
if (tag.value && tag.value.type) {
util.setDocletTypeToValueType(doclet, tag);
}
},
};
exports.public = {
canHaveType: true,
onTagged(doclet, tag) {
doclet.access = 'public';
if (tag.value && tag.value.type) {
util.setDocletTypeToValueType(doclet, tag);
}
},
};
exports.return = util.cloneTagDef(core.returns);
// Closure Compiler only
exports.struct = NOOP_TAG;
// Closure Compiler only
exports.suppress = NOOP_TAG;
// Closure Compiler only
exports.template = NOOP_TAG;
exports.this = {
canHaveType: true,
onTagged(doclet, tag) {
doclet.this = util.combineTypes(tag);
},
};
exports.throws = util.cloneTagDef(core.throws);
exports.type = util.cloneTagDef(core.type, {
mustNotHaveDescription: false,
});
exports.typedef = {
canHaveType: true,
onTagged(doclet, tag) {
util.setDocletKindToTitle(doclet, tag);
util.setDocletTypeToValueType(doclet, tag);
},
};
// Closure Compiler only
exports.unrestricted = NOOP_TAG;

File diff suppressed because it is too large Load Diff

View File

@ -13,14 +13,10 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const closure = require('./closure');
const core = require('./core');
const internal = require('./internal');
const jsdoc = require('./jsdoc');
import { tags as closure } from './closure.js';
import { tags as core } from './core.js';
import { tags as internal } from './internal.js';
import { tags as jsdoc } from './jsdoc.js';
module.exports = {
closure,
core,
internal,
jsdoc,
};
export { closure, core, internal, jsdoc };
export default { closure, core, internal, jsdoc };

View File

@ -14,50 +14,47 @@
limitations under the License.
*/
// Tags that JSDoc uses internally, and that must always be defined.
// Special separator tag indicating that multiple doclets should be generated for the same comment.
// Used internally (and by some JSDoc users, although it's not officially supported).
//
// In the following example, the parser will replace `//**` with an `@also` tag:
// /**
// * Foo.
// *//**
// * Foo with a param.
// * @param {string} bar
// */
// function foo(bar) {}
exports.also = {
onTagged() {
// Let the parser handle it. We define the tag here to avoid "not a known tag" errors.
},
};
exports.description = {
mustHaveValue: true,
onTagged: (doclet, { value }) => {
doclet.description = value;
},
synonyms: ['desc'],
};
exports.kind = {
mustHaveValue: true,
onTagged: (doclet, { value }) => {
doclet.kind = value;
},
};
exports.name = {
mustHaveValue: true,
onTagged: (doclet, { value }) => {
doclet.name = value;
},
};
exports.undocumented = {
mustNotHaveValue: true,
onTagged(doclet) {
doclet.undocumented = true;
doclet.comment = '';
export const tags = {
// Special separator tag indicating that multiple doclets should be generated for the same
// comment. Used internally (and by some JSDoc users, although it's not officially supported).
//
// In the following example, the parser will replace `//**` with an `@also` tag:
// /**
// * Foo.
// *//**
// * Foo with a param.
// * @param {string} bar
// */
// function foo(bar) {}
also: {
onTagged() {
// Let the parser handle it. We define the tag here to avoid "not a known tag" errors.
},
},
description: {
mustHaveValue: true,
onTagged: (doclet, { value }) => {
doclet.description = value;
},
synonyms: ['desc'],
},
kind: {
mustHaveValue: true,
onTagged: (doclet, { value }) => {
doclet.kind = value;
},
},
name: {
mustHaveValue: true,
onTagged: (doclet, { value }) => {
doclet.name = value;
},
},
undocumented: {
mustNotHaveValue: true,
onTagged(doclet) {
doclet.undocumented = true;
doclet.comment = '';
},
},
};

View File

@ -13,6 +13,4 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const core = require('./core');
module.exports = core;
export { tags } from './core.js';

View File

@ -13,23 +13,25 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
const _ = require('lodash');
const { applyNamespace } = require('@jsdoc/core').name;
const commonPathPrefix = require('common-path-prefix');
const { log } = require('@jsdoc/util');
const { parse: parseTagType } = require('../type');
const path = require('path');
import path from 'node:path';
import { name } from '@jsdoc/core';
import { log } from '@jsdoc/util';
import commonPathPrefix from 'common-path-prefix';
import _ from 'lodash';
import { parse as parseTagType } from '../type.js';
// Clone a tag definition, excluding synonyms.
exports.cloneTagDef = (tagDef, extras) => {
export function cloneTagDef(tagDef, extras) {
const newTagDef = _.cloneDeep(tagDef);
delete newTagDef.synonyms;
return extras ? _.extend(newTagDef, extras) : newTagDef;
};
}
const getSourcePaths = (exports.getSourcePaths = (env) => {
export function getSourcePaths(env) {
const sourcePaths = env.sourceFiles.slice() || [];
if (env.opts._) {
@ -43,7 +45,7 @@ const getSourcePaths = (exports.getSourcePaths = (env) => {
}
return sourcePaths;
});
}
function filepathMinusPrefix(filepath, env) {
let commonPrefix;
@ -68,19 +70,19 @@ function filepathMinusPrefix(filepath, env) {
return result;
}
exports.setDocletKindToTitle = (doclet, { title }) => {
export function setDocletKindToTitle(doclet, { title }) {
doclet.addTag('kind', title);
};
}
exports.setDocletScopeToTitle = (doclet, { title }) => {
export function setDocletScopeToTitle(doclet, { title }) {
try {
doclet.setScope(title);
} catch (e) {
log.error(e.message);
}
};
}
exports.setDocletNameToValue = (doclet, { value, text }) => {
export function setDocletNameToValue(doclet, { value, text }) {
if (value && value.description) {
// as in a long tag
doclet.addTag('name', value.description);
@ -88,21 +90,21 @@ exports.setDocletNameToValue = (doclet, { value, text }) => {
// or a short tag
doclet.addTag('name', text);
}
};
}
exports.setDocletNameToValueName = (doclet, { value }) => {
export function setDocletNameToValueName(doclet, { value }) {
if (value && value.name) {
doclet.addTag('name', value.name);
}
};
}
exports.setDocletDescriptionToValue = (doclet, { value }) => {
export function setDocletDescriptionToValue(doclet, { value }) {
if (value) {
doclet.addTag('description', value);
}
};
}
exports.setDocletTypeToValueType = (doclet, { value }) => {
export function setDocletTypeToValueType(doclet, { value }) {
if (value && value.type) {
// Add the type names and other type properties (such as `optional`).
// Don't overwrite existing properties.
@ -112,9 +114,9 @@ exports.setDocletTypeToValueType = (doclet, { value }) => {
}
});
}
};
}
exports.setNameToFile = (doclet) => {
export function setNameToFile(doclet) {
let docletName;
if (doclet.meta.filename) {
@ -122,29 +124,29 @@ exports.setNameToFile = (doclet) => {
filepathMinusPrefix(doclet.meta.path, doclet.dependencies.get('env')) + doclet.meta.filename;
doclet.addTag('name', docletName);
}
};
}
exports.setDocletMemberof = (doclet, { value }) => {
export function setDocletMemberof(doclet, { value }) {
if (value && value !== '<global>') {
doclet.setMemberof(value);
}
};
}
exports.applyNamespaceToTag = (docletOrNs, tag) => {
export function applyNamespaceToTag(docletOrNs, tag) {
if (typeof docletOrNs === 'string') {
// ns
tag.value = applyNamespace(tag.value, docletOrNs);
tag.value = name.applyNamespace(tag.value, docletOrNs);
} else {
// doclet
if (!docletOrNs.name) {
return; // error?
}
docletOrNs.longname = applyNamespace(docletOrNs.name, tag.title);
docletOrNs.longname = name.applyNamespace(docletOrNs.name, tag.title);
}
};
}
exports.setDocletNameToFilename = (doclet) => {
export function setDocletNameToFilename(doclet) {
let docletName = '';
if (doclet.meta.path) {
@ -154,15 +156,15 @@ exports.setDocletNameToFilename = (doclet) => {
docletName += doclet.meta.filename.replace(/\.js$/i, '');
doclet.name = docletName;
};
}
exports.parseTypeText = (text) => {
export function parseTypeText(text) {
const tagType = parseTagType(text, false, true);
return tagType.typeExpression || text;
};
}
exports.parseBorrows = (doclet, { text }) => {
export function parseBorrows(doclet, { text }) {
const m = /^([\s\S]+?)(?:\s+as\s+([\s\S]+))?$/.exec(text);
if (m) {
@ -181,9 +183,9 @@ exports.parseBorrows = (doclet, { text }) => {
} else {
return {};
}
};
}
exports.firstWordOf = (string) => {
export function firstWordOf(string) {
const m = /^(\S+)/.exec(string);
if (m) {
@ -191,9 +193,9 @@ exports.firstWordOf = (string) => {
} else {
return '';
}
};
}
exports.combineTypes = ({ value }) => {
export function combineTypes({ value }) {
let combined;
if (value && value.type) {
@ -205,4 +207,4 @@ exports.combineTypes = ({ value }) => {
}
return combined;
};
}

View File

@ -14,8 +14,9 @@
limitations under the License.
*/
/** @module @jsdoc/tag/lib/dictionary */
const definitions = require('./definitions');
const { log } = require('@jsdoc/util');
import { log } from '@jsdoc/util';
import definitions from './definitions/index.js';
const DEFINITIONS = {
closure: 'closure',
@ -48,10 +49,7 @@ class TagDefinition {
}
}
/**
* @memberof module:jsdoc/tag/dictionary
*/
class Dictionary {
export class Dictionary {
constructor() {
// TODO: Consider adding internal tags in the constructor, ideally as fallbacks that aren't
// used to confirm whether a tag is defined/valid, rather than requiring every set of tag
@ -182,5 +180,3 @@ class Dictionary {
return canonicalName;
}
}
exports.Dictionary = Dictionary;

View File

@ -73,7 +73,9 @@ function regExpFactory(tagName = '\\S+', prefix = '', suffix = '') {
* @returns {boolean} Set to `true` if the string is a valid inline tag or `false` in all other
* cases.
*/
exports.isInlineTag = (string, tagName) => regExpFactory(tagName, '^', '$').test(string);
export function isInlineTag(string, tagName) {
return regExpFactory(tagName, '^', '$').test(string);
}
/**
* Replace all instances of multiple inline tags with other text.
@ -85,7 +87,7 @@ exports.isInlineTag = (string, tagName) => regExpFactory(tagName, '^', '$').test
* @return {module:@jsdoc/tag.inline.InlineTagResult} The updated string, as well as information
* about the inline tags that were found.
*/
const replaceInlineTags = (exports.replaceInlineTags = (string, replacers) => {
export function replaceInlineTags(string, replacers) {
const tagInfo = [];
function replaceMatch(replacer, tag, match, text) {
@ -121,7 +123,7 @@ const replaceInlineTags = (exports.replaceInlineTags = (string, replacers) => {
tags: tagInfo,
newString: string.trim(),
};
});
}
/**
* Replace all instances of an inline tag with other text.
@ -133,13 +135,13 @@ const replaceInlineTags = (exports.replaceInlineTags = (string, replacers) => {
* @return {module:@jsdoc/tag.inline.InlineTagResult} The updated string, as well as information
* about the inline tags that were found.
*/
const replaceInlineTag = (exports.replaceInlineTag = (string, tag, replacer) => {
export function replaceInlineTag(string, tag, replacer) {
const replacers = {};
replacers[tag] = replacer;
return replaceInlineTags(string, replacers);
});
}
/**
* Extract inline tags from a string, replacing them with an empty string.
@ -149,5 +151,6 @@ const replaceInlineTag = (exports.replaceInlineTag = (string, tag, replacer) =>
* @return {module:@jsdoc/tag.inline.InlineTagResult} The updated string, as well as information
* about the inline tags that were found.
*/
exports.extractInlineTag = (string, tag) =>
replaceInlineTag(string, tag, (str, { completeTag }) => str.replace(completeTag, ''));
export function extractInlineTag(string, tag) {
return replaceInlineTag(string, tag, (str, { completeTag }) => str.replace(completeTag, ''));
}

Some files were not shown because too many files have changed in this diff Show More