-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #270 from jamashita/develop
Merge pull request #264 from jamashita/release
- Loading branch information
Showing
84 changed files
with
1,154 additions
and
3,210 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"packages/**/src/**/*.{ts,tsx}": "eslint --fix --quiet", | ||
"src/**/*.{ts,tsx}": "yarn format && yarn lint", | ||
"package.json": "sort-package-json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
[tools] | ||
node = "20.10.0" | ||
node = "20.12.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,14 @@ | ||
.husky/ | ||
.github/ | ||
.husky/ | ||
.idea/ | ||
coverage/ | ||
.editorconfig | ||
.eslintignore | ||
.eslintrc | ||
.lintstagedrc.json | ||
.releaserc.json | ||
babel.config.cjs | ||
biome.json | ||
commitlint.config.cjs | ||
jest.config.cjs | ||
lerna.json | ||
tsconfig.compilation.json | ||
tsconfig.json | ||
tsconfig.build.json | ||
tsconfig.build.tsbuildinfo | ||
vitest.config.ts | ||
**/*.spec.ts | ||
*.log | ||
*.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
nodeLinker: node-modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.6.4/schema.json", | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true | ||
} | ||
}, | ||
"formatter": { | ||
"enabled": true, | ||
"indentStyle": "space", | ||
"lineWidth": 150 | ||
}, | ||
"javascript": { | ||
"formatter": { | ||
"enabled": true, | ||
"quoteStyle": "single", | ||
"jsxQuoteStyle": "double", | ||
"trailingComma": "none", | ||
"semicolons": "always", | ||
"arrowParentheses": "always" | ||
}, | ||
"parser": { | ||
"unsafeParameterDecoratorsEnabled": true | ||
} | ||
}, | ||
"vcs": { | ||
"enabled": true, | ||
"clientKind": "git", | ||
"useIgnoreFile": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,41 @@ | ||
import { Reject, Resolve, UnaryFunction } from '@jamashita/anden/type'; | ||
import { Address } from './Address.js'; | ||
import { ReadonlyAddress } from './ReadonlyAddress.js'; | ||
import type { Reject, Resolve, UnaryFunction } from '@jamashita/anden/type'; | ||
import type { Address } from './Address.js'; | ||
import type { ReadonlyAddress } from './ReadonlyAddress.js'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-extraneous-class | ||
export class AddressUtil { | ||
public static await<V, A extends Address<V>>(address: ReadonlyAddress<PromiseLike<V>>, callback: UnaryFunction<Set<V>, A>): Promise<A> { | ||
export namespace AddressUtil { | ||
export const wait = <V, A extends Address<V>>(address: ReadonlyAddress<PromiseLike<V>>, callback: UnaryFunction<Set<V>, A>): Promise<A> => { | ||
if (address.isEmpty()) { | ||
return Promise.resolve(callback(new Set())); | ||
} | ||
|
||
let rejected: boolean = false; | ||
let rejected = false; | ||
const set: Set<V> = new Set(); | ||
|
||
return new Promise((resolve: Resolve<A>, reject: Reject) => { | ||
address.forEach((value: PromiseLike<V>) => { | ||
value.then((v: V) => { | ||
if (rejected) { | ||
return; | ||
} | ||
for (const value of address.values()) { | ||
value.then( | ||
(v: V) => { | ||
if (rejected) { | ||
return; | ||
} | ||
|
||
set.add(v); | ||
set.add(v); | ||
|
||
if (set.size === address.size()) { | ||
resolve(callback(set)); | ||
} | ||
}, (e: unknown) => { | ||
if (rejected) { | ||
return; | ||
} | ||
if (set.size === address.size()) { | ||
resolve(callback(set)); | ||
} | ||
}, | ||
(e: unknown) => { | ||
if (rejected) { | ||
return; | ||
} | ||
|
||
rejected = true; | ||
rejected = true; | ||
|
||
reject(e); | ||
}); | ||
}); | ||
reject(e); | ||
} | ||
); | ||
} | ||
}); | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.