Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import _ from 'lodash';
import { iosCommands } from 'appium-ios-driver';
import { errors } from 'appium-base-driver';
let extensions = {};
Object.assign(extensions, iosCommands.execute);
const iosExecute = extensions.execute;
extensions.execute = async function execute (script, args) {
if (!script.match(/^mobile:/) && !this.isWebContext()) {
throw new errors.NotImplementedError();
}
return await iosExecute.call(this, script, args);
};
extensions.executeAsync = async function executeAsync (script, args) {
if (!this.isWebContext()) {
throw new errors.NotImplementedError();
}
args = this.convertElementsForAtoms(args);