feat: remove usage of .last

This commit is contained in:
Shivam Mishra
2026-04-23 14:44:52 +05:30
parent 190416d765
commit 83e96956fc
6 changed files with 2 additions and 26 deletions
@@ -1,18 +1,6 @@
/* eslint no-param-reassign: 0 */
import getUuid from 'widget/helpers/uuid';
import { MESSAGE_STATUS, MESSAGE_TYPE } from 'shared/constants/messages';
export default () => {
if (!Array.prototype.last) {
Object.assign(Array.prototype, {
last() {
return this[this.length - 1];
},
});
}
};
export const isEmptyObject = obj =>
Object.keys(obj).length === 0 && obj.constructor === Object;