Socket
Socket
Sign inDemoInstall

dgeni-packages

Package Overview
Dependencies
Maintainers
4
Versions
147
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dgeni-packages - npm Package Compare versions

Comparing version 0.26.1 to 0.26.2

typescript/mocks/readTypeScriptModules/memberAliases.ts

8

CHANGELOG.md
# Changelog
# 0.26.2 16 May 2018
## Features
* **typescript**:
- include simple name in aliases of members 1d952fd5
# 0.26.1 11 May 2018

@@ -4,0 +12,0 @@

2

package.json
{
"name": "dgeni-packages",
"version": "0.26.1",
"version": "0.26.2",
"description": "A collection of dgeni packages for generating documentation from source code",

@@ -5,0 +5,0 @@ "scripts": {

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

var _this = this;
var aliases = [];
var aliases = [this.anchor];
this.containerDoc.aliases.forEach(function (alias) {

@@ -54,0 +54,0 @@ aliases.push(alias + "." + _this.anchor);

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

_this.id = _this.containerDoc.id + "." + _this.name;
_this.aliases = _this.containerDoc.aliases.map(function (alias) { return alias + "." + _this.name; });
_this.aliases = [_this.name].concat(_this.containerDoc.aliases.map(function (alias) { return alias + "." + _this.name; }));
// If this property has accessors then compute the type based on that instead

@@ -29,0 +29,0 @@ _this.getAccessor = getAccessorDeclaration && new AccessorInfoDoc_1.AccessorInfoDoc('get', _this, getAccessorDeclaration);

@@ -14,2 +14,3 @@ "use strict";

module.exports = new dgeni_1.Package('typescript', [require('../jsdoc')])
// Register the services and file readers
.factory(modules_1.modules)

@@ -32,5 +33,7 @@ .factory(exportSymbolsToDocsMap_1.exportSymbolsToDocsMap)

})
// Register the processors
.processor(readTypeScriptModules_1.readTypeScriptModules)
.processor(linkInheritedDocs_1.linkInheritedDocs)
.processor(mergeParameterInfo_1.mergeParameterInfo)
// Configure ids and paths
.config(function (computeIdsProcessor, computePathsProcessor, EXPORT_DOC_TYPES) {

@@ -37,0 +40,0 @@ computeIdsProcessor.idTemplates.push({

@@ -473,2 +473,39 @@ "use strict";

});
describe('aliases', function () {
var docs;
var fn;
var foo;
var foo1;
var foo2;
var bar;
beforeEach(function () {
processor.sourceFiles = ['memberAliases.ts'];
docs = [];
processor.$process(docs);
fn = docs.find(function (doc) { return doc.name === 'fn'; });
_a = docs.filter(function (doc) { return doc.name === 'foo'; }), foo2 = _a[0], foo = _a[1], foo1 = _a[2];
bar = docs.find(function (doc) { return doc.name === 'bar'; });
var _a;
});
it('should include a simple name', function () {
expect(fn.aliases).toContain('fn()');
expect(foo.aliases).toContain('foo()');
expect(bar.aliases).toContain('bar');
});
it('should include the container', function () {
expect(fn.aliases).toContain('MyClass.fn()');
expect(foo.aliases).toContain('MyClass.foo()');
expect(bar.aliases).toContain('MyClass.bar');
});
it('should include the container and module', function () {
expect(fn.aliases).toContain('memberAliases/MyClass.fn()');
expect(foo.aliases).toContain('memberAliases/MyClass.foo()');
expect(bar.aliases).toContain('memberAliases/MyClass.bar');
});
it('should distinguish method overloads', function () {
expect(foo.aliases).toContain('MyClass.foo()');
expect(foo1.aliases).toContain('MyClass.foo_1()');
expect(foo2.aliases).toContain('MyClass.foo_2()');
});
});
});

@@ -475,0 +512,0 @@ describe('namespaces', function () {

@@ -47,3 +47,3 @@ /* tslint:disable:no-bitwise */

private computeAliases() {
const aliases: string[] = [];
const aliases: string[] = [this.anchor];
this.containerDoc.aliases.forEach(alias => {

@@ -50,0 +50,0 @@ aliases.push(`${alias}.${this.anchor}`);

@@ -10,3 +10,3 @@ import { Declaration, GetAccessorDeclaration, SetAccessorDeclaration, Symbol } from 'typescript';

id = `${this.containerDoc.id}.${this.name}`;
aliases = this.containerDoc.aliases.map(alias => `${alias}.${this.name}` );
aliases = [this.name].concat(this.containerDoc.aliases.map(alias => `${alias}.${this.name}`));
getAccessor: AccessorInfoDoc | null;

@@ -13,0 +13,0 @@ setAccessor: AccessorInfoDoc | null;

@@ -568,2 +568,44 @@ import {Dgeni, DocCollection} from 'dgeni';

});
describe('aliases', () => {
let docs: DocCollection;
let fn: MethodMemberDoc;
let foo: MethodMemberDoc;
let foo1: MethodMemberDoc;
let foo2: MethodMemberDoc;
let bar: PropertyMemberDoc;
beforeEach(() => {
processor.sourceFiles = [ 'memberAliases.ts'];
docs = [];
processor.$process(docs);
fn = docs.find(doc => doc.name === 'fn');
[foo2, foo, foo1] = docs.filter(doc => doc.name === 'foo');
bar = docs.find(doc => doc.name === 'bar');
});
it('should include a simple name', () => {
expect(fn.aliases).toContain('fn()');
expect(foo.aliases).toContain('foo()');
expect(bar.aliases).toContain('bar');
});
it('should include the container', () => {
expect(fn.aliases).toContain('MyClass.fn()');
expect(foo.aliases).toContain('MyClass.foo()');
expect(bar.aliases).toContain('MyClass.bar');
});
it('should include the container and module', () => {
expect(fn.aliases).toContain('memberAliases/MyClass.fn()');
expect(foo.aliases).toContain('memberAliases/MyClass.foo()');
expect(bar.aliases).toContain('memberAliases/MyClass.bar');
});
it('should distinguish method overloads', () => {
expect(foo.aliases).toContain('MyClass.foo()');
expect(foo1.aliases).toContain('MyClass.foo_1()');
expect(foo2.aliases).toContain('MyClass.foo_2()');
});
});
});

@@ -570,0 +612,0 @@

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

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

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