Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sharkey
Manage
Activity
Members
Labels
Plan
Issues
336
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
23
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TransFem.org
Sharkey
Commits
08413514
Unverified
Commit
08413514
authored
5 years ago
by
syuilo
Browse files
Options
Downloads
Patches
Plain Diff
typo
parent
467a21f0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CONTRIBUTING.md
+2
-2
2 additions, 2 deletions
CONTRIBUTING.md
with
2 additions
and
2 deletions
CONTRIBUTING.md
+
2
−
2
View file @
08413514
...
@@ -152,13 +152,13 @@ if (user == null) {
...
@@ -152,13 +152,13 @@ if (user == null) {
```
```
という処理を
`ensure`
を使うと
という処理を
`ensure`
を使うと
```
ts
```
ts
const
user
=
await
Users
.
findOne
(
userId
).
then
(
esure
);
const
user
=
await
Users
.
findOne
(
userId
).
then
(
e
n
sure
);
// この時点で user の型は User
// この時点で user の型は User
```
```
という風に書けます。
という風に書けます。
もちろん
`ensure`
内部でエラーを握りつぶすようなことはしておらず、万が一
`undefined`
だった場合はPromiseがRejectされ後続の処理は実行されません。
もちろん
`ensure`
内部でエラーを握りつぶすようなことはしておらず、万が一
`undefined`
だった場合はPromiseがRejectされ後続の処理は実行されません。
```
ts
```
ts
const
user
=
await
Users
.
findOne
(
userId
).
then
(
esure
);
const
user
=
await
Users
.
findOne
(
userId
).
then
(
e
n
sure
);
// 万が一 Users.findOne の結果が undefined だったら、ensure でエラーが発生するので
// 万が一 Users.findOne の結果が undefined だったら、ensure でエラーが発生するので
// この行に到達することは無い
// この行に到達することは無い
// なので、.then(ensure) は
// なので、.then(ensure) は
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment