Skip to content

Commit

Permalink
isNumber-filter (#906)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasoppermann authored Apr 19, 2024
1 parent ae118b7 commit b21bcd4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/filters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export {isDeprecated} from './isDeprecated'
export {isFromFile} from './isFromFile'
export {isFontFamily} from './isFontFamily'
export {isFontWeight} from './isFontWeight'
export {isNumber} from './isNumber'
export {isShadow} from './isShadow'
export {isSource} from './isSource'
export {isTypography} from './isTypography'
8 changes: 8 additions & 0 deletions src/filters/isNumber.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import type StyleDictionary from 'style-dictionary'

/**
* @description Checks if token type is a number
* @param token [StyleDictionary.TransformedToken](/~https://github.com/amzn/style-dictionary/blob/main/types/TransformedToken.d.ts)
* @returns boolean
*/
export const isNumber = (token: StyleDictionary.TransformedToken): boolean => token.$type === 'number'

0 comments on commit b21bcd4

Please sign in to comment.