var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
import { Auth } from 'aws-amplify';
import _ from 'lodash';
/**
 * Resend the user's account confirmation code
 * @param username
 * @returns result or undefined
 */
export const OnResendSignup = (username) => __awaiter(this, void 0, void 0, function* () {
    if (_.isNil(username) || _.isEmpty(username)) {
        if (__DEV__)
            console.log('**** OnResendSignup: no username ****');
        return undefined;
    }
    try {
        if (__DEV__)
            console.log('**** OnResendSignup: send to Cognito ****');
        const result = yield Auth.resendSignUp(username);
        if (__DEV__)
            console.log('**** OnResendSignup: result: ', result);
        return result;
    }
    catch (error) {
        if (__DEV__)
            console.log(error);
        return error;
    }
});
export default OnResendSignup;
//# sourceMappingURL=OnResendSignup.js.map