src/cordova/util.js
function getPlatformApiFunction (dir) {
    let PlatformApi;
    try {
        PlatformApi = exports.requireNoCache(dir);
    } catch (err) {
        // Module not found or threw error during loading
        err.message = `Unable to load Platform API from ${dir}:\n${err.message}`;
        throw err;
    }

    // Module doesn't implement the expected interface
    if (!PlatformApi || !PlatformApi.createPlatform) {
        throw new Error(`The package at "${dir}" does not appear to implement the Cordova Platform API.`);
    }

    events.emit('verbose', 'Platform API successfully found in: ' + dir);
    return PlatformApi;
}
function getPlatformApiFunction (dir) {
    let PlatformApi;
    try {
        PlatformApi = exports.requireNoCache(dir);
    } catch (err) {
        // Module not found or threw error during loading
        err.message = `Unable to load Platform API from ${dir}:\n${err.message}`;
        throw err;
    }

    // Module doesn't implement the expected interface
    if (!PlatformApi || !PlatformApi.createPlatform) {
        throw new Error(`The package at "${dir}" does not appear to implement the Cordova Platform API.`);
    }

    events.emit('verbose', 'Platform API successfully found in: ' + dir);
    return PlatformApi;
}
Returns the API of the platform contained in `dir`. Potential errors : module isn't found, can't load or doesn't implement the expected interface.