Socket
Socket
Sign inDemoInstall

typedoc

Package Overview
Dependencies
Maintainers
5
Versions
309
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typedoc - npm Package Compare versions

Comparing version 0.23.7 to 0.23.8

8

dist/lib/converter/converter.d.ts

@@ -7,2 +7,3 @@ import * as ts from "typescript";

import { ChildableComponent } from "../utils/component";
import { MinimalSourceFile } from "../utils";
import type { DocumentationEntryPoint } from "../utils/entry-point";

@@ -55,3 +56,4 @@ import { CommentParserConfig } from "./comments";

* Triggered when the converter has created a signature reflection.
* The listener will be given {@link Context}, {@link SignatureReflection} | {@link ProjectReflection} and a `ts.Node?`
* The listener will be given {@link Context}, {@link SignatureReflection} | {@link ProjectReflection} and
* `ts.SignatureDeclaration | ts.IndexSignatureDeclaration | ts.JSDocSignature | undefined`
* @event

@@ -109,2 +111,6 @@ */

/**
* Parse the given file into a comment. Intended to be used with markdown files.
*/
parseRawComment(file: MinimalSourceFile): import("../models/index").Comment;
/**
* Compile the files within the given context and convert the compiler symbols to reflections.

@@ -111,0 +117,0 @@ *

@@ -64,2 +64,8 @@ "use strict";

/**
* Parse the given file into a comment. Intended to be used with markdown files.
*/
parseRawComment(file) {
return (0, parser_1.parseComment)((0, rawLexer_1.lexCommentString)(file.text), this.config, file, this.application.logger);
}
/**
* Compile the files within the given context and convert the compiler symbols to reflections.

@@ -114,3 +120,3 @@ *

const readme = (0, utils_1.readFile)(entryPoint.readmeFile);
const comment = (0, parser_1.parseComment)((0, rawLexer_1.lexCommentString)(readme), context.converter.config, new utils_1.MinimalSourceFile(readme, entryPoint.readmeFile), context.logger);
const comment = this.parseRawComment(new utils_1.MinimalSourceFile(readme, entryPoint.readmeFile));
if (comment.blockTags.length || comment.modifierTags.size) {

@@ -211,3 +217,4 @@ const ignored = [

* Triggered when the converter has created a signature reflection.
* The listener will be given {@link Context}, {@link SignatureReflection} | {@link ProjectReflection} and a `ts.Node?`
* The listener will be given {@link Context}, {@link SignatureReflection} | {@link ProjectReflection} and
* `ts.SignatureDeclaration | ts.IndexSignatureDeclaration | ts.JSDocSignature | undefined`
* @event

@@ -214,0 +221,0 @@ */

2

dist/lib/converter/factories/signature.js

@@ -52,3 +52,3 @@ "use strict";

}
context.trigger(converter_events_1.ConverterEvents.CREATE_SIGNATURE, sigRef);
context.trigger(converter_events_1.ConverterEvents.CREATE_SIGNATURE, sigRef, declaration);
}

@@ -55,0 +55,0 @@ exports.createSignature = createSignature;

@@ -177,5 +177,5 @@ "use strict";

// remove functions with empty signatures after their signatures have been removed
const [allRemoved, someRemoved] = (0, utils_1.partition)((0, utils_1.filterMap)(hidden, (reflection) => reflection.parent?.kindOf(models_1.ReflectionKind.FunctionOrMethod | models_1.ReflectionKind.Constructor)
const [allRemoved, someRemoved] = (0, utils_1.partition)((0, utils_1.unique)((0, utils_1.filterMap)(hidden, (reflection) => reflection.parent?.kindOf(models_1.ReflectionKind.SignatureContainer)
? reflection.parent
: void 0), (method) => method.signatures?.length === 0);
: void 0)), (method) => method.getNonIndexSignatures().length === 0);
allRemoved.forEach((reflection) => {

@@ -185,3 +185,5 @@ project.removeReflection(reflection);

someRemoved.forEach((reflection) => {
reflection.sources = (0, utils_1.unique)(reflection.signatures.flatMap((s) => s.sources ?? []));
reflection.sources = reflection
.getNonIndexSignatures()
.flatMap((s) => s.sources ?? []);
});

@@ -287,4 +289,5 @@ }

if (this.excludeNotDocumented) {
// Only allow excludeNotDocumented to exclude root level reflections
if (!(reflection instanceof models_1.DeclarationReflection)) {
// Don't let excludeNotDocumented remove parameters.
if (!(reflection instanceof models_1.DeclarationReflection) &&
!(reflection instanceof models_1.SignatureReflection)) {
return false;

@@ -303,2 +306,8 @@ }

}
// signature containers should only be hidden if all their signatures are hidden
if (reflection.kindOf(models_1.ReflectionKind.SignatureContainer)) {
return reflection
.getAllSignatures()
.every((child) => this.isHidden(child));
}
// excludeNotDocumented should never hide parts of "type" reflections

@@ -305,0 +314,0 @@ return inTypeLiteral(reflection) === false;

@@ -180,2 +180,6 @@ "use strict";

const end = part.text.length;
while (pos < end && ts.isWhiteSpaceLike(part.text.charCodeAt(pos))) {
pos++;
}
const origText = part.text;
// Try to parse one

@@ -189,2 +193,10 @@ const declRef = (0, declarationReference_1.parseDeclarationReference)(part.text, pos, end);

}
if (!target) {
if (urlPrefix.test(part.text)) {
const wsIndex = part.text.search(/\s/);
target =
wsIndex === -1 ? part.text : part.text.substring(0, wsIndex);
pos = target.length;
}
}
// If resolution via a declaration reference failed, revert to the legacy "split and check"

@@ -195,3 +207,3 @@ // method... this should go away in 0.24, once people have had a chance to migrate any failing links.

if (resolved) {
warn(`Failed to resolve {@link ${part.text}} in ${reflection.getFriendlyFullName()} with declaration references. This link will break in v0.24.`);
warn(`Failed to resolve {@link ${origText}} in ${reflection.getFriendlyFullName()} with declaration references. This link will break in v0.24.`);
}

@@ -209,3 +221,5 @@ return resolved;

part.target = target;
part.text = part.text.substring(pos).trim() || target.name;
part.text =
part.text.substring(pos).trim() ||
(typeof target === "string" ? target : target.name);
return part;

@@ -212,0 +226,0 @@ }

