Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// if you want to see the available pre-defined formats, transforms and transform groups uncomment this
// console.log(StyleDictionaryPackage);
StyleDictionaryPackage.registerFormat({
name: 'json/flat',
formatter: function(dictionary) {
return JSON.stringify(dictionary.allProperties, null, 2);
}
});
StyleDictionaryPackage.registerTemplate({
name: 'ios/plist',
template: __dirname + '/templates/ios-plist.template'
});
StyleDictionaryPackage.registerTemplate({
name: 'android/xml',
template: __dirname + '/templates/android-xml.template'
});
StyleDictionaryPackage.registerTemplate({
name: 'android/colors',
template: __dirname + '/templates/android-xml.template'
});
// I wanted to use this custom transform instead of the "prefix" property applied to the platforms
// because I wanted to apply the "token" prefix only to actual tokens and not to the aliases
// but I've found out that in case of "name/cti/constant" the prefix was not respecting the case for the "prefix" part
//
// StyleDictionaryPackage.registerTransform({
// name: 'name/prefix-token',
// type: 'name',