@expo/config-plugins 5.0.3 → 5.0.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/build/ios/Scheme.js +2 -2
- package/build/ios/Scheme.js.map +1 -1
- package/package.json +2 -2
package/build/ios/Scheme.js
CHANGED
|
@@ -71,7 +71,7 @@ function appendScheme(scheme, infoPlist) {
|
|
|
71
71
|
|
|
72
72
|
const existingSchemes = (_infoPlist$CFBundleUR = infoPlist.CFBundleURLTypes) !== null && _infoPlist$CFBundleUR !== void 0 ? _infoPlist$CFBundleUR : [];
|
|
73
73
|
|
|
74
|
-
if (existingSchemes.some(({
|
|
74
|
+
if (existingSchemes !== null && existingSchemes !== void 0 && existingSchemes.some(({
|
|
75
75
|
CFBundleURLSchemes
|
|
76
76
|
}) => CFBundleURLSchemes.includes(scheme))) {
|
|
77
77
|
return infoPlist;
|
|
@@ -113,7 +113,7 @@ function removeScheme(scheme, infoPlist) {
|
|
|
113
113
|
function hasScheme(scheme, infoPlist) {
|
|
114
114
|
const existingSchemes = infoPlist.CFBundleURLTypes;
|
|
115
115
|
if (!Array.isArray(existingSchemes)) return false;
|
|
116
|
-
return existingSchemes.some(({
|
|
116
|
+
return existingSchemes === null || existingSchemes === void 0 ? void 0 : existingSchemes.some(({
|
|
117
117
|
CFBundleURLSchemes: schemes
|
|
118
118
|
}) => Array.isArray(schemes) ? schemes.includes(scheme) : false);
|
|
119
119
|
}
|
package/build/ios/Scheme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Scheme.js","names":["withScheme","createInfoPlistPluginWithPropertyGuard","setScheme","infoPlistProperty","expoConfigProperty","getScheme","config","Array","isArray","scheme","validate","value","filter","infoPlist","ios","bundleIdentifier","push","length","CFBundleURLTypes","CFBundleURLSchemes","appendScheme","existingSchemes","some","includes","removeScheme","map","bundleUrlType","index","indexOf","splice","undefined","Boolean","hasScheme","schemes","getSchemesFromPlist","reduce"],"sources":["../../src/ios/Scheme.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { createInfoPlistPluginWithPropertyGuard } from '../plugins/ios-plugins';\nimport { InfoPlist, URLScheme } from './IosConfig.types';\n\nexport const withScheme = createInfoPlistPluginWithPropertyGuard(\n setScheme,\n {\n infoPlistProperty: 'CFBundleURLTypes',\n expoConfigProperty: 'scheme',\n },\n 'withScheme'\n);\n\nexport function getScheme(config: { scheme?: string | string[] }): string[] {\n if (Array.isArray(config.scheme)) {\n const validate = (value: any): value is string => {\n return typeof value === 'string';\n };\n return config.scheme.filter<string>(validate);\n } else if (typeof config.scheme === 'string') {\n return [config.scheme];\n }\n return [];\n}\n\nexport function setScheme(\n config: Partial<Pick<ExpoConfig, 'scheme' | 'ios'>>,\n infoPlist: InfoPlist\n): InfoPlist {\n const scheme = [\n ...getScheme(config),\n // @ts-ignore: TODO: ios.scheme is an unreleased -- harder to add to turtle v1.\n ...getScheme(config.ios ?? {}),\n ];\n // Add the bundle identifier to the list of schemes for easier Google auth and parity with Turtle v1.\n if (config.ios?.bundleIdentifier) {\n scheme.push(config.ios.bundleIdentifier);\n }\n if (scheme.length === 0) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n CFBundleURLTypes: [{ CFBundleURLSchemes: scheme }],\n };\n}\n\nexport function appendScheme(scheme: string | null, infoPlist: InfoPlist): InfoPlist {\n if (!scheme) {\n return infoPlist;\n }\n\n const existingSchemes = infoPlist.CFBundleURLTypes ?? [];\n if (existingSchemes
|
|
1
|
+
{"version":3,"file":"Scheme.js","names":["withScheme","createInfoPlistPluginWithPropertyGuard","setScheme","infoPlistProperty","expoConfigProperty","getScheme","config","Array","isArray","scheme","validate","value","filter","infoPlist","ios","bundleIdentifier","push","length","CFBundleURLTypes","CFBundleURLSchemes","appendScheme","existingSchemes","some","includes","removeScheme","map","bundleUrlType","index","indexOf","splice","undefined","Boolean","hasScheme","schemes","getSchemesFromPlist","reduce"],"sources":["../../src/ios/Scheme.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { createInfoPlistPluginWithPropertyGuard } from '../plugins/ios-plugins';\nimport { InfoPlist, URLScheme } from './IosConfig.types';\n\nexport const withScheme = createInfoPlistPluginWithPropertyGuard(\n setScheme,\n {\n infoPlistProperty: 'CFBundleURLTypes',\n expoConfigProperty: 'scheme',\n },\n 'withScheme'\n);\n\nexport function getScheme(config: { scheme?: string | string[] }): string[] {\n if (Array.isArray(config.scheme)) {\n const validate = (value: any): value is string => {\n return typeof value === 'string';\n };\n return config.scheme.filter<string>(validate);\n } else if (typeof config.scheme === 'string') {\n return [config.scheme];\n }\n return [];\n}\n\nexport function setScheme(\n config: Partial<Pick<ExpoConfig, 'scheme' | 'ios'>>,\n infoPlist: InfoPlist\n): InfoPlist {\n const scheme = [\n ...getScheme(config),\n // @ts-ignore: TODO: ios.scheme is an unreleased -- harder to add to turtle v1.\n ...getScheme(config.ios ?? {}),\n ];\n // Add the bundle identifier to the list of schemes for easier Google auth and parity with Turtle v1.\n if (config.ios?.bundleIdentifier) {\n scheme.push(config.ios.bundleIdentifier);\n }\n if (scheme.length === 0) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n CFBundleURLTypes: [{ CFBundleURLSchemes: scheme }],\n };\n}\n\nexport function appendScheme(scheme: string | null, infoPlist: InfoPlist): InfoPlist {\n if (!scheme) {\n return infoPlist;\n }\n\n const existingSchemes = infoPlist.CFBundleURLTypes ?? [];\n if (existingSchemes?.some(({ CFBundleURLSchemes }) => CFBundleURLSchemes.includes(scheme))) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n CFBundleURLTypes: [\n ...existingSchemes,\n {\n CFBundleURLSchemes: [scheme],\n },\n ],\n };\n}\n\nexport function removeScheme(scheme: string | null, infoPlist: InfoPlist): InfoPlist {\n if (!scheme) {\n return infoPlist;\n }\n\n // No need to remove if we don't have any\n if (!infoPlist.CFBundleURLTypes) {\n return infoPlist;\n }\n\n infoPlist.CFBundleURLTypes = infoPlist.CFBundleURLTypes.map((bundleUrlType) => {\n const index = bundleUrlType.CFBundleURLSchemes.indexOf(scheme);\n if (index > -1) {\n bundleUrlType.CFBundleURLSchemes.splice(index, 1);\n if (bundleUrlType.CFBundleURLSchemes.length === 0) {\n return undefined;\n }\n }\n return bundleUrlType;\n }).filter(Boolean) as URLScheme[];\n\n return infoPlist;\n}\n\nexport function hasScheme(scheme: string, infoPlist: InfoPlist): boolean {\n const existingSchemes = infoPlist.CFBundleURLTypes;\n\n if (!Array.isArray(existingSchemes)) return false;\n\n return existingSchemes?.some(({ CFBundleURLSchemes: schemes }: any) =>\n Array.isArray(schemes) ? schemes.includes(scheme) : false\n );\n}\n\nexport function getSchemesFromPlist(infoPlist: InfoPlist): string[] {\n if (Array.isArray(infoPlist.CFBundleURLTypes)) {\n return infoPlist.CFBundleURLTypes.reduce<string[]>((schemes, { CFBundleURLSchemes }) => {\n if (Array.isArray(CFBundleURLSchemes)) {\n return [...schemes, ...CFBundleURLSchemes];\n }\n return schemes;\n }, []);\n }\n return [];\n}\n"],"mappings":";;;;;;;;;;;;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGO,MAAMA,UAAU,GAAG,IAAAC,oDAAA,EACxBC,SADwB,EAExB;EACEC,iBAAiB,EAAE,kBADrB;EAEEC,kBAAkB,EAAE;AAFtB,CAFwB,EAMxB,YANwB,CAAnB;;;AASA,SAASC,SAAT,CAAmBC,MAAnB,EAAqE;EAC1E,IAAIC,KAAK,CAACC,OAAN,CAAcF,MAAM,CAACG,MAArB,CAAJ,EAAkC;IAChC,MAAMC,QAAQ,GAAIC,KAAD,IAAiC;MAChD,OAAO,OAAOA,KAAP,KAAiB,QAAxB;IACD,CAFD;;IAGA,OAAOL,MAAM,CAACG,MAAP,CAAcG,MAAd,CAA6BF,QAA7B,CAAP;EACD,CALD,MAKO,IAAI,OAAOJ,MAAM,CAACG,MAAd,KAAyB,QAA7B,EAAuC;IAC5C,OAAO,CAACH,MAAM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rC,OAAO,CAAC,GAAGc,OAAJ,EAAa,GAAGd,kBAAhB,CAAP;MACD;;MACD,OAAOc,OAAP;IACD,CALM,EAKJ,EALI,CAAP;EAMD;;EACD,OAAO,EAAP;AACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/config-plugins",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.4",
|
|
4
4
|
"description": "A library for Expo config plugins",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"publishConfig": {
|
|
57
57
|
"access": "public"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "1a87dcc55895a9e16e3d4fd0fa78f2244c1d961f"
|
|
60
60
|
}
|