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
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
fcastillo
@fcastillo_twitter
Hi everybody, just wanted to ask if anybody has a workaround for lodash/lodash#4842 On templates, is there a way to prevent creating new lines from evaluating only tags? Similar to how ejs has -%>
enricofadly
@enricofadly
guys anyone had idea why search bar in lodash docs site is slow at chrome?
Jeffrey Spies
@JeffSpies

Hi, all; big fan of lodash. I'm working on a programmer interface and would like users to be able to use lodash chains. What I need is the following:

chain().flatten().value()

that would be equivalent to

(i) => _.chain(i)._flatten()._value()

I can accomplish this by creating a class, dynamically adding methods that collect the chained function names and args, and then returning the chained result when value() is invoked, but I suspect there's a more functional/lodash way of doing this. Thoughts? Thanks in advance!

ZeonWang
@scplay
hi everyone, I just pull source code in my local machine, I want run lodash/test, but the code was use es6 module that node cannot recognize, How can I run test correctly? Thx
aditya
@adibro500
i have an array: ''' arr=[ {"key": "a_bcv", "value": "ji"}, {"key": "am_hjk", "value": "hello"}, {"key": "k_bcv", "value": "hi"} ] '''
i have an array: arr=[ {"key": "a_bcv", "value": "ji"}, {"key": "am_hjk", "value": "hello"}, {"key": "k_bcv", "value": "hi"} ]
i want output: arr = [{"key": ["a_bcv", "k_bcv"], value: ["ji", "hi"]}, {"key": "am_hjk", "value": "hello"}]
the string following the first underscore must match
Marin Kapranov
@Biseamon
How can I join 2 arrays of objects to form parent child relationship
[
{
"id": "1f3d0b56-01bd-4a7e-b019-56676682b48a",
"total_price": 8
},
{
"id": "200a2543-a035-4048-b0c9-bba78ee668a3",
"total_price": 8
}
]

And below is the child array:

[
{
"id":"product 1",
"order_id":"1f3d0b56-01bd-4a7e-b019-56676682b48a",
"price":1,
"quantity":4
},
{
"id":"product 2",
"order_id":"1f3d0b56-01bd-4a7e-b019-56676682b48a",
"price":1,
"quantity":4
},
{
"id":"product 3",
"order_id":"200a2543-a035-4048-b0c9-bba78ee668a3",
"price":1,
"quantity":4
}
]

I want to combine to become like this:

[
{
"id":"1f3d0b56-01bd-4a7e-b019-56676682b48a",
"total_price":8,
"products":[
{
"id":"product 1",
"order_id":"1f3d0b56-01bd-4a7e-b019-56676682b48a",
"price":1,
"quantity":4
},
{
"id":"product 2",
"order_id":"1f3d0b56-01bd-4a7e-b019-56676682b48a",
"price":1,
"quantity":4
}
]
},
{
"id":"200a2543-a035-4048-b0c9-bba78ee668a3",
"total_price":8,
"products":[
{
"id":"product 3",
"order_id":"200a2543-a035-4048-b0c9-bba78ee668a3",
"price":1,
"quantity":4
}
]
}
]

Mikael Larsson
@indiehjaerta
Anyone have a good solution how I could merge the category array into the categoryGroups array where ids are equal.
let categoryGroups = [
    {
        id: '5f6dae6698bf749541d07ae0',
        name: 'Group 1',
        categories: [
            { id: '5f6daf2698bf749541d07ae4', name: 'Category 1' },
            { id: '5f6daf3398bf749541d07ae6', name: 'Category 2' },
        ],
    },
    {
        id: '5f6daed098bf749541d07ae1',
        name: 'Group 2',
        categories: [{ id: '5f6daf2c98bf749541d07ae5', name: 'Category3' }],
    },
];

let categories = [
    {
        category: { id: '5f6daf2698bf749541d07ae4' },
        amount: 400,
    },
];
aditya
@adibro500
how can i achieve SQL query: SELECT A,B from TABLE WHERE A in (1,2,3) and B in (4,5,6);