@@ -4,12 +4,12 @@ import { typography } from './typography';
44const designTokens = require ( '../../figma/tokens.json' ) ;
55
66/**
7- * Trim string between 2 characters
7+ * Trim string between 2 characters.
88 *
9- * @param { string } str - The string to be trimmed
10- * @param { string } firstChar - The first character to start from '$'
11- * @param { string } lastChar - The last character to stop at '.'
12- * @returns { string }
9+ * @param str - The string to be trimmed.
10+ * @param firstChar - The first character to start from '$'.
11+ * @param lastChar - The last character to stop at '.'.
12+ * @returns A string from characters between firstChar and lastChar.
1313 */
1414function trimStringBetweenCharacters (
1515 str : string ,
@@ -20,22 +20,22 @@ function trimStringBetweenCharacters(
2020}
2121
2222/**
23- * Trim string after character. Default character is '.'
23+ * Trim string after character. Default character is '.'.
2424 *
25- * @param { string } str - The string to be trimmed
26- * @param { string } char - The first character to start from '.'
27- * @returns { string }
25+ * @param str - The string to be trimmed.
26+ * @param char - The first character to start from '.'.
27+ * @returns A string from characters after the `char`.
2828 */
2929function trimStringAfterCharacter ( str : string , char = '.' ) {
3030 return str . split ( char ) . pop ( ) ;
3131}
3232
3333/**
34- * Creates a new figma token object by creating object keys from a string
34+ * Creates a new figma token object by creating object keys from a string.
3535 *
36- * @param { string } str - The object path as a string to be trimmed into object keys
37- * @param { Object } obj - Global figma token object
38- * @returns { Object } - New object formed from object keys created from provided string
36+ * @param str - The object path as a string to be trimmed into object keys.
37+ * @param obj - Global figma token object.
38+ * @returns New object formed from object keys created from provided string.
3939 */
4040function createNewFigmaTokenObject ( str : string , obj : any ) {
4141 const firstString = trimStringBetweenCharacters ( str ) ;
0 commit comments