react-native-icon-switcher 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-icon-switcher",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Switch the app icon at runtime on React Native and Expo from one config file, with the native wiring generated for you",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -43,20 +43,27 @@ function applyXcodeProject(project, cfg) {
|
|
|
43
43
|
if (!settings.ASSETCATALOG_COMPILER_APPICON_NAME) {
|
|
44
44
|
console.warn(`[react-native-icon-switcher] Build configuration "${String(configName)}" has no ASSETCATALOG_COMPILER_APPICON_NAME — set the primary app icon in Xcode`);
|
|
45
45
|
}
|
|
46
|
-
settings
|
|
47
|
-
|
|
48
|
-
settings.ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = 'NO';
|
|
46
|
+
_setBuildSettingPreservingQuoting(settings, 'ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES', alternateNames);
|
|
47
|
+
_setBuildSettingPreservingQuoting(settings, 'ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS', 'NO');
|
|
49
48
|
}
|
|
50
49
|
return project;
|
|
51
50
|
}
|
|
52
|
-
function
|
|
51
|
+
function _setBuildSettingPreservingQuoting(settings, key, desired) {
|
|
52
|
+
const existing = settings[key];
|
|
53
|
+
if (existing !== undefined && _unquote(existing) === desired) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
settings[key] = _formatXcodeprojBuildSettingValue(desired);
|
|
57
|
+
}
|
|
58
|
+
function _formatXcodeprojBuildSettingValue(raw) {
|
|
53
59
|
if (!raw) {
|
|
54
60
|
return '';
|
|
55
61
|
}
|
|
56
|
-
if (
|
|
62
|
+
if (/^[A-Za-z0-9_$/:.]+$/.test(raw)) {
|
|
57
63
|
return raw;
|
|
58
64
|
}
|
|
59
|
-
|
|
65
|
+
const escaped = raw.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
|
|
66
|
+
return `"${escaped}"`;
|
|
60
67
|
}
|
|
61
68
|
function _findFirstApplicationTarget(project) {
|
|
62
69
|
var _a;
|