@@ -17,4 +17,2 @@ "use strict";

const paths_1 = require("../../utils/paths");
const rawLexer_1 = require("../comments/rawLexer");
const parser_1 = require("../comments/parser");
const minimalSourceFile_1 = require("../../utils/minimalSourceFile");

@@ -80,3 +78,3 @@ /**

const readme = (0, utils_1.readFile)(this.readmeFile);
const comment = (0, parser_1.parseComment)((0, rawLexer_1.lexCommentString)(readme), context.converter.config, new minimalSourceFile_1.MinimalSourceFile(readme, this.readmeFile), context.logger);
const comment = context.converter.parseRawComment(new minimalSourceFile_1.MinimalSourceFile(readme, this.readmeFile));
if (comment.blockTags.length || comment.modifierTags.size) {

@@ -83,0 +81,0 @@ const ignored = [

@@ -36,2 +36,3 @@ import { ConverterComponent } from "../components";

private onDeclaration;
private onSignature;
/**

@@ -38,0 +39,0 @@ * Triggered when the converter begins resolving a project.

@@ -45,3 +45,3 @@ "use strict";

[converter_1.Converter.EVENT_CREATE_DECLARATION]: this.onDeclaration,
[converter_1.Converter.EVENT_CREATE_SIGNATURE]: this.onDeclaration,
[converter_1.Converter.EVENT_CREATE_SIGNATURE]: this.onSignature,
[converter_1.Converter.EVENT_RESOLVE_BEGIN]: this.onBeginResolve,

@@ -81,2 +81,12 @@ });

}
onSignature(_context, reflection, sig) {
if (this.disableSources || !sig)
return;
const sourceFile = sig.getSourceFile();
const fileName = sourceFile.fileName;
this.fileNames.add(fileName);
const position = ts.getLineAndCharacterOfPosition(sourceFile, sig.getStart());
reflection.sources || (reflection.sources = []);
reflection.sources.push(new models_1.SourceReference(fileName, position.line + 1, position.character));
}
/**

@@ -83,0 +93,0 @@ * Triggered when the converter begins resolving a project.

@@ -47,3 +47,3 @@ "use strict";

for (let i = 0, c = repoLinks.length; i < c; i++) {
let match = /(github(?:\.[a-z]+)*\.[a-z]{2,})[:/]([^/]+)\/(.*)/.exec(repoLinks[i]);
let match = /(github(?!.us)(?:\.[a-z]+)*\.[a-z]{2,})[:/]([^/]+)\/(.*)/.exec(repoLinks[i]);
// Github Enterprise

@@ -53,3 +53,11 @@ if (!match) {

}
// Github Enterprise
if (!match) {
match = /(\w+\.ghe.com)[:/]([^/]+)\/(.*)/.exec(repoLinks[i]);
}
// Github Enterprise
if (!match) {
match = /(\w+\.github.us)[:/]([^/]+)\/(.*)/.exec(repoLinks[i]);
}
if (!match) {
match = /(bitbucket.org)[:/]([^/]+)\/(.*)/.exec(repoLinks[i]);

@@ -56,0 +64,0 @@ }

@@ -48,2 +48,7 @@ /**

const ContainsCallSignatures: number;
/**
* Note: This does not include Class/Interface, even though they technically could contain index signatures
* @internal
*/
const SignatureContainer: number;
}

@@ -81,2 +81,7 @@ "use strict";

ReflectionKind.Method;
/**
* Note: This does not include Class/Interface, even though they technically could contain index signatures
* @internal
*/
ReflectionKind.SignatureContainer = ReflectionKind.ContainsCallSignatures | ReflectionKind.Accessor;
})(ReflectionKind = exports.ReflectionKind || (exports.ReflectionKind = {}));

@@ -39,3 +39,4 @@ "use strict";

props.model.indexSignature?.type instanceof models_1.ReflectionType &&
context.parameter(props.model.indexSignature.type.declaration))))),
context.parameter(props.model.indexSignature.type.declaration))),
!props.model.signatures && context.memberSources(props.model))),
!!props.model.children?.length && context.index(props.model),

@@ -42,0 +43,0 @@ context.members(props.model)));

{
"name": "typedoc",
"description": "Create api documentation for TypeScript projects.",
"version": "0.23.7",
"version": "0.23.8",
"homepage": "https://typedoc.org",

@@ -6,0 +6,0 @@ "main": "./dist/index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc