This repository has been archived by the owner on Feb 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Involved fixing two sketchy null checks. Nothing huge. NOTE: There's lots of non flow-strict code that makes checks on keys. Empty string is an invalid key. This is the behavior right now, so I left it unchanged. I extracted it to another module because I'll be using it to check the existence of keys in other parts of the code too. Reviewed By: kedromelon Differential Revision: D16595680 fbshipit-source-id: 13a08e3b2477ba46ba2a2c66089afe47edccb20a
- Loading branch information
1 parent
6972278
commit 594a14f
Showing
2 changed files
with
26 additions
and
3 deletions.
There are no files selected for viewing
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,22 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* Provides utilities for handling draftjs keys. | ||
* | ||
* @emails oncall+draft_js | ||
* @flow strict-local | ||
* @format | ||
*/ | ||
|
||
'use strict'; | ||
|
||
function notEmptyKey(key: ?string): boolean %checks { | ||
return key != null && key != ''; | ||
} | ||
|
||
module.exports = { | ||
notEmptyKey, | ||
}; |