summaryrefslogtreecommitdiff
path: root/platform/darwin/scripts/generate-style-code.js
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/scripts/generate-style-code.js')
-rwxr-xr-xplatform/darwin/scripts/generate-style-code.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/platform/darwin/scripts/generate-style-code.js b/platform/darwin/scripts/generate-style-code.js
index 0e5bf89fd4..e89a4e29a3 100755
--- a/platform/darwin/scripts/generate-style-code.js
+++ b/platform/darwin/scripts/generate-style-code.js
@@ -102,6 +102,7 @@ global.objCTestValue = function (property, layerType, arraysAsStructs, indent) {
return property.default ? '@"false"' : '@"true"';
case 'number':
return '@"1"';
+ case 'formatted':
case 'string':
return `@"'${_.startCase(propertyName)}'"`;
case 'enum':
@@ -146,6 +147,7 @@ global.mbglTestValue = function (property, layerType) {
return property.default ? 'false' : 'true';
case 'number':
return '1.0';
+ case 'formatted':
case 'string':
return `"${_.startCase(propertyName)}"`;
case 'enum': {
@@ -218,6 +220,7 @@ global.testHelperMessage = function (property, layerType, isFunction) {
return 'testBool' + fnSuffix;
case 'number':
return 'testNumber' + fnSuffix;
+ case 'formatted':
case 'string':
return 'testString' + fnSuffix;
case 'enum':
@@ -385,6 +388,7 @@ global.describeType = function (property) {
return 'Boolean';
case 'number':
return 'numeric';
+ case 'formatted':
case 'string':
return 'string';
case 'enum':
@@ -428,6 +432,7 @@ global.describeValue = function (value, property, layerType) {
return value ? '`YES`' : '`NO`';
case 'number':
return 'the float ' + '`' + formatNumber(value) + '`';
+ case 'formatted':
case 'string':
if (value === '') {
return 'the empty string';
@@ -509,6 +514,7 @@ global.propertyType = function (property) {
return 'NSNumber *';
case 'number':
return 'NSNumber *';
+ case 'formatted':
case 'string':
return 'NSString *';
case 'enum':
@@ -539,7 +545,8 @@ global.isInterpolatable = function (property) {
const type = property.type === 'array' ? property.value : property.type;
return type !== 'boolean' &&
type !== 'enum' &&
- type !== 'string';
+ type !== 'string' &&
+ type !== 'formatted';
};
global.valueTransformerArguments = function (property) {
@@ -549,6 +556,7 @@ global.valueTransformerArguments = function (property) {
return ['bool', objCType];
case 'number':
return ['float', objCType];
+ case 'formatted':
case 'string':
return ['std::string', objCType];
case 'enum':
@@ -582,6 +590,7 @@ global.mbglType = function(property) {
return 'bool';
case 'number':
return 'float';
+ case 'formatted':
case 'string':
return 'std::string';
case 'enum': {