C
Size: a a a
C
C
C
R
Вキ
AK
R
C
R
C
J💖
J💖
R
AT
AT
C
C
public getPreviousUrlIgnoreParams() {
const history = this.history.map(h => h.split('?').slice(-2, -1).join()).filter(h => !!h).filter((item, pos, self) => self.indexOf(item) == pos);
return history[history.length - 2] || '/index';
}
Router
нас ведь много он одинpublic getPreviousUrlIgnoreParams() {
const historyWithoutParams = this.history.map(h => h.split('?').slice(-2, -1).join()).filter(Boolean);
const historyWithoutDuplicates = historyWithoutParams.reduce((clearedHistory, elem, index, history) => {
if (index === 0 || history[index-1] !== elem) {
clearedHistory.push(elem);
}
return clearedHistory;
}, []);
return historyWithoutDuplicates[historyWithoutDuplicates.length - 2] || '/index';
}
AT