Skip to content

Commit

Permalink
refactor(*): rename from *JSON to *Json (#92)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: `*Parser.JSON` has been renamed to `*Parser.Json`.
BREAKING CHANGE: `*Parser.generateFromJSON()` has been renamed to `*Parser.generateFromJson()`.
  • Loading branch information
RealShadowNova committed Oct 24, 2022
1 parent eae3dc6 commit 730ac5a
Show file tree
Hide file tree
Showing 42 changed files with 633 additions and 633 deletions.
418 changes: 209 additions & 209 deletions src/bin/lib/migrateProjectJson.ts

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions src/lib/structures/FunctionParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ export class FunctionParser extends Parser {
}

/**
* Converts this parser to a JSON compatible format.
* Converts this parser to a Json compatible format.
* @since 1.0.0
* @returns The JSON compatible format of this parser.
* @returns The Json compatible format of this parser.
*/
public toJSON(): FunctionParser.JSON {
public toJSON(): FunctionParser.Json {
return {
...super.toJSON(),
comment: this.comment.toJSON(),
Expand Down Expand Up @@ -76,16 +76,16 @@ export class FunctionParser extends Parser {
* @param json The json to generate the parser from.
* @returns The generated parser.
*/
public static generateFromJSON(json: FunctionParser.JSON): FunctionParser {
public static generateFromJson(json: FunctionParser.Json): FunctionParser {
const { id, name, comment, source, external, signatures } = json;

return new FunctionParser({
id,
name,
comment: CommentParser.generateFromJSON(comment),
source: source ? SourceParser.generateFromJSON(source) : null,
comment: CommentParser.generateFromJson(comment),
source: source ? SourceParser.generateFromJson(source) : null,
external,
signatures: signatures.map((signature) => SignatureParser.generateFromJSON(signature))
signatures: signatures.map((signature) => SignatureParser.generateFromJson(signature))
});
}
}
Expand All @@ -111,12 +111,12 @@ export namespace FunctionParser {
signatures: SignatureParser[];
}

export interface JSON extends Parser.JSON {
export interface Json extends Parser.Json {
/**
* The comment parser of this function.
* @since 1.0.0
*/
comment: CommentParser.JSON;
comment: CommentParser.Json;

/**
* Whether this function is external.
Expand All @@ -125,9 +125,9 @@ export namespace FunctionParser {
external: boolean;

/**
* The signature parsers of this function in a JSON compatible format.
* The signature parsers of this function in a Json compatible format.
* @since 1.0.0
*/
signatures: SignatureParser.JSON[];
signatures: SignatureParser.Json[];
}
}
58 changes: 29 additions & 29 deletions src/lib/structures/NamespaceParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,11 @@ export class NamespaceParser extends Parser {
}

/**
* Converts this parser to a JSON compatible format.
* Converts this parser to a Json compatible format.
* @since 1.0.0
* @returns The JSON compatible format.
* @returns The Json compatible format.
*/
public toJSON(): NamespaceParser.JSON {
public toJSON(): NamespaceParser.Json {
return {
...super.toJSON(),
comment: this.comment.toJSON(),
Expand Down Expand Up @@ -317,22 +317,22 @@ export class NamespaceParser extends Parser {
* @param json The json to generate the parser from.
* @returns The generated parser.
*/
public static generateFromJSON(json: NamespaceParser.JSON): NamespaceParser {
public static generateFromJson(json: NamespaceParser.Json): NamespaceParser {
const { id, name, comment, source, external, classes, variables, enums, functions, interfaces, namespaces, typeAliases } = json;

return new NamespaceParser({
id,
name,
comment: CommentParser.generateFromJSON(comment),
source: source ? SourceParser.generateFromJSON(source) : null,
comment: CommentParser.generateFromJson(comment),
source: source ? SourceParser.generateFromJson(source) : null,
external,
classes: classes.map((json) => ClassParser.generateFromJSON(json)),
enums: enums.map((json) => EnumParser.generateFromJSON(json)),
functions: functions.map((json) => FunctionParser.generateFromJSON(json)),
interfaces: interfaces.map((json) => InterfaceParser.generateFromJSON(json)),
namespaces: namespaces.map((json) => NamespaceParser.generateFromJSON(json)),
typeAliases: typeAliases.map((json) => TypeAliasParser.generateFromJSON(json)),
variables: variables.map((json) => VariableParser.generateFromJSON(json))
classes: classes.map((json) => ClassParser.generateFromJson(json)),
enums: enums.map((json) => EnumParser.generateFromJson(json)),
functions: functions.map((json) => FunctionParser.generateFromJson(json)),
interfaces: interfaces.map((json) => InterfaceParser.generateFromJson(json)),
namespaces: namespaces.map((json) => NamespaceParser.generateFromJson(json)),
typeAliases: typeAliases.map((json) => TypeAliasParser.generateFromJson(json)),
variables: variables.map((json) => VariableParser.generateFromJson(json))
});
}
}
Expand Down Expand Up @@ -394,12 +394,12 @@ export namespace NamespaceParser {
variables: VariableParser[];
}

export interface JSON extends Parser.JSON {
export interface Json extends Parser.Json {
/**
* The comment parser of this namespace.
* @since 1.0.0
*/
comment: CommentParser.JSON;
comment: CommentParser.Json;

/**
* Whether this namespace is external.
Expand All @@ -408,45 +408,45 @@ export namespace NamespaceParser {
external: boolean;

/**
* The class parsers of this namespace in a JSON compatible format.
* The class parsers of this namespace in a Json compatible format.
* @since 1.0.0
*/
classes: ClassParser.JSON[];
classes: ClassParser.Json[];

/**
* The enum parsers of this namespace in a JSON compatible format.
* The enum parsers of this namespace in a Json compatible format.
* @since 1.0.0
*/
enums: EnumParser.JSON[];
enums: EnumParser.Json[];

/**
* The function parsers of this namespace in a JSON compatible format.
* The function parsers of this namespace in a Json compatible format.
* @since 1.0.0
*/
functions: FunctionParser.JSON[];
functions: FunctionParser.Json[];

/**
* The interface parsers of this namespace in a JSON compatible format.
* The interface parsers of this namespace in a Json compatible format.
* @since 1.0.0
*/
interfaces: InterfaceParser.JSON[];
interfaces: InterfaceParser.Json[];

/**
* The namespace parsers of this namespace in a JSON compatible format.
* The namespace parsers of this namespace in a Json compatible format.
* @since 1.0.0
*/
namespaces: JSON[];
namespaces: Json[];

/**
* The type alias parsers of this namespace in a JSON compatible format.
* The type alias parsers of this namespace in a Json compatible format.
* @since 1.0.0
*/
typeAliases: TypeAliasParser.JSON[];
typeAliases: TypeAliasParser.Json[];

/**
* The variable parsers of this namespace in a JSON compatible format.
* The variable parsers of this namespace in a Json compatible format.
* @since 1.0.0
*/
variables: VariableParser.JSON[];
variables: VariableParser.Json[];
}
}
12 changes: 6 additions & 6 deletions src/lib/structures/Parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ export abstract class Parser {
}

/**
* Converts this parser to a JSON compatible format.
* Converts this parser to a Json compatible format.
* @since 1.0.0
* @returns The JSON compatible format of this parser.
* @returns The Json compatible format of this parser.
*/
public toJSON(): Parser.JSON {
public toJSON(): Parser.Json {
return {
id: this.id,
name: this.name,
Expand Down Expand Up @@ -66,7 +66,7 @@ export namespace Parser {
source: SourceParser | null;
}

export interface JSON {
export interface Json {
/**
* The identifier for this parser.
* @since 1.0.0
Expand All @@ -80,9 +80,9 @@ export namespace Parser {
name: string;

/**
* The source parser for this parser in a JSON compatible format.
* The source parser for this parser in a Json compatible format.
* @since 1.0.0
*/
source: SourceParser.JSON | null;
source: SourceParser.Json | null;
}
}
56 changes: 28 additions & 28 deletions src/lib/structures/ProjectParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { TypeAliasParser } from './TypeAliasParser';
import { VariableParser } from './VariableParser';

/**
* Parses data from `JSONOutput.ProjectReflection` or {@link ProjectParser.JSON}
* Parses data from `JSONOutput.ProjectReflection` or {@link ProjectParser.Json}
* @since 1.0.0
*/
export class ProjectParser {
Expand Down Expand Up @@ -138,13 +138,13 @@ export class ProjectParser {
this.version = version ?? data.version;
this.readme = readme ?? data.readme;
this.changelog = changelog ?? data.changelog;
this.classes = classes.map((json) => ClassParser.generateFromJSON(json));
this.enums = enums.map((json) => EnumParser.generateFromJSON(json));
this.functions = functions.map((json) => FunctionParser.generateFromJSON(json));
this.interfaces = interfaces.map((json) => InterfaceParser.generateFromJSON(json));
this.namespaces = namespaces.map((json) => NamespaceParser.generateFromJSON(json));
this.typeAliases = typeAliases.map((json) => TypeAliasParser.generateFromJSON(json));
this.variables = variables.map((json) => VariableParser.generateFromJSON(json));
this.classes = classes.map((json) => ClassParser.generateFromJson(json));
this.enums = enums.map((json) => EnumParser.generateFromJson(json));
this.functions = functions.map((json) => FunctionParser.generateFromJson(json));
this.interfaces = interfaces.map((json) => InterfaceParser.generateFromJson(json));
this.namespaces = namespaces.map((json) => NamespaceParser.generateFromJson(json));
this.typeAliases = typeAliases.map((json) => TypeAliasParser.generateFromJson(json));
this.variables = variables.map((json) => VariableParser.generateFromJson(json));
} else {
const { kind, kindString = 'Unknown', children = [] } = data;

Expand Down Expand Up @@ -345,11 +345,11 @@ export class ProjectParser {
}

/**
* Converts this project to a JSON compatible format.
* Converts this project to a Json compatible format.
* @since 1.0.0
* @returns The JSON compatible format of this project.
* @returns The Json compatible format of this project.
*/
public toJSON(): ProjectParser.JSON {
public toJSON(): ProjectParser.Json {
return {
typeDocJsonParserVersion: this.typeDocJsonParserVersion,
id: this.id,
Expand All @@ -376,7 +376,7 @@ export namespace ProjectParser {
* The data for this project.
* @since 3.0.0
*/
data: JSON | JSONOutput.ProjectReflection;
data: Json | JSONOutput.ProjectReflection;

/**
* The version of the project being parsed.
Expand All @@ -397,9 +397,9 @@ export namespace ProjectParser {
changelog?: string;
}

export interface JSON {
export interface Json {
/**
* The version of `typedoc-json-parser` that generated this JSON object.
* The version of `typedoc-json-parser` that generated this Json object.
* @since 2.1.0
*/
typeDocJsonParserVersion: string;
Expand Down Expand Up @@ -439,45 +439,45 @@ export namespace ProjectParser {
changelog: string | null;

/**
* An array of class JSON compatible objects for this project in a JSON compatible format.
* An array of class Json compatible objects for this project in a Json compatible format.
* @since 1.0.0
*/
classes: ClassParser.JSON[];
classes: ClassParser.Json[];

/**
* An array of enum JSON compatible objects for this project in a JSON compatible format.
* An array of enum Json compatible objects for this project in a Json compatible format.
* @since 1.0.0
*/
enums: EnumParser.JSON[];
enums: EnumParser.Json[];

/**
* An array of function JSON compatible objects for this project in a JSON compatible format.
* An array of function Json compatible objects for this project in a Json compatible format.
* @since 1.0.0
*/
functions: FunctionParser.JSON[];
functions: FunctionParser.Json[];

/**
* An array of interface JSON compatible objects for this project in a JSON compatible format.
* An array of interface Json compatible objects for this project in a Json compatible format.
* @since 1.0.0
*/
interfaces: InterfaceParser.JSON[];
interfaces: InterfaceParser.Json[];

/**
* An array of namespace JSON compatible objects for this project in a JSON compatible format.
* An array of namespace Json compatible objects for this project in a Json compatible format.
* @since 1.0.0
*/
namespaces: NamespaceParser.JSON[];
namespaces: NamespaceParser.Json[];

/**
* An array of type alias JSON compatible objects for this project in a JSON compatible format.
* An array of type alias Json compatible objects for this project in a Json compatible format.
* @since 1.0.0
*/
typeAliases: TypeAliasParser.JSON[];
typeAliases: TypeAliasParser.Json[];

/**
* An array of variable JSON compatible objects for this project in a JSON compatible format.
* An array of variable Json compatible objects for this project in a Json compatible format.
* @since 1.0.0
*/
variables: VariableParser.JSON[];
variables: VariableParser.Json[];
}
}

0 comments on commit 730ac5a

Please sign in to comment.