Commit d3b73e26 authored by David Burke's avatar David Burke

Updated rxjs tslint deprecation warnings

parent c8373cba
Pipeline #36149760 passed with stages
in 8 minutes and 21 seconds
FROM node:8-alpine
FROM node:10-alpine
RUN mkdir /dist
WORKDIR /dist
......
......@@ -27,7 +27,7 @@ import * as fromAccount from "./account.reducer";
import { IS_EXTENSION } from "../constants";
import { UserService } from "./user";
import { Store } from "@ngrx/store";
import { Store, select } from "@ngrx/store";
import { IState } from "../app.reducers";
import { HttpErrorResponse } from "@angular/common/http";
import { SetPasswordActionTypes } from "./reset-password/set-password/set-password.actions";
......@@ -37,7 +37,7 @@ export class LoginEffects {
@Effect()
login$ = this.actions$.pipe(
ofType<LoginAction>(AccountActionTypes.LOGIN),
withLatestFrom(this.store.select(fromAccount.getLoginForm)),
withLatestFrom(this.store.pipe(select(fromAccount.getLoginForm))),
map(([action, form]) => form.value),
exhaustMap(auth => {
const callLogin = () => {
......@@ -68,35 +68,34 @@ export class LoginEffects {
);
@Effect({ dispatch: false })
loginSuccess$ = this.actions$
.ofType(
loginSuccess$ = this.actions$.pipe(
ofType(
AccountActionTypes.LOGIN_SUCCESS,
SetPasswordActionTypes.SET_PASSWORD_SUCCESS
)
.pipe(
tap(() => {
if (IS_EXTENSION) {
this.router.navigate(["/popup"]);
} else {
this.router.navigate(["/list"]);
}
})
);
),
tap(() => {
if (IS_EXTENSION) {
this.router.navigate(["/popup"]);
} else {
this.router.navigate(["/list"]);
}
})
);
@Effect({ dispatch: false })
loginRedirect$ = this.actions$
.ofType(
loginRedirect$ = this.actions$.pipe(
ofType(
AccountActionTypes.LOGIN_REDIRECT,
AccountActionTypes.LOGOUT_SUCCESS
)
.pipe(
tap(() => {
this.router.navigate(["/login"], { replaceUrl: true });
})
);
),
tap(() => {
this.router.navigate(["/login"], { replaceUrl: true });
})
);
@Effect()
logout$ = this.actions$.ofType(AccountActionTypes.LOGOUT).pipe(
logout$ = this.actions$.pipe(
ofType(AccountActionTypes.LOGOUT),
exhaustMap(() =>
this.userService
.logout()
......@@ -106,48 +105,49 @@ export class LoginEffects {
);
@Effect({ dispatch: false })
logoutSuccess$ = this.actions$
.ofType(AccountActionTypes.LOGOUT_SUCCESS)
.pipe(tap(() => localStorage.clear()));
logoutSuccess$ = this.actions$.pipe(
ofType(AccountActionTypes.LOGOUT_SUCCESS),
tap(() => localStorage.clear())
);
@Effect()
handleAPIError$ = this.actions$
.ofType<HandleAPIErrorAction>(AccountActionTypes.HANDLE_API_ERROR)
.pipe(
map(action => action.payload),
exhaustMap(err => {
const res: HttpErrorResponse = err.res;
if (res) {
if (res.status === 0) {
// Not so bad, network is just down
return observableOf(new APIFailureNetworkDownAction());
}
if ([401, 403].includes(res.status)) {
if (
res.status === 403 &&
res.error &&
res.error.detail === "User's email is not confirmed."
) {
return observableOf(new UserMustConfirmEmailAction());
}
return observableOf(new LogoutAction());
}
handleAPIError$ = this.actions$.pipe(
ofType<HandleAPIErrorAction>(AccountActionTypes.HANDLE_API_ERROR),
map(action => action.payload),
exhaustMap(err => {
const res: HttpErrorResponse = err.res;
if (res) {
if (res.status === 0) {
// Not so bad, network is just down
return observableOf(new APIFailureNetworkDownAction());
}
if (err.name === "Passit SDK Authentication Error") {
if ([401, 403].includes(res.status)) {
if (
res.status === 403 &&
res.error &&
res.error.detail === "User's email is not confirmed."
) {
return observableOf(new UserMustConfirmEmailAction());
}
return observableOf(new LogoutAction());
}
}
// This should never run
console.error("Unable to use api and unable to handle error", err);
return observableOf(new CriticalAPIErrorAction(err));
})
);
if (err.name === "Passit SDK Authentication Error") {
return observableOf(new LogoutAction());
}
// This should never run
console.error("Unable to use api and unable to handle error", err);
return observableOf(new CriticalAPIErrorAction(err));
})
);
@Effect({ dispatch: false })
userMustConfirmEmail$ = this.actions$
.ofType(AccountActionTypes.USER_MUST_CONFIRM_EMAIL)
.pipe(tap(() => this.router.navigate(["/confirm-email"])));
userMustConfirmEmail$ = this.actions$.pipe(
ofType(AccountActionTypes.USER_MUST_CONFIRM_EMAIL),
tap(() => this.router.navigate(["/confirm-email"]))
);
constructor(
private actions$: Actions,
......
import { take } from "rxjs/operators";
import { fakeAsync, inject, TestBed } from "@angular/core/testing";
import { Store, StoreModule } from "@ngrx/store";
import { Store, StoreModule, select } from "@ngrx/store";
import "rxjs/add/operator/take";
import { logout } from "../app.reducers";
......@@ -95,7 +95,9 @@ describe("AccountReducer", () => {
it("should logout a user", fakeAsync(
inject([Store], (store: Store<any>) => {
const isLoggedInSelector = store.select(fromAccount.getIsLoggedIn);
const isLoggedInSelector = store.pipe(
select(fromAccount.getIsLoggedIn)
);
// Login first
const user: IAuthStore = {
......
import { take } from "rxjs/operators";
import { Component } from "@angular/core";
import { Store } from "@ngrx/store";
import { Store, select } from "@ngrx/store";
import * as fromRoot from "../../app.reducers";
import * as fromAccount from "../account.reducer";
......@@ -24,7 +24,7 @@ import { SetValueAction } from "ngrx-forms";
`
})
export class ChangePasswordContainer {
form$ = this.store.select(fromAccount.getChangePasswordForm);
form$ = this.store.pipe(select(fromAccount.getChangePasswordForm));
hasStarted = false;
hasFinished = false;
showConfirm: boolean;
......
import { Component, Input, OnInit } from "@angular/core";
import { ActivatedRoute, Router } from "@angular/router";
import { Store } from "@ngrx/store";
import { Store, select } from "@ngrx/store";
import * as fromRoot from "../../app.reducers";
import { NgPassitSDK } from "../../ngsdk/sdk";
......@@ -31,19 +31,21 @@ export class ConfirmEmailContainer implements OnInit {
/**
* The error message, passed to the template
*/
errorMessage$ = this.store.select(fromAccount.getConfirmErrorMessage);
errorMessage$ = this.store.pipe(select(fromAccount.getConfirmErrorMessage));
confirmCodeMessage$ = this.store.select(fromAccount.getConfirmEmailMessage);
confirmCodeMessage$ = this.store.pipe(
select(fromAccount.getConfirmEmailMessage)
);
/**
* Lets the template know if a server call has started
// */
hasStarted$ = this.store.select(fromAccount.getConfirmHasStarted);
hasStarted$ = this.store.pipe(select(fromAccount.getConfirmHasStarted));
/**
* Lets the template know if a server call has finished (successfully)
*/
hasFinished$ = this.store.select(fromAccount.getConfirmHasFinished);
hasFinished$ = this.store.pipe(select(fromAccount.getConfirmHasFinished));
/**
* The confirmation code
......@@ -61,7 +63,8 @@ export class ConfirmEmailContainer implements OnInit {
* Confirm email will temporarily appear in two different ways which requires
* logic to distinguish
*/
@Input() inline: boolean;
@Input()
inline: boolean;
/**
* On init, look for the code param in the URL. If it's there, submit it.
......
......@@ -9,7 +9,7 @@ import {
} from "rxjs/operators";
import { HttpErrorResponse } from "@angular/common/http";
import { Router } from "@angular/router";
import { Store } from "@ngrx/store";
import { Store, select } from "@ngrx/store";
import { UserService } from "../user";
import * as fromRoot from "../../app.reducers";
......@@ -68,7 +68,7 @@ export class ConfirmEmailEffects {
@Effect({ dispatch: false })
VerifyEmailSuccess$ = this.actions$.pipe(
ofType<VerifyEmailSuccess>(ConfirmEmailTypes.VERIFY_EMAIL_SUCCESS),
withLatestFrom(this.store.select(getRouterPath)),
withLatestFrom(this.store.pipe(select(getRouterPath))),
map(([action, path]) => path),
tap(path => {
// The confirm email page automatically redirects while register does not
......
import { map, take } from "rxjs/operators";
import { Injectable } from "@angular/core";
import { CanActivate } from "@angular/router";
import { Store } from "@ngrx/store";
import { Store, select } from "@ngrx/store";
import * as fromAccount from "../account.reducer";
......@@ -13,7 +13,7 @@ export class ConfirmEmailGuard implements CanActivate {
* Note this method only checks if they just confirmed, it doesn't check against the server.
*/
public canActivate() {
return this.store.select(fromAccount.getConfirmIsVerified).pipe(
return this.store.pipe(select(fromAccount.getConfirmIsVerified)).pipe(
map(isVerified => !isVerified),
take(1)
);
......
......@@ -3,7 +3,7 @@ import { UserService } from "../user/user.service";
import * as fromRoot from "../../app.reducers";
import * as fromAccount from "../account.reducer";
import { ResetDeleteStateAction } from "../delete/delete.actions";
import { Store } from "@ngrx/store";
import { Store, select } from "@ngrx/store";
@Component({
selector: "app-delete-container",
......@@ -16,11 +16,12 @@ import { Store } from "@ngrx/store";
`
})
export class DeleteContainer implements OnInit {
form$ = this.store.select(fromAccount.getDeleteAccountForm);
formErrors$ = this.store.select(fromAccount.getDeleteFormErrors);
form$ = this.store.pipe(select(fromAccount.getDeleteAccountForm));
formErrors$ = this.store.pipe(select(fromAccount.getDeleteFormErrors));
constructor(
private userService: UserService,
private store: Store<fromRoot.IState>) {}
private store: Store<fromRoot.IState>
) {}
ngOnInit() {
this.store.dispatch(new ResetDeleteStateAction());
......@@ -29,5 +30,4 @@ export class DeleteContainer implements OnInit {
doAccountDelete(password: string) {
this.userService.deleteUserAccount(password);
}
}
import { ChangeDetectionStrategy, Component, OnInit } from "@angular/core";
import * as fromAccount from "../account.reducer";
import * as fromErrorReporting from "./error-reporting.reducer";
import { Store } from "@ngrx/store";
import { Store, select } from "@ngrx/store";
import { SaveForm } from "./error-reporting.actions";
import { SetValueAction } from "ngrx-forms";
......@@ -15,14 +15,18 @@ import { SetValueAction } from "ngrx-forms";
></app-error-reporting>`
})
export class ErrorReportingContainer implements OnInit {
form$ = this.store.select(fromAccount.getErrorReportingForm);
hasStarted$ = this.store.select(fromAccount.getErrorReportingHasStarted);
hasFinished$ = this.store.select(fromAccount.getErrorReportingHasFinished);
form$ = this.store.pipe(select(fromAccount.getErrorReportingForm));
hasStarted$ = this.store.pipe(
select(fromAccount.getErrorReportingHasStarted)
);
hasFinished$ = this.store.pipe(
select(fromAccount.getErrorReportingHasFinished)
);
optInErrorReporting: boolean;
constructor(private store: Store<any>) {
this.store
.select(fromAccount.getOptInErrorReporting)
.pipe(select(fromAccount.getOptInErrorReporting))
.subscribe(optIn => (this.optInErrorReporting = optIn));
}
......
......@@ -15,7 +15,7 @@ import {
switchMap
} from "rxjs/operators";
import * as fromRoot from "../../app.reducers";
import { Store } from "@ngrx/store";
import { Store, select } from "@ngrx/store";
import {
getErrorReportingForm,
getErrorReportingHasFinished
......@@ -28,7 +28,7 @@ export class ErrorReportingEffects {
@Effect()
save$ = this.actions$.pipe(
ofType<SaveForm>(ErrorReportingTypes.SAVE_FORM),
withLatestFrom(this.store.select(getErrorReportingForm)),
withLatestFrom(this.store.pipe(select(getErrorReportingForm))),
map(([action, form]) => form),
exhaustMap(form =>
this.userService
......@@ -40,7 +40,7 @@ export class ErrorReportingEffects {
/** Clear the finished indicator after a little bit */
@Effect()
fadeFinished$ = this.store.select(getErrorReportingHasFinished).pipe(
fadeFinished$ = this.store.pipe(select(getErrorReportingHasFinished)).pipe(
filter(hasFinished => hasFinished === true),
switchMap(() => timer(2000).pipe(map(() => new ClearFinished())))
);
......
import { Component } from "@angular/core";
import { Router } from "@angular/router";
import { Store } from "@ngrx/store";
import { Store, select } from "@ngrx/store";
import * as fromRoot from "../../app.reducers";
import * as Account from "../account.actions";
......@@ -20,15 +20,15 @@ import * as fromAccount from "../account.reducer";
`
})
export class LoginContainer {
form$ = this.store.select(fromAccount.getLoginForm);
errorMessage$ = this.store.select(fromAccount.getLoginErrorMessage);
hasLoginStarted$ = this.store.select(fromAccount.getLoginHasStarted);
hasLoginFinished$ = this.store.select(fromAccount.getLoginHasFinished);
form$ = this.store.pipe(select(fromAccount.getLoginForm));
errorMessage$ = this.store.pipe(select(fromAccount.getLoginErrorMessage));
hasLoginStarted$ = this.store.pipe(select(fromAccount.getLoginHasStarted));
hasLoginFinished$ = this.store.pipe(select(fromAccount.getLoginHasFinished));
isPopup = false;
constructor(private router: Router, private store: Store<fromRoot.IState>) {
store
.select(fromRoot.getIsPopup)
.pipe(select(fromRoot.getIsPopup))
.subscribe(isPopup => (this.isPopup = isPopup));
}
......
import { Injectable } from "@angular/core";
import { Effect } from "@ngrx/effects";
import { Store } from "@ngrx/store";
import { Store, select } from "@ngrx/store";
import { IState } from "../../app.reducers";
import * as fromAccount from "../account.reducer";
import {
......@@ -23,7 +23,7 @@ import { concat } from "rxjs";
export class LoginFormEffects {
/** Implements "as you type" check to determine if the server url is valid or not */
@Effect()
asyncServerUrlCheck$ = this.store.select(fromAccount.getLoginForm).pipe(
asyncServerUrlCheck$ = this.store.pipe(select(fromAccount.getLoginForm)).pipe(
filter(form => form.value.showUrl),
distinctUntilChanged(
(first, second) => first.value.url === second.value.url
......
import { Component, OnDestroy, OnInit } from "@angular/core";
import { Store } from "@ngrx/store";
import { Store, select } from "@ngrx/store";
import * as fromRoot from "../../app.reducers";
import * as Account from "../account.actions";
......@@ -43,17 +43,19 @@ import { Router } from "@angular/router";
`
})
export class RegisterContainer implements OnDestroy, OnInit {
form$ = this.store.select(fromAccount.getRegisterForm);
urlForm$ = this.store.select(fromAccount.getUrlForm);
errorMessage$ = this.store.select(fromAccount.getRegisterErrorMessage);
hasSubmitStarted$ = this.store.select(fromAccount.getHasSubmitStarted);
hasSubmitFinished$ = this.store.select(fromAccount.getHasSubmitFinished);
stageValue$ = this.store.select(fromAccount.getStage);
isEmailTaken$ = this.store.select(fromAccount.getRegisterIsEmailTaken);
isUrlValid$ = this.store.select(fromAccount.getisUrlValid);
urlDisplayName$ = this.store.select(fromAccount.getUrlDisplayName);
showUrl$ = this.store.select(fromAccount.getShowUrl);
backupCode$ = this.store.select(fromAccount.getRegisterBackupCode);
form$ = this.store.pipe(select(fromAccount.getRegisterForm));
urlForm$ = this.store.pipe(select(fromAccount.getUrlForm));
errorMessage$ = this.store.pipe(select(fromAccount.getRegisterErrorMessage));
hasSubmitStarted$ = this.store.pipe(select(fromAccount.getHasSubmitStarted));
hasSubmitFinished$ = this.store.pipe(
select(fromAccount.getHasSubmitFinished)
);
stageValue$ = this.store.pipe(select(fromAccount.getStage));
isEmailTaken$ = this.store.pipe(select(fromAccount.getRegisterIsEmailTaken));
isUrlValid$ = this.store.pipe(select(fromAccount.getisUrlValid));
urlDisplayName$ = this.store.pipe(select(fromAccount.getUrlDisplayName));
showUrl$ = this.store.pipe(select(fromAccount.getShowUrl));
backupCode$ = this.store.pipe(select(fromAccount.getRegisterBackupCode));
isExtension = IS_EXTENSION;
showConfirm = true;
......
......@@ -12,7 +12,7 @@ import "rxjs/add/operator/map";
import "rxjs/add/operator/filter";
import { Injectable } from "@angular/core";
import { Actions, Effect } from "@ngrx/effects";
import { Actions, Effect, ofType } from "@ngrx/effects";
import * as fromAccount from "../account.reducer";
import { HandleAPIErrorAction } from "../account.actions";
......@@ -34,7 +34,7 @@ import {
import { UserService } from "../user";
import { MoonMail } from "../moonmail/moonmail.service";
import { Store } from "@ngrx/store";
import { Store, select } from "@ngrx/store";
import { IState } from "../../app.reducers";
import { IPassitSDKError } from "../../ngsdk";
import { of } from "rxjs";
......@@ -42,83 +42,79 @@ import { of } from "rxjs";
@Injectable()
export class RegisterEffects {
@Effect()
checkEmail$ = this.actions$
.ofType<CheckEmailAction>(RegisterActionTypes.CHECK_EMAIL)
.pipe(
withLatestFrom(this.store.select(fromAccount.getRegisterForm)),
map(([action, form]) => form),
exhaustMap(form => {
return this.userService
.checkUsername(form.value.email)
.then(resp => {
if (resp.isAvailable) {
return new CheckEmailSuccess();
} else {
return new SetIsEmailTaken(true);
}
})
.catch((err: IPassitSDKError) => {
if (err.res.status === 404) {
return new CheckEmailFailure("Enter a valid email address.");
} else if (err.res.status === 500) {
return new CheckEmailFailure("Server Error");
} else if (err.res.status === 0) {
return new CheckEmailFailure("Unable to connect to server.");
}
return new HandleAPIErrorAction(err);
});
})
);
checkEmail$ = this.actions$.pipe(
ofType<CheckEmailAction>(RegisterActionTypes.CHECK_EMAIL),
withLatestFrom(this.store.pipe(select(fromAccount.getRegisterForm))),
map(([action, form]) => form),
exhaustMap(form => {
return this.userService
.checkUsername(form.value.email)
.then(resp => {
if (resp.isAvailable) {
return new CheckEmailSuccess();
} else {
return new SetIsEmailTaken(true);
}
})
.catch((err: IPassitSDKError) => {
if (err.res.status === 404) {
return new CheckEmailFailure("Enter a valid email address.");
} else if (err.res.status === 500) {
return new CheckEmailFailure("Server Error");
} else if (err.res.status === 0) {
return new CheckEmailFailure("Unable to connect to server.");
}
return new HandleAPIErrorAction(err);
});
})
);
@Effect()
checkUrl$ = this.actions$
.ofType<CheckUrlAction>(RegisterActionTypes.CHECK_URL)
.pipe(
withLatestFrom(this.store.select(fromAccount.getUrlForm)),
map(([action, form]) => form),
exhaustMap(form => {
return this.userService.checkAndSetUrl(form.value.url).pipe(
map(() => new CheckUrlSuccessAction()),
catchError(() => of(new CheckUrlFailureAction()))
);
})
);
checkUrl$ = this.actions$.pipe(
ofType<CheckUrlAction>(RegisterActionTypes.CHECK_URL),
withLatestFrom(this.store.pipe(select(fromAccount.getUrlForm))),
map(([action, form]) => form),
exhaustMap(form => {
return this.userService.checkAndSetUrl(form.value.url).pipe(
map(() => new CheckUrlSuccessAction()),
catchError(() => of(new CheckUrlFailureAction()))
);
})
);
@Effect({ dispatch: false })
newsletterSubscribe$ = this.actions$
.ofType<NewsletterSubscribeAction>(RegisterActionTypes.NEWSLETTER_SUBSCRIBE)
.pipe(
withLatestFrom(this.store.select(fromAccount.getRegisterForm)),
map(([action, form]) => form),
filter(form => form.value.signUpNewsletter),
map(form => form.value.email),
tap(email => this.moonmailService.subscribeEmail(email))
);
newsletterSubscribe$ = this.actions$.pipe(
ofType<NewsletterSubscribeAction>(RegisterActionTypes.NEWSLETTER_SUBSCRIBE),
withLatestFrom(this.store.pipe(select(fromAccount.getRegisterForm))),
map(([action, form]) => form),
filter(form => form.value.signUpNewsletter),
map(form => form.value.email),
tap(email => this.moonmailService.subscribeEmail(email))
);
@Effect()
register$ = this.actions$
.ofType<RegisterAction>(RegisterActionTypes.REGISTER)
.pipe(
withLatestFrom(this.store.select(fromAccount.getRegisterForm)),
map(([action, form]) => form.value),
exhaustMap(auth => {
return this.userService
.register(
auth.email,
auth.password,
auth.rememberMe ? auth.rememberMe : false
)
.then(resp => new RegisterSuccessAction(resp))
.catch((err: IPassitSDKError) => {
if (err.res.status === 500) {
return new RegisterFailureAction("Server Error");
} else if (err.res.status === 0) {
return new RegisterFailureAction("Unable to connect to server");
}
return new RegisterFailureAction("Unknown Error");
});
})
);
register$ = this.actions$.pipe(
ofType<RegisterAction>(RegisterActionTypes.REGISTER),
withLatestFrom(this.store.pipe(select(fromAccount.getRegisterForm))),
map(([action, form]) => form.value),
exhaustMap(auth => {
return this.userService
.register(
auth.email,
auth.password,
auth.rememberMe ? auth.rememberMe : false
)
.then(resp => new RegisterSuccessAction(resp))
.catch((err: IPassitSDKError) => {
if (err.res.status === 500) {
return new RegisterFailureAction("Server Error");
} else if (err.res.status === 0) {
return new RegisterFailureAction("Unable to connect to server");
}
return new RegisterFailureAction("Unknown Error");
});
})
);
constructor(
private actions$: Actions,
......
import { Component, ChangeDetectionStrategy, OnInit } from "@angular/core";
import * as fromAccount from "../../account.reducer";
import { Store } from "@ngrx/store";
import { Store, select } from "@ngrx/store";
import {
Init,
VerifyAndLogin,
......@@ -21,10 +21,12 @@ import { BACKUP_CODE_CHARS, BACKUP_CODE_LENGTH } from "../constants";
changeDetection: ChangeDetectionStrategy.OnPush
})
export class ResetPasswordVerifyContainer implements OnInit {
form$ = this.store.select(fromAccount.getResetPasswordVerifyForm);
hasStarted$ = this.store.select(fromAccount.getResetPasswordVerifyHasStarted);
errorMessage$ = this.store.select(
fromAccount.getResetPasswordVerifyErrorMessage
form$ = this.store.pipe(select(fromAccount.getResetPasswordVerifyForm));
hasStarted$ = this.store.pipe(
select(fromAccount.getResetPasswordVerifyHasStarted)
);
errorMessage$ = this.store.pipe(
select(fromAccount.getResetPasswordVerifyErrorMessage)
);
constructor(
......
import { Injectable } from "@angular/core";
import { Effect, Actions } from "@ngrx/effects";
import { Effect, Actions, ofType } from "@ngrx/effects";
import { withLatestFrom, map, mergeMap, tap, catchError } from "rxjs/operators";
import { Store } from "@ngrx/store";
import { Store, select } from "@ngrx/store";
import { IState } from "../../../app.reducers";
import { getResetPasswordVerifyEmailAndCode } from "../../account.reducer";
import { UserService } from "../../user";
......@@ -18,46 +18,44 @@ import { Router } from "@angular/router";
@Injectable()
export class ResetPasswordVerifyEffects {
@Effect()
verifyAndLogin$ = this.actions$
.ofType<VerifyAndLogin>(ResetPasswordVerifyActionTypes.VERIFY_AND_LOGIN)
.pipe(
withLatestFrom(this.store.select(getResetPasswordVerifyEmailAndCode)),
map(([action, emailAndCode]) => [