Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Dec 29 2016 21:28
  • Dec 29 2016 21:28
  • Dec 29 2016 21:28
  • Dec 29 2016 21:28
  • Dec 29 2016 21:27
  • Dec 29 2016 21:27
  • Dec 29 2016 21:27
  • Dec 29 2016 21:27
  • Dec 29 2016 21:27
  • Dec 29 2016 21:27
  • Dec 29 2016 21:27
  • Dec 29 2016 21:27
  • Dec 29 2016 21:27
  • Dec 29 2016 21:27
  • Dec 29 2016 21:27
  • Dec 29 2016 21:27
  • Dec 29 2016 21:27
  • Dec 29 2016 21:27
  • Dec 29 2016 21:27
  • Dec 29 2016 21:27
illuminist
@illuminist
@XxSven_gitlab Those get evaluated to be the same, ultimately they become function () {}.call(this).
SOULE Théo
@XxSven_gitlab
@illuminist But when I write this in js fiddle I get syntax error if I don't surround it by parenthesis
illuminist
@illuminist
(function () {}) this one get boiled down into function object first before accessing .call, while (function () {}.call(this)) is an entire expression for function call
It isn't an usual syntax that you use in everyday job, but still good to know
SOULE Théo
@XxSven_gitlab
ok ty, it's weird ^^'
NursahKara
@NursahKara
hello, I am new in lodash so i don't know how to use with react native. I have a question. I have a project which is related to firebase. I want to see the information of which user logs in.With the map function, I can access all the data in the database but I only want to see the data of the logged-in user.should I use the find function to achieve this?Do you have a suggestion?
const mapStateToProps=state=>{
const currentUser=firebase.auth().currentUser;
const email=currentUser.email;
const profileInformationList=_.map(state.profileInformationList,(val,uid)=>{
return {...val,uid}
});
return {
profileInformationList
}
}
I want to use currentUser.email
illuminist
@illuminist
What is the shape of your state.profileInfomationList?
NursahKara
@NursahKara
it is an array
illuminist
@illuminist
What is the shape of object inside of the array?
NursahKara
@NursahKara
email name surname nick birthday
illuminist
@illuminist
So you want to find an object with email that match currentUser?
NursahKara
@NursahKara
yes
illuminist
@illuminist
Then it is better to use _.find to get one object from the array
NursahKara
@NursahKara
i think so too but i couldn't use it with react native
I can pull all the data with the map function, but it gets confused when I use the find function.
illuminist
@illuminist
It should not be difference from usual javascript regardless of what platform
NursahKara
@NursahKara
thanks your time @illuminist
WebAzOps
@WebAzOps
Selam kervan
thoo1
@thoo1
Does anyone know how _.isEqual treats date objects?
Does it compare using ===, or date1.getTime() === date2.getTime(), or some other way?
Reason I ask is because in my code, I am debugging, I am seeing that the two date objects I am comparing using _.isEqual is returning false even though the .getTime() for both dates are the same
Toom
@ProditorMagnus
Toom
@ProditorMagnus
staying with that then
Zach Reedy
@DatZach
Hello, I'm working on a port of Lodash for the latest version of GameMaker which now supports functions as a first class citizen and structs (which emulates JS Objects). I was wondering if someone know who I should contact to determine what is permissible as far as naming and licensing, as this is derived from the Lodash API. There's some features that've been omitted as they don't make sense in GML. Additionally, none of Lodash's codebase has been utilized, it's purely the API definitions.
chhikaradi1993
@chhikaradi1993
I have two sets, containing random number of objects, few of them may be same in both sets with updated properties. Is there any way to calculate diff of these sets containing objects?
illuminist
@illuminist

in both set with updated properties

What does that actually mean?

chhikaradi1993
@chhikaradi1993
I need to get diff of two Sets, which may contain objects as elements. Is it possible to get diff for these type of sets?
illuminist
@illuminist
For an object, it can be done by using .differerenceBy or .differenceWith depends on what you want to compare
David Siah
@dsiah
Hello (first timer here), I'm working on a super simple doc PR but I noticed that builds are somewhat broken. I believe i'm missing a step because there are no lib/ folders and the issue in build is searching for a module that would be located there:
> lodash@5.0.0 doc /Users/dsiah/OSS/lodash
> node lib/main/build-doc github && npm run test:doc

internal/modules/cjs/loader.js:979
  throw err;
  ^

