smartech-base-expo-plugin
Version:
Smartech Base Expo SDK's React Native Plugin For React Native Projects.
31 lines (30 loc) • 1.21 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Helper = void 0;
const iosConstants_1 = require("./iosConstants");
class Helper {
static Ios = class {
static addDeepLinkHandler(content, props) {
const smartechContentLines = content.split("\n");
const lastLine = this.getLastLine(smartechContentLines);
const deepLinkHandlerLines = (0, iosConstants_1.deepLinkHandlerSnippet)(props.deepLinkDelay);
const smartechDelegateContents = [
...smartechContentLines.slice(0, lastLine + 1),
deepLinkHandlerLines,
...smartechContentLines.slice(lastLine + 1),
].join("\n");
return smartechDelegateContents;
}
;
static getLastLine = (lineArray) => {
return lineArray.lastIndexOf("@end") - 1;
};
};
static Android = class {
static addDependency(appContents, dependency, version) {
const dependencyTemplate = `api "${dependency}:${version}"`;
return appContents.replace('dependencies {', `dependencies {\n ${dependencyTemplate}`);
}
};
}
exports.Helper = Helper;