-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deprecate extents but replace its behavior
- Loading branch information
Showing
3 changed files
with
41 additions
and
19 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
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,16 @@ | ||
/** | ||
* Whether we need to calculate the domain or not | ||
* @param {Array<string|number|null>|Function|undefined} domain - The domain to check | ||
* @returns {boolean|Array<string|number>} Whether we need to calculate the domain | ||
*/ | ||
export default function getCompleteDomain(domain) { | ||
// If there's no domain, calculate it | ||
if (!domain) return false; | ||
// If the domain is a function, calculate it | ||
if (typeof domain === 'function') return false; | ||
// If the domain is an array with a null value, calculate it | ||
if (Array.isArray(domain) && domain.includes(null)) return false; | ||
// Otherwise, don't calculate it | ||
// @ts-ignore | ||
return domain; | ||
} |