Error: Cannot find module '/Users/dsiah/OSS/lodash/lib/main/build-doc'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:976:15)
    at Function.Module._load (internal/modules/cjs/loader.js:859:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
David Siah
@dsiah
and this is after running npm i (my version is 6.14.4)
Ahammad
@Ahammad-raj
Hello Everyone
lodash 4.17.15 is exposed to sonatype-2019-0467 vulnerability. Could you please check this and provide fix
Prachi Shirish Khadk
@prachi_khadke_twitter
Hi. If i groupBy an array of objects by integer, the integer property is returned as a string key in the result. Is it possible to preserve the key as integer?
var users = [
  { user: 'barney', age: 36, active: true },
  { user: 'fred',  age: 40, active: false },
  { user: 'travis', age: 37, active: true},
  { user: 'david',  age: 40, active: false },
  { user: 'tom', age: 37, active: true}
];

result = _.groupBy(users, 'age');
Prachi Shirish Khadk
@prachi_khadke_twitter
nm. i realized that it will lead to invalid json schema
SAGO
@SAGOlab

Hi there,

I have this two arrays:

var coordinateClienti = [
  [12.7592267, 43.0696255],
  [12.7037126, 42.9575853],
  [12.5263973, 43.105579],
  [12.7803655, 43.2322369],
  [12.4302894, 43.0265033],
  [12.1659394, 43.5551518],
  [12.5471666, 42.6143734],
  [12.7860033, 43.2321763],
  [12.3263852, 43.3081323],
  [12.7020796, 42.9564996],
  [12.191765, 43.5116042],
  [12.649205, 42.5624235]
]

var steps = [
  [12.402996209906489, 43.1070321],
  [12.7037126, 42.9575853],
  [12.7020796, 42.9564996],
  [12.649205, 42.5624235],
  [12.5471666, 42.6143734],
  [12.402996209906489, 43.1070321],
]

there is a lodash function that compare this two arrays and return me true if some array element of one are contained in the other?

thanks

SAGO
@SAGOlab
noone?
SAGO
@SAGOlab
there is a way to remove object from array that has specific value?
{type: "start", location: Array(2), load: Array(1), arrival: 1590066680, duration: 0, …}
1: {type: "job", location: Array(2), job: 10, service: 420, waiting_time: 0, …}
2: {type: "job", location: Array(2), job: 9, service: 420, waiting_time: 0, …}
3: {type: "job", location: Array(2), job: 7, service: 420, waiting_time: 0, …}
4: {type: "job", location: Array(2), job: 3, service: 420, waiting_time: 0, …}
5: {type: "end", location: Array(2), load: Array(1), arrival: 1590080738, duration: 12378, …}
6: {type: "start", location: Array(2), load: Array(1), arrival: 1590066680, duration: 0, …}
7: {type: "job", location: Array(2), job: 0, service: 420, waiting_time: 0, …}
8: {type: "job", location: Array(2), job: 5, service: 420, waiting_time: 0, …}
9: {type: "job", location: Array(2), job: 4, service: 420, waiting_time: 0, …}
10: {type: "job", location: Array(2), job: 2, service: 420, waiting_time: 0, …}
11: {type: "end", location: Array(2), load: Array(1), arrival: 1590076873, duration: 8513, …}
12: {type: "start", location: Array(2), load: Array(1), arrival: 1590066680, duration: 0, …}
13: {type: "job", location: Array(2), job: 1, service: 420, waiting_time: 0, …}
14: {type: "job", location: Array(2), job: 11, service: 420, waiting_time: 0, …}
15: {type: "job", location: Array(2), job: 8, service: 420, waiting_time: 0, …}
16: {type: "job", location: Array(2), job: 6, service: 420, waiting_time: 0, …}
17: {type: "end", location: Array(2), load: Array(1), arrival: 1590080203, duration: 11843, …}
I want to remove all object that have type:"start" and type:"end"
illuminist
@illuminist
const newArray = yourarray.filter(obj => !(obj.type === 'start' || obj.type === 'end'))
SAGO
@SAGOlab
@illuminist thanks a lot
illuminist
@illuminist
👍
ankit jain
@ankitmjain_twitter
Hi All
i am looking for the solution to fix the lodash vulranability
Patrik Jajcay
@iFarmGolems

Hey guys!

When using lodash/fp, why is this not equivalent?

_.flip(_.divide)(100)(500)
=> 0.2

_.partial(_.flip(_.divide), [100])(500)
=> 5
Patrik Jajcay
@iFarmGolems
Found the issue: lodash/lodash#2071
Cameron Moon
@cmrn
Hi folks! Just wanted to draw peoples attention to lodash/lodash#4759
This is the PR to fix the vulnerability previously reported by snyk and sonatype, and now also published by npm. Are there any maintainers here who could jump back into this PR?
1 reply
pinging some members of the lodash org (https://github.com/orgs/lodash/people) - @jdalton @jridgewell @veksen