Skip to content

Commit

Permalink
chore: upgrade dprint.
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Jun 17, 2022
1 parent 33ab592 commit a9ba0ec
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 11 deletions.
5 changes: 5 additions & 0 deletions bvm.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
"path": "https://bvm.land/deno/1.22.0.json",
"checksum": "9b2bb05e938aff49fe139bab5d0d09254774dbde938a5ae815626839c5c5accf",
"version": "1.22.0"
},
{
"path": "https://github.com/dprint/dprint/releases/download/0.29.1/bvm.json",
"checksum": "d8d213a68eb9c2f4818437d451f1046e58a5dfc6dbeef5bb749ca5ced54d3177",
"version": "0.29.1"
}
]
}
2 changes: 1 addition & 1 deletion deno/common/ts_morph_common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ export interface FileSystemEntries {
export declare class ArrayUtils {
private constructor();
static isReadonlyArray<T>(a: unknown): a is ReadonlyArray<T>;
static isNullOrEmpty<T>(a: (ReadonlyArray<T> | undefined)): a is undefined;
static isNullOrEmpty<T>(a: ReadonlyArray<T> | undefined): a is undefined;
static getUniqueItems<T>(a: ReadonlyArray<T>): T[];
static removeFirst<T>(a: T[], item: T): boolean;
static removeAll<T>(a: T[], isMatch: (item: T) => boolean): T[];
Expand Down
2 changes: 1 addition & 1 deletion dprint.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"dist-deno"
],
"plugins": [
"https://plugins.dprint.dev/typescript-0.68.5.wasm",
"../dprint-plugin-typescript/target/wasm32-unknown-unknown/release/dprint_plugin_typescript.wasm",
"https://plugins.dprint.dev/json-0.7.2.wasm",
"https://plugins.dprint.dev/markdown-0.13.3.wasm"
]
Expand Down
2 changes: 1 addition & 1 deletion packages/common/lib/ts-morph-common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,7 @@ export interface FileSystemEntries {
export declare class ArrayUtils {
private constructor();
static isReadonlyArray<T>(a: unknown): a is ReadonlyArray<T>;
static isNullOrEmpty<T>(a: (ReadonlyArray<T> | undefined)): a is undefined;
static isNullOrEmpty<T>(a: ReadonlyArray<T> | undefined): a is undefined;
static getUniqueItems<T>(a: ReadonlyArray<T>): T[];
static removeFirst<T>(a: T[], item: T): boolean;
static removeAll<T>(a: T[], isMatch: (item: T) => boolean): T[];
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/utils/ArrayUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class ArrayUtils {
return a instanceof Array;
}

static isNullOrEmpty<T>(a: (ReadonlyArray<T> | undefined)): a is undefined {
static isNullOrEmpty<T>(a: ReadonlyArray<T> | undefined): a is undefined {
return !(a instanceof Array) || a.length === 0;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/ts-morph/src/Project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ export class Project {
* @param block - Block of code to run. Use the `remember` callback or return a node to remember it.
*/
forgetNodesCreatedInBlock<T = void>(block: (remember: (...node: Node[]) => void) => Promise<T>): Promise<T>;
forgetNodesCreatedInBlock(block: (remember: (...node: Node[]) => void) => (void | Promise<void>)) {
forgetNodesCreatedInBlock(block: (remember: (...node: Node[]) => void) => void | Promise<void>) {
return this._context.compilerFactory.forgetNodesCreatedInBlock(block);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ function insertChildren<TNode extends Node, TStructure extends Structure>(opts:
index: number;
structures: ReadonlyArray<TStructure>;
expectedKind: SyntaxKind;
createStructurePrinter: () => ({ printTexts(writer: CodeBlockWriter, structures: ReadonlyArray<TStructure>): void });
createStructurePrinter: () => { printTexts(writer: CodeBlockWriter, structures: ReadonlyArray<TStructure>): void };
}): TNode[] {
return insertIntoBracesOrSourceFileWithGetChildren<TNode>({
getIndexedChildren: () => opts.thisNode.getMembersWithComments(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ export function JsxAttributedNode<T extends Constructor<JsxAttributedNodeExtensi
return this.compilerNode.attributes.properties.map(p => this._getNodeFromCompilerNode(p));
}

getAttributeOrThrow(nameOrFindFunction: (string | ((attribute: JsxAttributeLike) => boolean))) {
getAttributeOrThrow(nameOrFindFunction: string | ((attribute: JsxAttributeLike) => boolean)) {
return errors.throwIfNullOrUndefined(
this.getAttribute(nameOrFindFunction),
() => getNotFoundErrorMessageForNameOrFindFunction("attribute", nameOrFindFunction),
);
}

getAttribute(nameOrFindFunction: (string | ((attribute: JsxAttributeLike) => boolean))) {
getAttribute(nameOrFindFunction: string | ((attribute: JsxAttributeLike) => boolean)) {
return getNodeByNameOrFindFunction(this.getAttributes(), nameOrFindFunction);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/ts-morph/src/factories/CompilerFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ export class CompilerFactory {
* @param block - Block of code to run.
*/
forgetNodesCreatedInBlock<T = void>(block: (remember: (...node: Node[]) => void) => Promise<T>): Promise<T>;
forgetNodesCreatedInBlock<T = void>(block: (remember: (...node: Node[]) => void) => (T | Promise<T>)): Promise<T> | T {
forgetNodesCreatedInBlock<T = void>(block: (remember: (...node: Node[]) => void) => T | Promise<T>): Promise<T> | T {
// can't use the async keyword here because exceptions that happen when doing this synchronously need to be thrown
this.nodeCache.setForgetPoint();
let wasPromise = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ describe("ExportDeclaration", () => {
});

describe(nameof<ExportDeclaration>("insertNamedExport"), () => {
function doTest(text: string, index: number, structureOrName: (OptionalKind<ExportSpecifierStructure> | string), expected: string) {
function doTest(text: string, index: number, structureOrName: OptionalKind<ExportSpecifierStructure> | string, expected: string) {
const { firstChild, sourceFile } = getInfoFromText<ExportDeclaration>(text);
firstChild.insertNamedExport(index, structureOrName);
expect(sourceFile.getText()).to.equal(expected);
Expand All @@ -480,7 +480,7 @@ describe("ExportDeclaration", () => {
});

describe(nameof<ExportDeclaration>("addNamedExport"), () => {
function doTest(text: string, structureOrName: (OptionalKind<ExportSpecifierStructure> | string), expected: string) {
function doTest(text: string, structureOrName: OptionalKind<ExportSpecifierStructure> | string, expected: string) {
const { firstChild, sourceFile } = getInfoFromText<ExportDeclaration>(text);
firstChild.addNamedExport(structureOrName);
expect(sourceFile.getText()).to.equal(expected);
Expand Down

0 comments on commit a9ba0ec

Please sign in to comment.