mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-02 17:18:58 +08:00
[RCTConvert] Sort mapping keys alphabetically in RCTLogError
Summary: Closes https://github.com/facebook/react-native/pull/1679 Github Author: Christopher Dro <hello@blick-labs.com> Test Plan: Imported from GitHub, without a `Test Plan:` line.
This commit is contained in:
@@ -187,7 +187,7 @@ NSNumber *RCTConvertEnumValue(const char *typeName, NSDictionary *mapping, NSNum
|
||||
}
|
||||
id value = mapping[json];
|
||||
if (!value && [json description].length > 0) {
|
||||
RCTLogError(@"Invalid %s '%@'. should be one of: %@", typeName, json, [mapping allKeys]);
|
||||
RCTLogError(@"Invalid %s '%@'. should be one of: %@", typeName, json, [[mapping allKeys] sortedArrayUsingSelector: @selector(caseInsensitiveCompare:)]);
|
||||
}
|
||||
return value ?: defaultValue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user