Socket
Socket
Sign inDemoInstall

@compodoc/compodoc

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@compodoc/compodoc - npm Package Compare versions

Comparing version 1.1.15 to 1.1.16

.tmp-compodoc-test-big-app/test-config-file/classes/ABOUT_ENUMS.html

16

.tmp-compodoc-test-big-app/src/app/about/about.component.ts

@@ -20,2 +20,4 @@ import { Component, HostListener, Input } from '@angular/core';

*/
@testDecorator
@UntilDestroy()
@Component({

@@ -42,2 +44,8 @@ selector: 'about',

/**
* Dummy input property with a custom decorator
*/
@MyCustomInputDecorator()
@Input() public myInput: string;
chartOptions: Highcharts.Options = {

@@ -96,2 +104,6 @@ colors: [

/**
* This is for testing
* @returns '', if this {@link AboutComponent.fullName} does not crash
*/
public publicMethod(): string {

@@ -101,3 +113,7 @@ return '';

/**
* This is for testing
* @returns a promise, if this {@link undefined} does not crash
*/
public async foo(): Promise<any> {}
}

2

.tmp-compodoc-test-big-app/src/app/header/header.component.ts

@@ -52,3 +52,3 @@ import { Component, Input } from '@angular/core';

/**
* Setter of _fullName
* Setter of _fullName {@link https://compodoc.app/}
* @param {string} newName The new name

@@ -55,0 +55,0 @@ */

@@ -169,3 +169,3 @@ import { Injectable } from '@angular/core';

/**
* Getter of _fullName
* Getter of _fullName or link to {@link Todo}
* @deprecated This getter is deprecated

@@ -179,3 +179,3 @@ * @return {string} _fullName value

/**
* Setter of _fullName
* Setter of _fullName ore link to {@link Todo}
* @deprecated This setter is deprecated

@@ -182,0 +182,0 @@ * @param {string} newName The new name

@@ -5,3 +5,3 @@ 'use strict';

var indexCli = require('./index-cli-8ef9c2ed.js');
var indexCli = require('./index-cli-298ea115.js');
require('fs-extra');

@@ -8,0 +8,0 @@ require('path');

@@ -5,3 +5,3 @@ 'use strict';

var indexCli = require('./index-cli-8ef9c2ed.js');
var indexCli = require('./index-cli-298ea115.js');
require('fs-extra');

@@ -8,0 +8,0 @@ require('path');

{
"name": "@compodoc/compodoc",
"version": "1.1.15",
"version": "1.1.16",
"description": "The missing documentation tool for your Angular application",

@@ -70,4 +70,4 @@ "main": "dist/index.js",

"dependencies": {
"@babel/core": "^7.15.5",
"@babel/preset-env": "^7.15.5",
"@babel/core": "^7.16.0",
"@babel/preset-env": "^7.16.4",
"@compodoc/live-server": "^1.2.2",

@@ -79,3 +79,3 @@ "@compodoc/ngd-transformer": "^2.1.0",

"colors": "^1.4.0",
"commander": "^8.2.0",
"commander": "^8.3.0",
"cosmiconfig": "^7.0.1",

@@ -86,20 +86,20 @@ "decache": "^4.6.0",

"fs-extra": "^10.0.0",
"glob": "^7.1.7",
"glob": "^7.2.0",
"handlebars": "^4.7.7",
"html-entities": "^2.3.2",
"i18next": "^20.6.1",
"i18next": "^21.5.2",
"inside": "^1.0.0",
"json5": "^2.2.0",
"lodash": "^4.17.21",
"loglevel": "^1.7.1",
"loglevel": "^1.8.0",
"loglevel-plugin-prefix": "^0.8.4",
"lunr": "^2.3.9",
"marked": "^3.0.4",
"marked": "^4.0.4",
"minimist": "^1.2.5",
"opencollective-postinstall": "^2.0.3",
"os-name": "4.0.1",
"pdfmake": "^0.2.2",
"pdfmake": "^0.2.4",
"semver": "^7.3.5",
"traverse": "^0.6.6",
"ts-morph": "^12.0.0",
"ts-morph": "^13.0.1",
"uuid": "^8.3.2"

@@ -106,0 +106,0 @@ },

@@ -9,5 +9,2 @@ <p align="center">

<br/>
<a href="https://david-dm.org/compodoc/compodoc"><img src="https://david-dm.org/compodoc/compodoc.svg" alt="npm dependencies"/></a>
<a href="https://david-dm.org/compodoc/compodoc?type=dev"><img src="https://david-dm.org/compodoc/compodoc/dev-status.svg" alt="npm devDependencies"/></a>
<br/>
<a href="https://npmcharts.com/compare/@compodoc/compodoc?minimal=true"><img src="https://img.shields.io/npm/dm/@compodoc/compodoc.svg?style=flat" alt="NPM Downloads"/></a>

@@ -124,3 +121,3 @@ <a href="https://opensource.org/licenses/MIT"><img src="http://img.shields.io/badge/license-MIT-brightgreen.svg" alt="MIT badge"/></a>

[backers-image]: https://opencollective.com/compodoc/backers.svg
[sponsors-image]: https://opencollective.com/compodoc/sponsors.svg
[sponsors-image]: https://opencollective.com/compodoc/sponsor.svg
[github-action-badge]: https://github.com/compodoc/compodoc/workflows/CI/badge.svg

@@ -14,3 +14,3 @@ import { cleanLifecycleHooksFromMethods } from '../../../../utils';

let sourceCode = srcFile.getText();
let hash = crypto.createHash('md5').update(sourceCode).digest('hex');
let hash = crypto.createHash('sha512').update(sourceCode).digest('hex');
let componentDep: IComponentDep = {

@@ -17,0 +17,0 @@ name,

@@ -17,3 +17,3 @@ import { IDep } from '../dependencies.interfaces';

const sourceCode = srcFile.getText();
const hash = crypto.createHash('md5').update(sourceCode).digest('hex');
const hash = crypto.createHash('sha512').update(sourceCode).digest('hex');
let infos: IControllerDep = {

@@ -20,0 +20,0 @@ name,

@@ -13,3 +13,3 @@ import { IDep } from '../dependencies.interfaces';

let sourceCode = srcFile.getText();
let hash = crypto.createHash('md5').update(sourceCode).digest('hex');
let hash = crypto.createHash('sha512').update(sourceCode).digest('hex');
let directiveDeps: IDirectiveDep = {

@@ -16,0 +16,0 @@ name,

@@ -17,3 +17,3 @@ import * as _ from 'lodash';

const crypto = require('crypto');
const marked = require('marked');
const { marked } = require('marked');

@@ -279,6 +279,10 @@ export class ClassHelper {

if (nodeAccessor.jsDoc && nodeAccessor.jsDoc.length >= 1) {
let comment = nodeAccessor.jsDoc[0].comment;
const comment = this.jsdocParserUtil.getMainCommentOfNode(
nodeAccessor,
sourceFile
);
if (typeof comment !== 'undefined') {
setSignature.rawdescription = comment;
setSignature.description = marked(comment);
const cleanedDescription = this.jsdocParserUtil.parseComment(comment);
setSignature.rawdescription = cleanedDescription;
setSignature.description = marked(cleanedDescription);
}

@@ -311,6 +315,10 @@ }

if (nodeAccessor.jsDoc && nodeAccessor.jsDoc.length >= 1) {
let comment = nodeAccessor.jsDoc[0].comment;
const comment = this.jsdocParserUtil.getMainCommentOfNode(
nodeAccessor,
sourceFile
);
if (typeof comment !== 'undefined') {
getSignature.rawdescription = comment;
getSignature.description = marked(comment);
const cleanedDescription = this.jsdocParserUtil.parseComment(comment);
getSignature.rawdescription = cleanedDescription;
getSignature.description = marked(cleanedDescription);
}

@@ -436,5 +444,12 @@ }

private isControllerDecorator(decorator) {
return decorator.expression.expression
? decorator.expression.expression.text === 'Controller'
: false;
}
private isModuleDecorator(decorator) {
return decorator.expression.expression
? decorator.expression.expression.text === 'NgModule'
? decorator.expression.expression.text === 'NgModule' ||
decorator.expression.expression.text === 'Module'
: false;

@@ -521,5 +536,46 @@ }

if (classDeclaration.decorators) {
for (let i = 0; i < classDeclaration.decorators.length; i++) {
if (this.isDirectiveDecorator(classDeclaration.decorators[i])) {
return {
// Loop and search for official decorators at top-level :
// Angular : @NgModule, @Component, @Directive, @Injectable, @Pipe
// Nestjs : @Controller, @Module, @Injectable
// Stencil : @Component
let isDirective = false;
let isService = false;
let isPipe = false;
let isModule = false;
let isController = false;
for (let a = 0; a < classDeclaration.decorators.length; a++) {
//console.log(classDeclaration.decorators[i].expression);
// RETURN TOO EARLY FOR MANY DECORATORS !!!!
isDirective = this.isDirectiveDecorator(classDeclaration.decorators[a]);
isService = this.isServiceDecorator(classDeclaration.decorators[a]);
isPipe = this.isPipeDecorator(classDeclaration.decorators[a]);
isModule = this.isModuleDecorator(classDeclaration.decorators[a]);
isController = this.isControllerDecorator(classDeclaration.decorators[a]);
}
if (isDirective) {
return {
deprecated,
deprecationMessage,
description,
rawdescription: rawdescription,
inputs: members.inputs,
outputs: members.outputs,
hostBindings: members.hostBindings,
hostListeners: members.hostListeners,
properties: members.properties,
methods: members.methods,
indexSignatures: members.indexSignatures,
kind: members.kind,
constructor: members.constructor,
jsdoctags: jsdoctags,
extends: extendsElement,
implements: implementsElements,
accessors: members.accessors
};
} else if (isService) {
return [
{
fileName,
className,
deprecated,

@@ -529,9 +585,50 @@ deprecationMessage,

rawdescription: rawdescription,
inputs: members.inputs,
outputs: members.outputs,
hostBindings: members.hostBindings,
hostListeners: members.hostListeners,
methods: members.methods,
indexSignatures: members.indexSignatures,
properties: members.properties,
kind: members.kind,
constructor: members.constructor,
jsdoctags: jsdoctags,
extends: extendsElement,
implements: implementsElements,
accessors: members.accessors
}
];
} else if (isPipe) {
return [
{
fileName,
className,
deprecated,
deprecationMessage,
description,
rawdescription: rawdescription,
jsdoctags: jsdoctags,
properties: members.properties,
methods: members.methods
}
];
} else if (isModule) {
return [
{
fileName,
className,
deprecated,
deprecationMessage,
description,
rawdescription: rawdescription,
jsdoctags: jsdoctags,
methods: members.methods
}
];
} else {
return [
{
deprecated,
deprecationMessage,
description,
rawdescription: rawdescription,
methods: members.methods,
indexSignatures: members.indexSignatures,
properties: members.properties,
kind: members.kind,

@@ -543,69 +640,4 @@ constructor: members.constructor,

accessors: members.accessors
};
} else if (this.isServiceDecorator(classDeclaration.decorators[i])) {
return [
{
fileName,
className,
deprecated,
deprecationMessage,
description,
rawdescription: rawdescription,
methods: members.methods,
indexSignatures: members.indexSignatures,
properties: members.properties,
kind: members.kind,
constructor: members.constructor,
jsdoctags: jsdoctags,
extends: extendsElement,
implements: implementsElements,
accessors: members.accessors
}
];
} else if (this.isPipeDecorator(classDeclaration.decorators[i])) {
return [
{
fileName,
className,
deprecated,
deprecationMessage,
description,
rawdescription: rawdescription,
jsdoctags: jsdoctags,
properties: members.properties,
methods: members.methods
}
];
} else if (this.isModuleDecorator(classDeclaration.decorators[i])) {
return [
{
fileName,
className,
deprecated,
deprecationMessage,
description,
rawdescription: rawdescription,
jsdoctags: jsdoctags,
methods: members.methods
}
];
} else {
return [
{
deprecated,
deprecationMessage,
description,
rawdescription: rawdescription,
methods: members.methods,
indexSignatures: members.indexSignatures,
properties: members.properties,
kind: members.kind,
constructor: members.constructor,
jsdoctags: jsdoctags,
extends: extendsElement,
implements: implementsElements,
accessors: members.accessors
}
];
}
}
];
}

@@ -994,3 +1026,3 @@ } else if (description) {

let sourceCode = sourceFile.getText();
let hash = crypto.createHash('md5').update(sourceCode).digest('hex');
let hash = crypto.createHash('sha512').update(sourceCode).digest('hex');
let result: any = {

@@ -1023,3 +1055,3 @@ id: 'call-declaration-' + hash,

let sourceCode = sourceFile.getText();
let hash = crypto.createHash('md5').update(sourceCode).digest('hex');
let hash = crypto.createHash('sha512').update(sourceCode).digest('hex');
let result = {

@@ -1416,7 +1448,9 @@ id: 'index-declaration-' + hash,

if (typeof property.jsDoc[0].comment !== 'undefined') {
const rawDescription = this.jsdocParserUtil.parseJSDocNode(
property.jsDoc[0]
const comment = this.jsdocParserUtil.getMainCommentOfNode(
property,
sourceFile
);
_return.rawdescription = rawDescription;
_return.description = marked(rawDescription);
const cleanedDescription = this.jsdocParserUtil.parseComment(comment);
_return.rawdescription = cleanedDescription;
_return.description = marked(cleanedDescription);
}

@@ -1460,2 +1494,7 @@ }

}
if (property.decorators) {
_return.decorators = this.formatDecorators(property.decorators).filter(
item => item.name !== 'Input' && item.name !== 'HostBinding'
);
}
return _return;

@@ -1462,0 +1501,0 @@ }

@@ -19,3 +19,3 @@ import { ts } from 'ts-morph';

let sourceCode = srcFile.getText();
let hash = crypto.createHash('md5').update(sourceCode).digest('hex');
let hash = crypto.createHash('sha512').update(sourceCode).digest('hex');
return {

@@ -22,0 +22,0 @@ name,

@@ -26,2 +26,3 @@ import * as _ from 'lodash';

hideGenerator: false,
hideDarkModeToggle: false,
hasFilesToCoverage: false,

@@ -28,0 +29,0 @@ modules: [],

@@ -22,2 +22,10 @@ import { IHtmlEngineHelper, IHandlebarsOptions } from './html-engine-helper.interface';

});
module.bootstrap.forEach(boostrapedElement => {
if (boostrapedElement.id === element.id) {
foundInOneModule = true;
}
if (boostrapedElement.file === element.file) {
foundInOneModule = true;
}
});
module.controllers.forEach(controller => {

@@ -24,0 +32,0 @@ if (controller.id === element.id) {

@@ -16,3 +16,4 @@ import i18next from 'i18next';

TRANSLATION_SK_SK,
TRANSLATION_ZH_CN
TRANSLATION_ZH_CN,
TRANSLATION_ZH_TW
} from '../../locales';

@@ -43,3 +44,4 @@

'sk-SK': 'sk-SK',
'zh-CN': 'zh-CN'
'zh-CN': 'zh-CN',
'zh-TW': 'zh-TW'
};

@@ -52,3 +54,6 @@

lng: language,
fallbackLng: this.fallbackLanguage
fallbackLng: this.fallbackLanguage,
interpolation: {
skipOnVariables: false
}
});

@@ -68,2 +73,3 @@ i18next.addResources('de-DE', 'translation', TRANSLATION_DE_DE);

i18next.addResources('zh-CN', 'translation', TRANSLATION_ZH_CN);
i18next.addResources('zh-TW', 'translation', TRANSLATION_ZH_TW);
}

@@ -70,0 +76,0 @@

@@ -25,3 +25,4 @@ import * as fs from 'fs-extra';

decache('marked');
this.markedInstance = require('marked');
const { marked } = require('marked');
this.markedInstance = marked;

@@ -52,3 +53,3 @@ const renderer = new this.markedInstance.Renderer();

renderer.image = function(href: string, title: string, text: string) {
renderer.image = function (href: string, title: string, text: string) {
let out = '<img src="' + href + '" alt="' + text + '" class="img-responsive"';

@@ -55,0 +56,0 @@ if (title) {

@@ -59,2 +59,4 @@ import * as fs from 'fs-extra';

Configuration.mainData.hideDarkModeToggle = true;
if (!Configuration.mainData.hideGenerator) {

@@ -61,0 +63,0 @@ docDefinition.content.push({

@@ -14,3 +14,4 @@ import * as _ from 'lodash';

decache('marked');
this.markedInstance = require('marked');
const { marked } = require('marked');
this.markedInstance = marked;

@@ -17,0 +18,0 @@ const renderer = new this.markedInstance.Renderer();

@@ -21,2 +21,3 @@ export interface ConfigurationFileInterface {

hideGenerator: boolean;
hideDarkModeToggle: boolean;
coverageTest: number;

@@ -23,0 +24,0 @@ coverageMinimumPerFile: number;

@@ -17,2 +17,3 @@ import { CoverageData } from './coverageData.interface';

hideGenerator: boolean;
hideDarkModeToggle: boolean;
hasFilesToCoverage: boolean;

@@ -19,0 +20,0 @@ modules: any;

@@ -12,5 +12,3 @@ {

"default": "",
"examples": [
".compodocrc"
]
"examples": [".compodocrc"]
},

@@ -22,5 +20,3 @@ "tsconfig": {

"default": "",
"examples": [
""
]
"examples": [""]
},

@@ -32,5 +28,3 @@ "output": {

"default": "documentation",
"examples": [
""
]
"examples": [""]
},

@@ -42,5 +36,3 @@ "extTheme": {

"default": "",
"examples": [
""
]
"examples": [""]
},

@@ -52,5 +44,3 @@ "name": {

"default": "Application documentation",
"examples": [
""
]
"examples": [""]
},

@@ -62,5 +52,3 @@ "language": {

"default": "en-US",
"examples": [
""
]
"examples": [""]
},

@@ -72,5 +60,3 @@ "assetsFolder": {

"default": "",
"examples": [
""
]
"examples": [""]
},

@@ -82,5 +68,3 @@ "open": {

"default": false,
"examples": [
false
]
"examples": [false]
},

@@ -92,5 +76,3 @@ "silent": {

"default": false,
"examples": [
false
]
"examples": [false]
},

@@ -102,5 +84,3 @@ "serve": {

"default": false,
"examples": [
true
]
"examples": [true]
},

@@ -112,5 +92,3 @@ "port": {

"default": 0,
"examples": [
8080
]
"examples": [8080]
},

@@ -122,5 +100,3 @@ "watch": {

"default": false,
"examples": [
false
]
"examples": [false]
},

@@ -132,5 +108,3 @@ "exportFormat": {

"default": "",
"examples": [
"html"
]
"examples": ["html"]
},

@@ -142,5 +116,3 @@ "files": {

"default": "",
"examples": [
"src/myapp.component.ts"
]
"examples": ["src/myapp.component.ts"]
},

@@ -152,5 +124,3 @@ "theme": {

"default": "gitbook",
"examples": [
""
]
"examples": [""]
},

@@ -162,6 +132,11 @@ "hideGenerator": {

"default": false,
"examples": [
false
]
"examples": [false]
},
"hideDarkModeToggle": {
"$id": "/properties/hideDarkModeToggle",
"type": "boolean",
"title": "Do not show dark mode toggle button at the top right position of the page",
"default": false,
"examples": [false]
},
"toggleMenuItems": {

@@ -175,5 +150,3 @@ "$id": "/properties/toggleMenuItems",

"default": "",
"examples": [
"all"
]
"examples": ["all"]
}

@@ -193,5 +166,3 @@ },

"default": "",
"examples": [
""
]
"examples": [""]
},

@@ -203,5 +174,3 @@ "label": {

"default": "",
"examples": [
""
]
"examples": [""]
}

@@ -216,5 +185,3 @@ }

"default": "",
"examples": [
""
]
"examples": [""]
},

@@ -226,5 +193,3 @@ "includes": {

"default": "",
"examples": [
""
]
"examples": [""]
},

@@ -236,5 +201,3 @@ "includesName": {

"default": "",
"examples": [
""
]
"examples": [""]
},

@@ -246,5 +209,3 @@ "coverageTest": {

"default": 70,
"examples": [
70
]
"examples": [70]
},

@@ -256,5 +217,3 @@ "coverageMinimumPerFile": {

"default": 0,
"examples": [
0
]
"examples": [0]
},

@@ -266,5 +225,3 @@ "coverageTestThresholdFail": {

"default": false,
"examples": [
true
]
"examples": [true]
},

@@ -276,5 +233,3 @@ "disableSourceCode": {

"default": false,
"examples": [
false
]
"examples": [false]
},

@@ -286,5 +241,3 @@ "disableDomTree": {

"default": false,
"examples": [
false
]
"examples": [false]
},

@@ -296,5 +249,3 @@ "disableTemplateTab": {

"default": false,
"examples": [
false
]
"examples": [false]
},

@@ -306,5 +257,3 @@ "disableGraph": {

"default": false,
"examples": [
false
]
"examples": [false]
},

@@ -316,5 +265,3 @@ "disableCoverage": {

"default": false,
"examples": [
false
]
"examples": [false]
},

@@ -326,5 +273,3 @@ "disablePrivate": {

"default": false,
"examples": [
false
]
"examples": [false]
},

@@ -336,5 +281,3 @@ "disableProtected": {

"default": false,
"examples": [
false
]
"examples": [false]
},

@@ -346,5 +289,3 @@ "disableInternal": {

"default": false,
"examples": [
false
]
"examples": [false]
},

@@ -356,5 +297,3 @@ "disableLifeCycleHooks": {

"default": false,
"examples": [
false
]
"examples": [false]
},

@@ -366,5 +305,3 @@ "disableRoutesGraph": {

"default": false,
"examples": [
false
]
"examples": [false]
},

@@ -376,5 +313,3 @@ "disableSearch": {

"default": false,
"examples": [
false
]
"examples": [false]
},

@@ -386,5 +321,3 @@ "disableDependencies": {

"default": false,
"examples": [
false
]
"examples": [false]
},

@@ -396,5 +329,3 @@ "minimal": {

"default": false,
"examples": [
false
]
"examples": [false]
},

@@ -406,5 +337,3 @@ "customFavicon": {

"default": "",
"examples": [
""
]
"examples": [""]
},

@@ -416,5 +345,3 @@ "customLogo": {

"default": "",
"examples": [
""
]
"examples": [""]
},

@@ -426,5 +353,3 @@ "gaID": {

"default": "",
"examples": [
""
]
"examples": [""]
},

@@ -436,7 +361,5 @@ "gaSite": {

"default": "",
"examples": [
""
]
"examples": [""]
}
}
}

@@ -88,3 +88,3 @@ import * as fs from 'fs-extra';

'--language [language]',
'Language used for the generated documentation (de-DE, en-US, es-ES, fr-FR, hu-HU, it-IT, ja-JP, ko-KR, nl-NL, pl-PL, pt-BR, sk-SK, zh-CN)',
'Language used for the generated documentation (de-DE, en-US, es-ES, fr-FR, hu-HU, it-IT, ja-JP, ko-KR, nl-NL, pl-PL, pt-BR, sk-SK, zh-CN, zh-TW)',
COMPODOC_DEFAULTS.language

@@ -102,2 +102,7 @@ )

.option(
'--hideDarkModeToggle',
'Do not show dark mode toggle button at the top right position of the page',
false
)
.option(
'--toggleMenuItems <items>',

@@ -367,2 +372,9 @@ "Close by default items in the menu values : ['all'] or one of these ['modules','components','directives','controllers','classes','injectables','guards','interfaces','interceptors','pipes','miscellaneous','additionalPages']",

if (configFile.hideDarkModeToggle) {
Configuration.mainData.hideDarkModeToggle = configFile.hideDarkModeToggle;
}
if (programOptions.hideDarkModeToggle) {
Configuration.mainData.hideDarkModeToggle = programOptions.hideDarkModeToggle;
}
if (configFile.coverageTest) {

@@ -369,0 +381,0 @@ Configuration.mainData.coverageTest = true;

@@ -13,2 +13,3 @@ export { TRANSLATION_DE_DE } from './de-DE';

export { TRANSLATION_ZH_CN } from './zh-CN';
export { TRANSLATION_ZH_TW } from './zh-TW';
export { TRANSLATION_KO_KR } from './ko-KR';

@@ -8,3 +8,2 @@ document.addEventListener('DOMContentLoaded', function () {

if (COMPODOC_CURRENT_PAGE_CONTEXT !== '') {
localContextInUrl = localContextInUrl;
switch (COMPODOC_CURRENT_PAGE_CONTEXT) {

@@ -141,3 +140,3 @@ case 'additional-page':

options.duration = collapse.getAttribute('data-duration');
new Collapse(collapse, options);
var c = new Collapse(collapse, options);
}

@@ -266,3 +265,50 @@

}
// Dark mode toggle button
var useDark = window.matchMedia('(prefers-color-scheme: dark)');
var darkModeState = useDark.matches;
var $darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input');
var $darkModeToggles = document.querySelectorAll('.dark-mode-switch');
function checkToggle(check) {
for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
$darkModeToggleSwitchers[i].checked = check;
}
}
function toggleDarkMode(state) {
checkToggle(state);
const hasClass = document.body.classList.contains('dark');
if (state) {
for (var i = 0; i < $darkModeToggles.length; i++) {
$darkModeToggles[i].classList.add('dark');
}
if (!hasClass) {
document.body.classList.add('dark');
}
} else {
for (var i = 0; i < $darkModeToggles.length; i++) {
$darkModeToggles[i].classList.remove('dark');
}
if (hasClass) {
document.body.classList.remove('dark');
}
}
}
useDark.addEventListener('change', function (evt) {
toggleDarkMode(evt.matches);
});
toggleDarkMode(darkModeState);
if ($darkModeToggles.length > 0) {
for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
$darkModeToggleSwitchers[i].addEventListener('change', function (event) {
darkModeState = !darkModeState;
toggleDarkMode(darkModeState);
});
}
}
}, 0);
});

@@ -274,4 +274,7 @@ import * as _ from 'lodash';

if (JSDocNode.name) {
rawDescription +=
JSDocNode.text + '{@link ' + JSDocNode.name.escapedText + '}';
let text = JSDocNode.name.escapedText;
if (text === undefined && JSDocNode.name.left && JSDocNode.name.right) {
text = JSDocNode.name.left.escapedText + '.' + JSDocNode.name.right.escapedText;
}
rawDescription += JSDocNode.text + '{@link ' + text + '}';
}

@@ -278,0 +281,0 @@ break;

@@ -67,2 +67,5 @@ export function extractLeadingText(string, completeTag) {

}
if (linkText === '' || linkText == null || target == null) {
return string;
}

@@ -69,0 +72,0 @@ return string.replace(stringtoReplace, '[' + linkText + '](' + target + ')');

@@ -5,3 +5,3 @@ import * as Handlebars from 'handlebars';

import * as path from 'path';
import { Project, ts, SourceFile, SyntaxKind, TypeGuards } from 'ts-morph';
import { Project, ts, SourceFile, SyntaxKind, Node } from 'ts-morph';

@@ -483,4 +483,4 @@ import FileEngine from '../app/engines/file.engine';

return (
TypeGuards.isArrayLiteralExpression(p.getParentOrThrow()) ||
TypeGuards.isPropertyAssignment(p.getParentOrThrow())
Node.isArrayLiteralExpression(p.getParentOrThrow()) ||
Node.isPropertyAssignment(p.getParentOrThrow())
);

@@ -513,6 +513,6 @@ });

if (
!TypeGuards.isPropertyAssignment(identifierDeclaration) &&
TypeGuards.isVariableDeclaration(identifierDeclaration) &&
TypeGuards.isPropertyAssignment(identifierDeclaration) &&
!TypeGuards.isVariableDeclaration(identifierDeclaration)
!Node.isPropertyAssignment(identifierDeclaration) &&
Node.isVariableDeclaration(identifierDeclaration) &&
Node.isPropertyAssignment(identifierDeclaration) &&
!Node.isVariableDeclaration(identifierDeclaration)
) {

@@ -523,3 +523,3 @@ throw new Error(

}
if (TypeGuards.isVariableDeclaration(identifierDeclaration)) {
if (Node.isVariableDeclaration(identifierDeclaration)) {
identifier.replaceWithText(identifierDeclaration.getInitializerOrThrow().getText());

@@ -536,3 +536,3 @@ }

.getDescendantsOfKind(SyntaxKind.SpreadElement)
.filter(p => TypeGuards.isArrayLiteralExpression(p.getParentOrThrow()));
.filter(p => Node.isArrayLiteralExpression(p.getParentOrThrow()));

@@ -602,8 +602,40 @@ let spreadElementsInRoutesVariableStatement = [];

if (typeof searchedImport !== 'undefined') {
let importPath = path.resolve(
path.dirname(file.getFilePath()) +
'/' +
searchedImport.getModuleSpecifierValue() +
'.ts'
);
const routePathIsBad = (path) => {
return typeof ast.getSourceFile(path) == 'undefined';
};
const getIndicesOf = (searchStr, str, caseSensitive) => {
var searchStrLen = searchStr.length;
if (searchStrLen == 0) {
return [];
}
var startIndex = 0, index, indices = [];
if (!caseSensitive) {
str = str.toLowerCase();
searchStr = searchStr.toLowerCase();
}
while ((index = str.indexOf(searchStr, startIndex)) > -1) {
indices.push(index);
startIndex = index + searchStrLen;
}
return indices;
}
const dirNamePath = path.dirname(file.getFilePath());
const searchedImportPath = searchedImport.getModuleSpecifierValue();
const leadingFilePath = searchedImportPath.split('/').shift();
let importPath = path.resolve(dirNamePath + '/' + searchedImport.getModuleSpecifierValue() + '.ts');
if (routePathIsBad(importPath)) {
let leadingIndices = getIndicesOf(leadingFilePath, importPath, true);
if (leadingIndices.length > 1) { // Nested route fixes
let startIndex = leadingIndices[0];
let endIndex = leadingIndices[leadingIndices.length -1];
importPath = importPath.slice(0, startIndex) + importPath.slice(endIndex);
} else { // Top level route fixes
importPath = path.dirname(dirNamePath) + '/' + searchedImportPath + '.ts';
}
}
const sourceFileImport =

@@ -629,3 +661,3 @@ typeof ast.getSourceFile(importPath) !== 'undefined'

if (!TypeGuards.isVariableDeclaration(referencedDeclaration)) {
if (!Node.isVariableDeclaration(referencedDeclaration)) {
throw new Error(

@@ -657,3 +689,3 @@ `Not implemented referenced declaration kind: ${referencedDeclaration.getKindName()}`

.getDescendantsOfKind(SyntaxKind.PropertyAccessExpression)
.filter(p => !TypeGuards.isPropertyAccessExpression(p.getParentOrThrow()));
.filter(p => !Node.isPropertyAccessExpression(p.getParentOrThrow()));

@@ -689,6 +721,6 @@ let propertyAccessExpressionsInRoutesVariableStatement = [];

if (
!TypeGuards.isPropertyAssignment(referencedDeclaration) &&
TypeGuards.isEnumMember(referencedDeclaration) &&
TypeGuards.isPropertyAssignment(referencedDeclaration) &&
!TypeGuards.isEnumMember(referencedDeclaration)
!Node.isPropertyAssignment(referencedDeclaration) &&
Node.isEnumMember(referencedDeclaration) &&
Node.isPropertyAssignment(referencedDeclaration) &&
!Node.isEnumMember(referencedDeclaration)
) {

@@ -695,0 +727,0 @@ throw new Error(

@@ -17,3 +17,3 @@ import * as fs from 'fs-extra';

const newLine = ts.sys.newLine;
const marked = require('marked');
const { marked } = require('marked');

@@ -20,0 +20,0 @@ export function getNewLine(): string {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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