Skip to content

Commit d52565b

Browse files
saschanazsandersn
andauthored
Trim line ends (#947)
* Trim line ends of comments * Indent only for non-empty line * accept baselines Co-authored-by: Nathan Shively-Sanders <[email protected]>
1 parent c6d98e4 commit d52565b

6 files changed

+253
-253
lines changed

baselines/dom.generated.d.ts

+162-162
Large diffs are not rendered by default.

baselines/dom.iterable.generated.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ interface IDBDatabase {
119119
interface IDBObjectStore {
120120
/**
121121
* 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.
122-
*
122+
*
123123
* Throws an "InvalidStateError" DOMException if not called within an upgrade transaction.
124124
*/
125125
createIndex(name: string, keyPath: string | Iterable<string>, options?: IDBIndexParameters): IDBIndex;

baselines/webworker.generated.d.ts

+85-85
Large diffs are not rendered by default.

baselines/webworker.iterable.generated.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ interface IDBDatabase {
6060
interface IDBObjectStore {
6161
/**
6262
* 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.
63-
*
63+
*
6464
* Throws an "InvalidStateError" DOMException if not called within an upgrade transaction.
6565
*/
6666
createIndex(name: string, keyPath: string | Iterable<string>, options?: IDBIndexParameters): IDBIndex;

src/emitter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function createTextWriter(newLine: string) {
6868
}
6969

7070
function write(s: string) {
71-
if (lineStart) {
71+
if (s && lineStart) {
7272
output += getIndentString(indent);
7373
lineStart = false;
7474
}

src/widlprocess.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ function addComments(obj: any, commentMap: Record<string, string>, container: st
103103
const key = container.toLowerCase() + (member ? "-" + member.toLowerCase() : "");
104104
if (commentMap[key]) {
105105
const comments = commentMap[key].split("\n");
106-
obj["comment"] = "/**\n * ";
107-
obj["comment"] += comments.join("\n * ");
108-
obj["comment"] += "\n */";
106+
obj["comment"] = "/**\n";
107+
obj["comment"] += comments.map(c => ` * ${c}`.trimRight() + "\n").join("");
108+
obj["comment"] += " */";
109109
}
110110
}
111111

0 commit comments

Comments
 (0)