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, 9 insertions, 2 deletions
diff --git a/platform/darwin/scripts/generate-style-code.js b/platform/darwin/scripts/generate-style-code.js
index 3809e9c636..0e5bf89fd4 100755
--- a/platform/darwin/scripts/generate-style-code.js
+++ b/platform/darwin/scripts/generate-style-code.js
@@ -248,13 +248,20 @@ global.testHelperMessage = function (property, layerType, isFunction) {
global.propertyDoc = function (propertyName, property, layerType, kind) {
// Match references to other property names & values.
// Requires the format 'When `foo` is set to `bar`,'.
- let doc = property.doc.replace(/`([^`]+?)` is set to `([^`]+?)`/g, function (m, peerPropertyName, propertyValue, offset, str) {
+ let doc = property.doc.replace(/`([^`]+?)` is set to `([^`]+?)`(?: or `([^`]+?)`)?/g, function (m, peerPropertyName, propertyValue, secondPropertyValue, offset, str) {
let otherProperty = camelizeWithLeadingLowercase(peerPropertyName);
let otherValue = objCType(layerType, peerPropertyName) + camelize(propertyValue);
if (property.type == 'array' && kind == 'light') {
otherValue = propertyValue;
}
- return '`' + `${otherProperty}` + '` is set to `' + `${otherValue}` + '`';
+ const firstPropertyValue = '`' + `${otherProperty}` + '` is set to `' + `${otherValue}` + '`';
+ if (secondPropertyValue) {
+ return firstPropertyValue + ' or `' +
+ objCType(layerType, peerPropertyName) + camelize(secondPropertyValue) +
+ '`';
+ } else {
+ return firstPropertyValue;
+ }
});
// Match references to our own property values.
// Requires the format 'is equivalent to `bar`'.