Skip to content

Commit

Permalink
Trim line ends (#947)
Browse files Browse the repository at this point in the history
* Trim line ends of comments

* Indent only for non-empty line

* accept baselines

Co-authored-by: Nathan Shively-Sanders <[email protected]>
  • Loading branch information
saschanaz and sandersn authored Feb 23, 2021
1 parent c6d98e4 commit d52565b
Show file tree
Hide file tree
Showing 6 changed files with 253 additions and 253 deletions.
324 changes: 162 additions & 162 deletions baselines/dom.generated.d.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion baselines/dom.iterable.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ interface IDBDatabase {
interface IDBObjectStore {
/**
* Creates a new index in store with the given name, keyPath and options and returns a new IDBIndex. If the keyPath and options define constraints that cannot be satisfied with the data already in store the upgrade transaction will abort with a "ConstraintError" DOMException.
*
*
* Throws an "InvalidStateError" DOMException if not called within an upgrade transaction.
*/
createIndex(name: string, keyPath: string | Iterable<string>, options?: IDBIndexParameters): IDBIndex;
Expand Down
170 changes: 85 additions & 85 deletions baselines/webworker.generated.d.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion baselines/webworker.iterable.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ interface IDBDatabase {
interface IDBObjectStore {
/**
* Creates a new index in store with the given name, keyPath and options and returns a new IDBIndex. If the keyPath and options define constraints that cannot be satisfied with the data already in store the upgrade transaction will abort with a "ConstraintError" DOMException.
*
*
* Throws an "InvalidStateError" DOMException if not called within an upgrade transaction.
*/
createIndex(name: string, keyPath: string | Iterable<string>, options?: IDBIndexParameters): IDBIndex;
Expand Down
2 changes: 1 addition & 1 deletion src/emitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function createTextWriter(newLine: string) {
}

function write(s: string) {
if (lineStart) {
if (s && lineStart) {
output += getIndentString(indent);
lineStart = false;
}
Expand Down
6 changes: 3 additions & 3 deletions src/widlprocess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ function addComments(obj: any, commentMap: Record<string, string>, container: st
const key = container.toLowerCase() + (member ? "-" + member.toLowerCase() : "");
if (commentMap[key]) {
const comments = commentMap[key].split("\n");
obj["comment"] = "/**\n * ";
obj["comment"] += comments.join("\n * ");
obj["comment"] += "\n */";
obj["comment"] = "/**\n";
obj["comment"] += comments.map(c => ` * ${c}`.trimRight() + "\n").join("");
obj["comment"] += " */";
}
}

Expand Down

0 comments on commit d52565b

Please sign in to comment.