crisp-im / node-crisp-api

:zap: Crisp API Node Wrapper
https://docs.crisp.chat/guides/rest-api/
MIT License
99 stars 38 forks source link

add findByData function for WebsitePeople #3

Closed loicbisiere closed 3 years ago

loicbisiere commented 6 years ago

Find one people profile by data

valeriansaliou commented 6 years ago

@mywaystar

baptistejamin commented 6 years ago

Thanks for commenting this!

We can't merge it as is this pull-request as it includes lodash.

ES5 natively includes .forEach on arrays: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach

loicbisiere commented 6 years ago

I don't use forEach on an array here, it's on an object. There is no ES5 native function for this particular case and it's need lots of extra code lines (test, loop etc ...) that are already managed by lodash. Je comprend que vous ne souhaitez pas dépendre de lodash, mais que pensez-vous d'utiliser uniquement le package pour la fonction forEach (https://www.npmjs.com/package/lodash.foreach). Est-ce que cela serait tolérable ?

baptistejamin commented 6 years ago

What you can do is to iterate using Object.keys so we don’t have to include lodash at all :)

Sent from my iPhone

On 22 Mar 2018, at 18:52, Loïc Bisière notifications@github.com wrote:

I don't use forEach on an array here, it's on an object. There is no ES5 native function for this particular case and it's need lots of extra code lines (test, loop etc ...) that are already managed by lodash. Je comprend que vous ne souhaitez pas dépendre de lodash, mais que pensez-vous d'utiliser uniquement le package pour la fonction forEach (https://www.npmjs.com/package/lodash.foreach). Est-ce que cela serait tolérable ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

loicbisiere commented 6 years ago

Ok I did it without lodash. Let me know if it's ok for you. Thanks.

valeriansaliou commented 3 years ago

Closing this as the programmatic API has been fully reworked as of v3.0.0.