unic / estatico

[DEPRECATED] Estático – Static site generator for frontend unicorns
Other
121 stars 18 forks source link

gulp/lodash swallow properties named "should" #24

Closed deniaz closed 7 years ago

deniaz commented 8 years ago

Gulp Task

'use strict';

const gulp = require('gulp'),
  _ = require('lodash');

const taskName = 'react';

gulp.task(taskName, () => {
  const obj = {};

  const wtf = {
    "inside": {
      "can": ['can', 'can'],
      "should": ['should', 'should']
    }
  };

  console.info(`===== ${_.VERSION} =====`);
  console.log(_.merge(obj, wtf));
});

module.exports = {
  taskName,
};

Expected Output

===== 4.16.4 =====
{ inside: { can: [ 'can', 'can' ], should: [ 'should', 'should' ] } }

Actual Output

===== 4.16.4 =====
{ inside: { can: [ 'can', 'can' ] } }

If you run the same code in the browser / in a clean JS file with node, it'll work as expected. Also, this only happens with should as far as I can tell. I'm not even sure where the bug lies.

If I can ever figure it out I'll open a Pull Request.

tschuems commented 8 years ago

i just tried to reproduce this.

it works fine on my client.

Output

===== 4.16.4 =====
{ inside: { can: [ 'can', 'can' ], should: [ 'should', 'should' ] } }

anyone else can reproduce this failure?

backflip commented 7 years ago

I cannot reproduce it either. Which Node version are you running it on, @deniaz?

orioltf commented 7 years ago

I've run your example script withseveral random lodash versions in our current .nvm environment without issues so far. So my question to @deniaz would be the same.

orioltf commented 7 years ago

Without further feedback I close this issue.