routie dev init since i didn't adhere to any proper guidance up until now
This commit is contained in:
Generated
Vendored
+31
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* Type guard to check if a group option is a group with overrides
|
||||
* configuration.
|
||||
*
|
||||
* Determines whether a group element is a special configuration object that
|
||||
* contains group settings rather than being a regular group name or newlines
|
||||
* option.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```ts
|
||||
* const groups = [
|
||||
* 'imports',
|
||||
* { group: 'foo', commentAbove: '// Components' },
|
||||
* 'components',
|
||||
* { newlinesBetween: 1 },
|
||||
* 'utils',
|
||||
* ]
|
||||
*
|
||||
* isGroupWithOverridesOption(groups[0]) // false (string)
|
||||
* isGroupWithOverridesOption(groups[1]) // true
|
||||
* isGroupWithOverridesOption(groups[3]) // false (newlines option)
|
||||
* ```
|
||||
*
|
||||
* @param groupOption - A single element from the groups configuration array.
|
||||
* @returns True if the element is a group with overrides configuration object.
|
||||
*/
|
||||
function isGroupWithOverridesOption(groupOption) {
|
||||
return typeof groupOption === 'object' && 'group' in groupOption
|
||||
}
|
||||
export { isGroupWithOverridesOption }
|
||||
Reference in New Issue
Block a user