diia-open-source / be-pkg-utils

European Union Public License 1.2
14 stars 10 forks source link

use Array.isArray, isObject from lodash, Buffer.isBuffer #1

Open yrambler2001 opened 4 months ago

yrambler2001 commented 4 months ago

Array.isArray exists more than 10 years. Screenshot 2024-03-13 at 21 12 49 There is no need to use value && typeof value === 'object' && value.constructor === Array

yrambler2001 commented 4 months ago

it is common in diia repositories to use isObject from lodash https://github.com/diia-open-source/be-diia-logger/blob/c26c7ce94c594a009c6bd99ec660304f996d248e/src/index.ts#L4 https://github.com/diia-open-source/be-diia-logger/blob/c26c7ce94c594a009c6bd99ec660304f996d248e/src/index.ts#L42 Screenshot 2024-03-13 at 21 34 59 Array.isArray https://github.com/diia-open-source/be-diia-logger/blob/c26c7ce94c594a009c6bd99ec660304f996d248e/src/trimmer.ts#L32 Screenshot 2024-03-13 at 21 36 21 and Buffer.isBuffer https://github.com/diia-open-source/be-diia-logger/blob/c26c7ce94c594a009c6bd99ec660304f996d248e/src/trimmer.ts#L28 Screenshot 2024-03-13 at 21 35 48

tshemsedinov commented 4 months ago

Please add permalinks to code like in this issue: https://github.com/diia-open-source/be-user-service/issues/92 or at least urls to certain files