Skip to content

Commit

Permalink
chore: fix update script to revert code format (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi authored Feb 5, 2024
1 parent 2e8f1af commit 3e14aa8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/update-unicode-properties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,24 +269,26 @@ function makeClassDeclarationCode(versions: string[]): string {
const fields = versions
.map(
(v) =>
`private _raw${v}: string\nprivate _set${v}: Set<string> | undefined`,
`private _raw${v}: string\n\nprivate _set${v}: Set<string> | undefined`,
)
.join("\n")
.join("\n\n")
const parameters = versions.map((v) => `raw${v}: string`).join(", ")
const init = versions.map((v) => `this._raw${v} = raw${v}`).join("\n")
const getters = versions
.map(
(v) =>
`public get es${v}(): Set<string> { return this._set${v} ?? (this._set${v} = new Set(this._raw${v}.split(" "))) }`,
)
.join("\n")
.join("\n\n")

return `
class DataSet {
${fields}
public constructor(${parameters}) {
${init}
}
${getters}
}
`
Expand Down

0 comments on commit 3e14aa8

Please sign in to comment.