From 00cb550c862e348ebb9413327707e896c9c609ce Mon Sep 17 00:00:00 2001 From: ankit-tailor Date: Fri, 14 Apr 2023 16:21:11 +0530 Subject: [PATCH 1/2] fix: optional chaining --- packages/react/src/utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/react/src/utils.ts b/packages/react/src/utils.ts index 4a80a2d99..818bdd535 100644 --- a/packages/react/src/utils.ts +++ b/packages/react/src/utils.ts @@ -79,7 +79,8 @@ export function resolveStringToken( config?.tokens[token_scale] && config?.tokens[token_scale].hasOwnProperty(splitCurrentToken[0]) ) { - const tokenValue = config?.tokens[token_scale][splitCurrentToken[0]]; + const tokenValue = + config?.tokens?.[token_scale]?.[splitCurrentToken[0]]; typeofResult = typeof tokenValue; if (typeof tokenValue !== 'undefined' && tokenValue !== null) { From f0c7a84c102c92d6648ab53372461d9be046e230 Mon Sep 17 00:00:00 2001 From: ankit-tailor Date: Fri, 14 Apr 2023 16:39:18 +0530 Subject: [PATCH 2/2] fix: release dank-style react 0.3.13 --- example/storybook/package.json | 2 +- packages/react/CHANGELOG.md | 6 ++++++ packages/react/package.json | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/example/storybook/package.json b/example/storybook/package.json index fd2a94915..ad51ce367 100644 --- a/example/storybook/package.json +++ b/example/storybook/package.json @@ -41,7 +41,7 @@ }, "devDependencies": { "@babel/core": "^7.19.3", - "@dank-style/react": "0.3.12", + "@dank-style/react": "0.3.13", "@storybook/addon-actions": "^6.5.14", "@storybook/addon-controls": "^6.5.14", "@storybook/addon-docs": "^6.5.15", diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index c3da3abb6..24f3921c4 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -1,5 +1,11 @@ # @dank-style/react +## 0.3.13 + +### Patch Changes + +- Optional chaining in token resolution + ## 0.3.12 ### Patch Changes diff --git a/packages/react/package.json b/packages/react/package.json index e5e71ffe6..6dbe592d7 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@dank-style/react", - "version": "0.3.12", + "version": "0.3.13", "main": "lib/commonjs/index", "types": "lib/typescript/index.d.ts", "module": "lib/module/index",