Closed mjmonline closed 2 months ago
This pull request is automatically being deployed by Amplify Hosting (learn more).
Access this pull request here: https://pr-1347.d16eby4ekpss5y.amplifyapp.com
Could you add a test for this so we can ensure not to create a regression for this bug in the future?
Inside __tests__/filterTokens.test.js
@jorenbroekema added one of my problematic tokens to the test file. The current tests fails without the fix so I didn't add any new tests. I noticed that it only happens with my shadow tokens and not with any other type of token, I guess it's the structure of those tokens.
I recognise that the plugin I use could export them with a nicer format but nonetheless, no harm in this fix.
Alright nice, I was trying to make sense of the code and your test and I did get it eventually but I figured I'd make a couple of changes and make it a bit easier to follow the code / test you contributed, https://github.com/amzn/style-dictionary/pull/1354 it's here, I committed it so you are a co-author of it and will still count as a contribution to this project with your name, I hope that's fine!
closing this and proceeding with https://github.com/amzn/style-dictionary/pull/1354 to fix it
Issue #, if available: My tokens often have a "description" key, if the value of that is
null
then it results in the following error:Description of changes: Added a check (if (!token)) right after initializing the acc variable within the reduce function inside filterTokenObject.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.