Comparing version 4.5.4 to 4.6.0
{ | ||
"name": "ng-morph", | ||
"version": "4.5.4", | ||
"version": "4.6.0", | ||
"keywords": [ | ||
@@ -33,3 +33,4 @@ "typescript", | ||
"main": "./src/index.js", | ||
"type": "commonjs" | ||
"type": "commonjs", | ||
"types": "./src/index.d.ts" | ||
} |
import type { AccessorDeclaration } from 'ts-morph'; | ||
export declare const editAccessors: (declarations: AccessorDeclaration | AccessorDeclaration[], editor: import("../utils").StructureEditor<AccessorDeclaration, import("ts-morph").OptionalKind<import("ts-morph").GetAccessorDeclarationStructure | import("ts-morph").SetAccessorDeclarationStructure>>) => void; | ||
export declare const editAccessors: (declarations: AccessorDeclaration | AccessorDeclaration[], editor: import("../utils").StructureEditor<AccessorDeclaration, import("ts-morph").OptionalKind<(import("ts-morph").GetAccessorDeclarationStructure & { | ||
name?: string | undefined; | ||
kind?: import("ts-morph").StructureKind | undefined; | ||
leadingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
trailingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
}) | (import("ts-morph").SetAccessorDeclarationStructure & { | ||
name?: string | undefined; | ||
kind?: import("ts-morph").StructureKind | undefined; | ||
leadingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
trailingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
})>>) => void; |
@@ -1,1 +0,12 @@ | ||
export declare const addClasses: (pattern: import("../utils").Pattern, structures: import("ts-morph").OptionalKind<import("ts-morph").ClassDeclarationStructure> | import("ts-morph").OptionalKind<import("ts-morph").ClassDeclarationStructure>[]) => void; | ||
import { StructureKind } from 'ts-morph'; | ||
export declare const addClasses: (pattern: import("../utils").Pattern, structures: import("ts-morph").OptionalKind<import("ts-morph").ClassDeclarationStructure & { | ||
name?: string | undefined; | ||
kind?: StructureKind | undefined; | ||
leadingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
trailingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
}> | import("ts-morph").OptionalKind<import("ts-morph").ClassDeclarationStructure & { | ||
name?: string | undefined; | ||
kind?: StructureKind | undefined; | ||
leadingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
trailingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
}>[]) => void; |
import type { ClassDeclaration } from 'ts-morph'; | ||
export declare const editClasses: (declarations: ClassDeclaration | ClassDeclaration[], editor: import("../utils").StructureEditor<ClassDeclaration, import("ts-morph").OptionalKind<import("ts-morph").ClassDeclarationStructure>>) => void; | ||
export declare const editClasses: (declarations: ClassDeclaration | ClassDeclaration[], editor: import("../utils").StructureEditor<ClassDeclaration, import("ts-morph").OptionalKind<import("ts-morph").ClassDeclarationStructure & { | ||
name?: string | undefined; | ||
kind?: import("ts-morph").StructureKind | undefined; | ||
leadingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
trailingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
}>>) => void; |
import type { ClassDeclaration } from 'ts-morph'; | ||
export declare const getClasses: (pattern: import("../utils").Pattern, query?: Partial<{ | ||
name?: string | string[]; | ||
leadingTrivia?: string | string[]; | ||
trailingTrivia?: string | string[]; | ||
typeParameters?: string | string[]; | ||
docs?: string | string[]; | ||
decorators?: never; | ||
isAbstract?: boolean | boolean[]; | ||
hasDeclareKeyword?: boolean | boolean[]; | ||
extends?: string | string[]; | ||
ctors?: never; | ||
staticBlocks?: never; | ||
properties?: never; | ||
getAccessors?: never; | ||
setAccessors?: never; | ||
methods?: never; | ||
implements?: string | string[]; | ||
isExported?: boolean | boolean[]; | ||
isDefaultExport?: boolean | boolean[]; | ||
}>) => ClassDeclaration[]; | ||
leadingTrivia?: string | string[] | undefined; | ||
trailingTrivia?: string | string[] | undefined; | ||
name?: string | string[] | undefined; | ||
typeParameters?: string | string[] | undefined; | ||
docs?: string | string[] | undefined; | ||
decorators?: undefined; | ||
isAbstract?: boolean | boolean[] | undefined; | ||
hasDeclareKeyword?: boolean | boolean[] | undefined; | ||
extends?: string | string[] | undefined; | ||
ctors?: undefined; | ||
staticBlocks?: undefined; | ||
properties?: undefined; | ||
getAccessors?: undefined; | ||
setAccessors?: undefined; | ||
methods?: undefined; | ||
implements?: string | string[] | undefined; | ||
isExported?: boolean | boolean[] | undefined; | ||
isDefaultExport?: boolean | boolean[] | undefined; | ||
}> | undefined) => ClassDeclaration[]; |
import type { ConstructorDeclaration } from 'ts-morph'; | ||
export declare const editConstructors: (declarations: ConstructorDeclaration | ConstructorDeclaration[], editor: import("../utils").StructureEditor<ConstructorDeclaration, import("ts-morph").OptionalKind<import("ts-morph").ConstructorDeclarationStructure | import("ts-morph").ConstructorDeclarationOverloadStructure>>) => void; | ||
export declare const editConstructors: (declarations: ConstructorDeclaration | ConstructorDeclaration[], editor: import("../utils").StructureEditor<ConstructorDeclaration, import("ts-morph").OptionalKind<(import("ts-morph").ConstructorDeclarationStructure | import("ts-morph").ConstructorDeclarationOverloadStructure) & { | ||
name?: string | undefined; | ||
kind?: import("ts-morph").StructureKind | undefined; | ||
leadingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
trailingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
}>>) => void; |
import type { Decorator } from 'ts-morph'; | ||
export declare const editDecorators: (declarations: Decorator | Decorator[], editor: import("../utils").StructureEditor<Decorator, import("ts-morph").OptionalKind<import("ts-morph").DecoratorStructure>>) => void; | ||
export declare const editDecorators: (declarations: Decorator | Decorator[], editor: import("../utils").StructureEditor<Decorator, import("ts-morph").OptionalKind<import("ts-morph").DecoratorStructure & { | ||
name?: string | undefined; | ||
kind?: import("ts-morph").StructureKind | undefined; | ||
leadingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
trailingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
}>>) => void; |
@@ -5,7 +5,7 @@ import type { DecoratableNode, Decorator, DecoratorStructure } from 'ts-morph'; | ||
export declare const getAllDecorators: (pattern: import("../utils").Pattern, query?: Partial<{ | ||
leadingTrivia?: string | string[] | undefined; | ||
trailingTrivia?: string | string[] | undefined; | ||
name: string | string[]; | ||
leadingTrivia?: string | string[]; | ||
trailingTrivia?: string | string[]; | ||
arguments?: string | string[]; | ||
typeArguments?: string | string[]; | ||
}>) => Decorator[]; | ||
arguments?: string | string[] | undefined; | ||
typeArguments?: string | string[] | undefined; | ||
}> | undefined) => Decorator[]; |
@@ -1,1 +0,12 @@ | ||
export declare const addEnums: (pattern: import("../utils").Pattern, structures: import("ts-morph").OptionalKind<import("ts-morph").EnumDeclarationStructure> | import("ts-morph").OptionalKind<import("ts-morph").EnumDeclarationStructure>[]) => void; | ||
import { StructureKind } from 'ts-morph'; | ||
export declare const addEnums: (pattern: import("../utils").Pattern, structures: import("ts-morph").OptionalKind<import("ts-morph").EnumDeclarationStructure & { | ||
name?: string | undefined; | ||
kind?: StructureKind | undefined; | ||
leadingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
trailingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
}> | import("ts-morph").OptionalKind<import("ts-morph").EnumDeclarationStructure & { | ||
name?: string | undefined; | ||
kind?: StructureKind | undefined; | ||
leadingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
trailingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
}>[]) => void; |
import type { EnumDeclaration } from 'ts-morph'; | ||
export declare const editEnums: (declarations: EnumDeclaration | EnumDeclaration[], editor: import("../utils").StructureEditor<EnumDeclaration, import("ts-morph").OptionalKind<import("ts-morph").EnumDeclarationStructure>>) => void; | ||
export declare const editEnums: (declarations: EnumDeclaration | EnumDeclaration[], editor: import("../utils").StructureEditor<EnumDeclaration, import("ts-morph").OptionalKind<import("ts-morph").EnumDeclarationStructure & { | ||
name?: string | undefined; | ||
kind?: import("ts-morph").StructureKind | undefined; | ||
leadingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
trailingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
}>>) => void; |
import type { EnumDeclaration } from 'ts-morph'; | ||
export declare const getEnums: (pattern: import("../utils").Pattern, query?: Partial<{ | ||
leadingTrivia?: string | string[] | undefined; | ||
trailingTrivia?: string | string[] | undefined; | ||
name: string | string[]; | ||
leadingTrivia?: string | string[]; | ||
trailingTrivia?: string | string[]; | ||
docs?: string | string[]; | ||
hasDeclareKeyword?: boolean | boolean[]; | ||
isConst?: boolean | boolean[]; | ||
isExported?: boolean | boolean[]; | ||
isDefaultExport?: boolean | boolean[]; | ||
members?: never; | ||
}>) => EnumDeclaration[]; | ||
docs?: string | string[] | undefined; | ||
hasDeclareKeyword?: boolean | boolean[] | undefined; | ||
isConst?: boolean | boolean[] | undefined; | ||
isExported?: boolean | boolean[] | undefined; | ||
isDefaultExport?: boolean | boolean[] | undefined; | ||
members?: undefined; | ||
}> | undefined) => EnumDeclaration[]; |
@@ -1,1 +0,12 @@ | ||
export declare const addExports: (pattern: import("../utils").Pattern, structures: import("ts-morph").OptionalKind<import("ts-morph").ExportDeclarationStructure> | import("ts-morph").OptionalKind<import("ts-morph").ExportDeclarationStructure>[]) => void; | ||
import { StructureKind } from 'ts-morph'; | ||
export declare const addExports: (pattern: import("../utils").Pattern, structures: import("ts-morph").OptionalKind<import("ts-morph").ExportDeclarationStructure & { | ||
name?: string | undefined; | ||
kind?: StructureKind | undefined; | ||
leadingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
trailingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
}> | import("ts-morph").OptionalKind<import("ts-morph").ExportDeclarationStructure & { | ||
name?: string | undefined; | ||
kind?: StructureKind | undefined; | ||
leadingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
trailingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
}>[]) => void; |
import type { ExportDeclaration } from 'ts-morph'; | ||
export declare const getExports: (pattern: import("../utils").Pattern, query?: Partial<{ | ||
leadingTrivia?: string | string[]; | ||
trailingTrivia?: string | string[]; | ||
isTypeOnly?: boolean | boolean[]; | ||
namespaceExport?: string | string[]; | ||
namedExports?: string | string[]; | ||
moduleSpecifier?: string | string[]; | ||
attributes?: never; | ||
}>) => ExportDeclaration[]; | ||
leadingTrivia?: string | string[] | undefined; | ||
trailingTrivia?: string | string[] | undefined; | ||
name?: string | string[] | undefined; | ||
isTypeOnly?: boolean | boolean[] | undefined; | ||
namespaceExport?: string | string[] | undefined; | ||
namedExports?: string | string[] | undefined; | ||
moduleSpecifier?: string | string[] | undefined; | ||
attributes?: undefined; | ||
}> | undefined) => ExportDeclaration[]; |
import type { FunctionDeclaration } from 'ts-morph'; | ||
export declare const editFunctions: (declarations: FunctionDeclaration | FunctionDeclaration[], editor: import("../utils").StructureEditor<FunctionDeclaration, import("ts-morph").OptionalKind<import("ts-morph").FunctionDeclarationStructure | import("ts-morph").FunctionDeclarationOverloadStructure>>) => void; | ||
export declare const editFunctions: (declarations: FunctionDeclaration | FunctionDeclaration[], editor: import("../utils").StructureEditor<FunctionDeclaration, import("ts-morph").OptionalKind<(import("ts-morph").FunctionDeclarationStructure | import("ts-morph").FunctionDeclarationOverloadStructure) & { | ||
name?: string | undefined; | ||
kind?: import("ts-morph").StructureKind | undefined; | ||
leadingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
trailingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
}>>) => void; |
import type { FunctionDeclaration } from 'ts-morph'; | ||
export declare const getFunctions: (pattern: import("../utils").Pattern, query?: Partial<{ | ||
name?: string | string[]; | ||
leadingTrivia?: string | string[]; | ||
trailingTrivia?: string | string[]; | ||
statements?: string | string[]; | ||
overloads?: never; | ||
parameters?: never; | ||
returnType?: string | string[]; | ||
typeParameters?: string | string[]; | ||
docs?: string | string[]; | ||
hasDeclareKeyword?: boolean | boolean[]; | ||
isAsync?: boolean | boolean[]; | ||
isGenerator?: boolean | boolean[]; | ||
isExported?: boolean | boolean[]; | ||
isDefaultExport?: boolean | boolean[]; | ||
}>) => FunctionDeclaration[]; | ||
leadingTrivia?: string | string[] | undefined; | ||
trailingTrivia?: string | string[] | undefined; | ||
statements?: string | string[] | undefined; | ||
name?: string | string[] | undefined; | ||
overloads?: undefined; | ||
parameters?: undefined; | ||
returnType?: string | string[] | undefined; | ||
typeParameters?: string | string[] | undefined; | ||
docs?: string | string[] | undefined; | ||
hasDeclareKeyword?: boolean | boolean[] | undefined; | ||
isAsync?: boolean | boolean[] | undefined; | ||
isGenerator?: boolean | boolean[] | undefined; | ||
isExported?: boolean | boolean[] | undefined; | ||
isDefaultExport?: boolean | boolean[] | undefined; | ||
}> | undefined) => FunctionDeclaration[]; |
@@ -1,1 +0,12 @@ | ||
export declare const addImports: (pattern: import("../utils").Pattern, structures: import("ts-morph").OptionalKind<import("ts-morph").ImportDeclarationStructure> | import("ts-morph").OptionalKind<import("ts-morph").ImportDeclarationStructure>[]) => void; | ||
import { StructureKind } from 'ts-morph'; | ||
export declare const addImports: (pattern: import("../utils").Pattern, structures: import("ts-morph").OptionalKind<import("ts-morph").ImportDeclarationStructure & { | ||
name?: string | undefined; | ||
kind?: StructureKind | undefined; | ||
leadingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
trailingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
}> | import("ts-morph").OptionalKind<import("ts-morph").ImportDeclarationStructure & { | ||
name?: string | undefined; | ||
kind?: StructureKind | undefined; | ||
leadingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
trailingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
}>[]) => void; |
import type { ImportDeclaration } from 'ts-morph'; | ||
export declare const getImports: (pattern: import("../utils").Pattern, query?: Partial<{ | ||
leadingTrivia?: string | string[]; | ||
trailingTrivia?: string | string[]; | ||
isTypeOnly?: boolean | boolean[]; | ||
leadingTrivia?: string | string[] | undefined; | ||
trailingTrivia?: string | string[] | undefined; | ||
name?: string | string[] | undefined; | ||
isTypeOnly?: boolean | boolean[] | undefined; | ||
moduleSpecifier: string | string[]; | ||
attributes?: never; | ||
defaultImport?: string | string[]; | ||
namespaceImport?: string | string[]; | ||
namedImports?: string | string[]; | ||
}>) => ImportDeclaration[]; | ||
attributes?: undefined; | ||
defaultImport?: string | string[] | undefined; | ||
namespaceImport?: string | string[] | undefined; | ||
namedImports?: string | string[] | undefined; | ||
}> | undefined) => ImportDeclaration[]; |
@@ -1,1 +0,12 @@ | ||
export declare const addInterfaces: (pattern: import("../utils").Pattern, structures: import("ts-morph").OptionalKind<import("ts-morph").InterfaceDeclarationStructure> | import("ts-morph").OptionalKind<import("ts-morph").InterfaceDeclarationStructure>[]) => void; | ||
import { StructureKind } from 'ts-morph'; | ||
export declare const addInterfaces: (pattern: import("../utils").Pattern, structures: import("ts-morph").OptionalKind<import("ts-morph").InterfaceDeclarationStructure & { | ||
name?: string | undefined; | ||
kind?: StructureKind | undefined; | ||
leadingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
trailingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
}> | import("ts-morph").OptionalKind<import("ts-morph").InterfaceDeclarationStructure & { | ||
name?: string | undefined; | ||
kind?: StructureKind | undefined; | ||
leadingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
trailingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
}>[]) => void; |
import type { InterfaceDeclaration } from 'ts-morph'; | ||
export declare const editInterfaces: (declarations: InterfaceDeclaration | InterfaceDeclaration[], editor: import("../utils").StructureEditor<InterfaceDeclaration, import("ts-morph").OptionalKind<import("ts-morph").InterfaceDeclarationStructure>>) => void; | ||
export declare const editInterfaces: (declarations: InterfaceDeclaration | InterfaceDeclaration[], editor: import("../utils").StructureEditor<InterfaceDeclaration, import("ts-morph").OptionalKind<import("ts-morph").InterfaceDeclarationStructure & { | ||
name?: string | undefined; | ||
kind?: import("ts-morph").StructureKind | undefined; | ||
leadingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
trailingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
}>>) => void; |
import type { InterfaceDeclaration } from 'ts-morph'; | ||
export declare const getInterfaces: (pattern: import("../utils").Pattern, query?: Partial<{ | ||
leadingTrivia?: string | string[] | undefined; | ||
trailingTrivia?: string | string[] | undefined; | ||
name: string | string[]; | ||
leadingTrivia?: string | string[]; | ||
trailingTrivia?: string | string[]; | ||
typeParameters?: string | string[]; | ||
docs?: string | string[]; | ||
hasDeclareKeyword?: boolean | boolean[]; | ||
extends?: string | string[]; | ||
properties?: never; | ||
getAccessors?: never; | ||
setAccessors?: never; | ||
methods?: never; | ||
isExported?: boolean | boolean[]; | ||
isDefaultExport?: boolean | boolean[]; | ||
callSignatures?: never; | ||
constructSignatures?: never; | ||
indexSignatures?: never; | ||
}>) => InterfaceDeclaration[]; | ||
typeParameters?: string | string[] | undefined; | ||
docs?: string | string[] | undefined; | ||
hasDeclareKeyword?: boolean | boolean[] | undefined; | ||
extends?: string | string[] | undefined; | ||
properties?: undefined; | ||
getAccessors?: undefined; | ||
setAccessors?: undefined; | ||
methods?: undefined; | ||
isExported?: boolean | boolean[] | undefined; | ||
isDefaultExport?: boolean | boolean[] | undefined; | ||
callSignatures?: undefined; | ||
constructSignatures?: undefined; | ||
indexSignatures?: undefined; | ||
}> | undefined) => InterfaceDeclaration[]; |
@@ -16,7 +16,7 @@ /** | ||
constructor(content: string); | ||
get(jsonPath: JSONPath): string; | ||
get(jsonPath: JSONPath): string | undefined; | ||
getContent(): string; | ||
modify(jsonPath: JSONPath, value: JsonValue | undefined, insertInOrder?: InsertionIndex | false): void; | ||
remove(jsonPath: JSONPath): void; | ||
protected jsonAst(): Node; | ||
protected jsonAst(): Node | undefined; | ||
} |
@@ -17,7 +17,8 @@ "use strict"; | ||
get(jsonPath) { | ||
if (jsonPath.length === 0) { | ||
return (0, jsonc_parser_1.getNodeValue)(this.jsonAst()); | ||
const ast = this.jsonAst(); | ||
const node = ast ? (0, jsonc_parser_1.findNodeAtLocation)(ast, jsonPath) : null; | ||
if (!node || !ast) { | ||
return undefined; | ||
} | ||
const node = (0, jsonc_parser_1.findNodeAtLocation)(this.jsonAst(), jsonPath); | ||
return node === undefined ? undefined : (0, jsonc_parser_1.getNodeValue)(node); | ||
return (0, jsonc_parser_1.getNodeValue)(node); | ||
} | ||
@@ -24,0 +25,0 @@ getContent() { |
@@ -19,3 +19,3 @@ /** | ||
modify(jsonPath: JSONPath, value: JsonValue | undefined, insertInOrder?: InsertionIndex | false): void; | ||
protected jsonAst(): Node; | ||
protected jsonAst(): Node | undefined; | ||
} |
@@ -33,3 +33,3 @@ "use strict"; | ||
catch (e) { | ||
throw new Error(`[${this.path}] ${e.message}`); | ||
throw new Error(`[${this.path}] ${e === null || e === void 0 ? void 0 : e.message}`); | ||
} | ||
@@ -36,0 +36,0 @@ } |
@@ -11,5 +11,6 @@ "use strict"; | ||
} | ||
(0, push_to_object_literal_array_property_1.pushToObjectLiteralArrayProperty)(getOptionsObject(options), 'providers', provider, { | ||
unique, | ||
}); | ||
const expression = getOptionsObject(options); | ||
if (expression) { | ||
(0, push_to_object_literal_array_property_1.pushToObjectLiteralArrayProperty)(expression, 'providers', provider, { unique }); | ||
} | ||
} | ||
@@ -22,4 +23,4 @@ exports.addProviderToBootstrapApplicationFn = addProviderToBootstrapApplicationFn; | ||
const definition = options.getDefinitionNodes()[0]; | ||
return definition.getChildrenOfKind(ts_morph_1.SyntaxKind.ObjectLiteralExpression)[0]; | ||
return definition === null || definition === void 0 ? void 0 : definition.getChildrenOfKind(ts_morph_1.SyntaxKind.ObjectLiteralExpression)[0]; | ||
} | ||
//# sourceMappingURL=add-provider-to-bootstrap-application-fn.js.map |
import type { ClassDeclaration } from 'ts-morph'; | ||
export declare function getMainModule(mainFilePath: string): ClassDeclaration; | ||
export declare function getMainModule(mainFilePath: string): ClassDeclaration | undefined; |
@@ -6,5 +6,7 @@ "use strict"; | ||
function getMainModule(mainFilePath) { | ||
var _a; | ||
const bootstrapFn = (0, bootstrap_1.getBootstrapFn)(mainFilePath); | ||
const [mainModuleIdentifier] = bootstrapFn.getArguments(); | ||
const [mainModuleClass] = mainModuleIdentifier.getDefinitionNodes(); | ||
const [mainModuleIdentifier] = ((_a = bootstrapFn === null || bootstrapFn === void 0 ? void 0 : bootstrapFn.getArguments) === null || _a === void 0 ? void 0 : _a.call(bootstrapFn)) || []; | ||
const [mainModuleClass] = (mainModuleIdentifier === null || mainModuleIdentifier === void 0 ? void 0 : mainModuleIdentifier.getDefinitionNodes()) || | ||
[]; | ||
return mainModuleClass; | ||
@@ -11,0 +13,0 @@ } |
@@ -12,3 +12,3 @@ "use strict"; | ||
}); | ||
const [metadata = decorator.addArgument(`{${propertyName}: []}`)] = decorator.getArguments(); | ||
const [metadata = decorator === null || decorator === void 0 ? void 0 : decorator.addArgument(`{${propertyName}: []}`)] = (decorator === null || decorator === void 0 ? void 0 : decorator.getArguments()) || []; | ||
if (!ts_morph_1.Node.isObjectLiteralExpression(metadata)) { | ||
@@ -15,0 +15,0 @@ return; |
@@ -6,3 +6,3 @@ "use strict"; | ||
function pushToObjectLiteralArrayProperty(objectLiteral, propertyName, initializer, { unique = false, forceToArray = false, } = {}) { | ||
var _a; | ||
var _a, _b; | ||
const property = (_a = objectLiteral.getProperty(propertyName)) !== null && _a !== void 0 ? _a : objectLiteral.addProperty(`${propertyName}: []`); | ||
@@ -13,3 +13,3 @@ if (!ts_morph_1.Node.isPropertyAssignment(property)) { | ||
if (forceToArray && !ts_morph_1.Node.isArrayLiteralExpression(property.getInitializer())) { | ||
property.setInitializer(`[${property.getInitializer().getText()}]`); | ||
property.setInitializer(`[${(_b = property.getInitializer()) === null || _b === void 0 ? void 0 : _b.getText()}]`); | ||
} | ||
@@ -16,0 +16,0 @@ const importsInitializer = property.getInitializer(); |
import type { ParameterDeclaration } from 'ts-morph'; | ||
export declare const editParams: (declarations: ParameterDeclaration | ParameterDeclaration[], editor: import("../utils").StructureEditor<ParameterDeclaration, import("ts-morph").OptionalKind<import("ts-morph").ParameterDeclarationStructure>>) => void; | ||
export declare const editParams: (declarations: ParameterDeclaration | ParameterDeclaration[], editor: import("../utils").StructureEditor<ParameterDeclaration, import("ts-morph").OptionalKind<import("ts-morph").ParameterDeclarationStructure & { | ||
name?: string | undefined; | ||
kind?: import("ts-morph").StructureKind | undefined; | ||
leadingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
trailingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
}>>) => void; |
@@ -28,4 +28,4 @@ /** | ||
delete(filePath: Path): void; | ||
read(filePath: Path): string | null; | ||
read(filePath: Path | string): string | null; | ||
readDirectory(dirPath: Path): DirectoryEntry; | ||
} |
@@ -88,9 +88,9 @@ /** | ||
isCaseSensitive(): boolean; | ||
mkdir(dirPath: string): Promise<void>; | ||
mkdirSync(dirPath: string): void; | ||
mkdir(_dirPath: string): Promise<void>; | ||
mkdirSync(_dirPath: string): void; | ||
move(srcPath: string, destPath: string): Promise<void>; | ||
moveSync(srcPath: string, destPath: string): void; | ||
readDirSync(dirPath: string): RuntimeDirEntry[]; | ||
readFile(filePath: string, encoding?: string): Promise<string>; | ||
readFileSync(filePath: string, encoding?: string): string; | ||
readFile(filePath: string, _encoding?: string): Promise<string>; | ||
readFileSync(filePath: string, _encoding?: string): string; | ||
realpathSync(path: string): string; | ||
@@ -97,0 +97,0 @@ writeFile(filePath: string, fileText: string): Promise<void>; |
@@ -74,7 +74,7 @@ "use strict"; | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
async mkdir(dirPath) { | ||
async mkdir(_dirPath) { | ||
return Promise.resolve(undefined); | ||
} | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
mkdirSync(dirPath) { | ||
mkdirSync(_dirPath) { | ||
// empty | ||
@@ -106,8 +106,9 @@ } | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
async readFile(filePath, encoding) { | ||
async readFile(filePath, _encoding) { | ||
return this.readFileSync(filePath); | ||
} | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
readFileSync(filePath, encoding) { | ||
return this.fs.read(filePath); | ||
readFileSync(filePath, _encoding) { | ||
var _a; | ||
return (_a = this.fs.read(filePath)) !== null && _a !== void 0 ? _a : ''; | ||
} | ||
@@ -114,0 +115,0 @@ realpathSync(path) { |
import type { NgCliProject } from './ng-cli-project'; | ||
export declare function setActiveProject(project: NgCliProject): NgCliProject | null; | ||
export declare function setActiveProject(project: NgCliProject | null): NgCliProject | null; | ||
export declare function getActiveProject(): NgCliProject | null; | ||
export declare function resetActiveProject(): NgCliProject | null; |
@@ -6,9 +6,11 @@ "use strict"; | ||
async function saveActiveProjectAsync() { | ||
await (0, project_1.getActiveProject)().save(); | ||
var _a; | ||
await ((_a = (0, project_1.getActiveProject)()) === null || _a === void 0 ? void 0 : _a.save()); | ||
} | ||
exports.saveActiveProjectAsync = saveActiveProjectAsync; | ||
function saveActiveProject() { | ||
(0, project_1.getActiveProject)().saveSync(); | ||
var _a; | ||
(_a = (0, project_1.getActiveProject)()) === null || _a === void 0 ? void 0 : _a.saveSync(); | ||
} | ||
exports.saveActiveProject = saveActiveProject; | ||
//# sourceMappingURL=save-project.js.map |
import type { SourceFile } from 'ts-morph'; | ||
export declare function createSourceFile(filePath: string, content?: string, { overwrite }?: { | ||
overwrite?: boolean; | ||
}): SourceFile; | ||
}): SourceFile | undefined; |
@@ -6,5 +6,6 @@ "use strict"; | ||
function createSourceFile(filePath, content, { overwrite = false } = {}) { | ||
return (0, project_1.getActiveProject)().createSourceFile(filePath, content, { overwrite }); | ||
var _a; | ||
return (_a = (0, project_1.getActiveProject)()) === null || _a === void 0 ? void 0 : _a.createSourceFile(filePath, content, { overwrite }); | ||
} | ||
exports.createSourceFile = createSourceFile; | ||
//# sourceMappingURL=create-source-file.js.map |
@@ -6,10 +6,11 @@ "use strict"; | ||
function getSourceFiles(pattern) { | ||
return (0, project_1.getActiveProject)().getSourceFiles(pattern); | ||
var _a; | ||
return ((_a = (0, project_1.getActiveProject)()) === null || _a === void 0 ? void 0 : _a.getSourceFiles(pattern)) || []; | ||
} | ||
exports.getSourceFiles = getSourceFiles; | ||
function getSourceFile(filePath) { | ||
var _a; | ||
return (_a = (0, project_1.getActiveProject)().getSourceFile(filePath)) !== null && _a !== void 0 ? _a : null; | ||
var _a, _b; | ||
return (_b = (_a = (0, project_1.getActiveProject)()) === null || _a === void 0 ? void 0 : _a.getSourceFile(filePath)) !== null && _b !== void 0 ? _b : null; | ||
} | ||
exports.getSourceFile = getSourceFile; | ||
//# sourceMappingURL=get-source-files.js.map |
@@ -1,1 +0,12 @@ | ||
export declare const addTypeAliases: (pattern: import("../utils").Pattern, structures: import("ts-morph").OptionalKind<import("ts-morph").TypeAliasDeclarationStructure> | import("ts-morph").OptionalKind<import("ts-morph").TypeAliasDeclarationStructure>[]) => void; | ||
import { StructureKind } from 'ts-morph'; | ||
export declare const addTypeAliases: (pattern: import("../utils").Pattern, structures: import("ts-morph").OptionalKind<import("ts-morph").TypeAliasDeclarationStructure & { | ||
name?: string | undefined; | ||
kind?: StructureKind | undefined; | ||
leadingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
trailingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
}> | import("ts-morph").OptionalKind<import("ts-morph").TypeAliasDeclarationStructure & { | ||
name?: string | undefined; | ||
kind?: StructureKind | undefined; | ||
leadingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
trailingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
}>[]) => void; |
import type { TypeAliasDeclaration } from 'ts-morph'; | ||
export declare const editTypeAliases: (declarations: TypeAliasDeclaration | TypeAliasDeclaration[], editor: import("../utils").StructureEditor<TypeAliasDeclaration, import("ts-morph").OptionalKind<import("ts-morph").TypeAliasDeclarationStructure>>) => void; | ||
export declare const editTypeAliases: (declarations: TypeAliasDeclaration | TypeAliasDeclaration[], editor: import("../utils").StructureEditor<TypeAliasDeclaration, import("ts-morph").OptionalKind<import("ts-morph").TypeAliasDeclarationStructure & { | ||
name?: string | undefined; | ||
kind?: import("ts-morph").StructureKind | undefined; | ||
leadingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
trailingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
}>>) => void; |
import type { TypeAliasDeclaration } from 'ts-morph'; | ||
export declare const getTypeAliases: (pattern: import("../utils").Pattern, query?: Partial<{ | ||
leadingTrivia?: string | string[] | undefined; | ||
trailingTrivia?: string | string[] | undefined; | ||
name: string | string[]; | ||
leadingTrivia?: string | string[]; | ||
trailingTrivia?: string | string[]; | ||
typeParameters?: string | string[]; | ||
docs?: string | string[]; | ||
typeParameters?: string | string[] | undefined; | ||
docs?: string | string[] | undefined; | ||
type: string | string[]; | ||
hasDeclareKeyword?: boolean | boolean[]; | ||
isExported?: boolean | boolean[]; | ||
isDefaultExport?: boolean | boolean[]; | ||
}>) => TypeAliasDeclaration[]; | ||
hasDeclareKeyword?: boolean | boolean[] | undefined; | ||
isExported?: boolean | boolean[] | undefined; | ||
isDefaultExport?: boolean | boolean[] | undefined; | ||
}> | undefined) => TypeAliasDeclaration[]; |
@@ -10,3 +10,3 @@ import type { OptionalKind, StructureKind } from 'ts-morph'; | ||
}>(common: CommonStructure, { position }?: { | ||
position?: number; | ||
position?: number | null; | ||
}): (pattern: Pattern, structures: Structure | Structure[]) => void; |
@@ -30,3 +30,3 @@ import type { Structure, WriterFunction } from 'ts-morph'; | ||
}>; | ||
export declare function matchQuery<T extends Structure>(value: T, query?: Query<T>): boolean; | ||
export declare function matchQuery<T extends Structure>(value: Record<any, any> & T, query?: Query<T> & Record<any, any>): boolean; | ||
export {}; |
@@ -1,5 +0,10 @@ | ||
import type { Node } from 'ts-morph'; | ||
import type { Node, StructureKind, WriterFunction } from 'ts-morph'; | ||
export type StructureType<T> = T extends Node & { | ||
set(structure: Record<string, unknown>): unknown; | ||
getStructure(): infer S; | ||
} ? S : never; | ||
} ? S & { | ||
name?: string; | ||
kind?: StructureKind; | ||
leadingTrivia?: Array<WriterFunction | string> | WriterFunction | string; | ||
trailingTrivia?: Array<WriterFunction | string> | WriterFunction | string; | ||
} : never; |
@@ -1,1 +0,12 @@ | ||
export declare const addVariables: (pattern: import("../utils").Pattern, structures: import("ts-morph").OptionalKind<import("ts-morph").VariableStatementStructure> | import("ts-morph").OptionalKind<import("ts-morph").VariableStatementStructure>[]) => void; | ||
import { StructureKind } from 'ts-morph'; | ||
export declare const addVariables: (pattern: import("../utils").Pattern, structures: import("ts-morph").OptionalKind<import("ts-morph").VariableStatementStructure & { | ||
name?: string | undefined; | ||
kind?: StructureKind | undefined; | ||
leadingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
trailingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
}> | import("ts-morph").OptionalKind<import("ts-morph").VariableStatementStructure & { | ||
name?: string | undefined; | ||
kind?: StructureKind | undefined; | ||
leadingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
trailingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
}>[]) => void; |
import type { VariableStatement } from 'ts-morph'; | ||
export declare const editVariables: (declarations: VariableStatement | VariableStatement[], editor: import("../utils").StructureEditor<VariableStatement, import("ts-morph").OptionalKind<import("ts-morph").VariableStatementStructure>>) => void; | ||
export declare const editVariables: (declarations: VariableStatement | VariableStatement[], editor: import("../utils").StructureEditor<VariableStatement, import("ts-morph").OptionalKind<import("ts-morph").VariableStatementStructure & { | ||
name?: string | undefined; | ||
kind?: import("ts-morph").StructureKind | undefined; | ||
leadingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
trailingTrivia?: string | import("ts-morph").WriterFunction | (string | import("ts-morph").WriterFunction)[] | undefined; | ||
}>>) => void; |
import type { VariableStatement } from 'ts-morph'; | ||
export declare const getVariables: (pattern: import("../utils").Pattern, query?: Partial<{ | ||
leadingTrivia?: string | string[]; | ||
trailingTrivia?: string | string[]; | ||
docs?: string | string[]; | ||
hasDeclareKeyword?: boolean | boolean[]; | ||
isExported?: boolean | boolean[]; | ||
isDefaultExport?: boolean | boolean[]; | ||
leadingTrivia?: string | string[] | undefined; | ||
trailingTrivia?: string | string[] | undefined; | ||
name?: string | string[] | undefined; | ||
docs?: string | string[] | undefined; | ||
hasDeclareKeyword?: boolean | boolean[] | undefined; | ||
isExported?: boolean | boolean[] | undefined; | ||
isDefaultExport?: boolean | boolean[] | undefined; | ||
declarations: never; | ||
declarationKind?: import("ts-morph").VariableDeclarationKind | import("ts-morph").VariableDeclarationKind[]; | ||
}>) => VariableStatement[]; | ||
declarationKind?: import("ts-morph").VariableDeclarationKind | import("ts-morph").VariableDeclarationKind[] | undefined; | ||
}> | undefined) => VariableStatement[]; |
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
185699
2471