Code Monkey home page Code Monkey logo

Comments (5)

imsamdez avatar imsamdez commented on June 16, 2024

I think it come from the first If statement in the module:
if (!isObject(obj)) return {};

The RowDataPacket Object seems to not be an object but I don't see how I could make this If statement being true.

from object.omit.

imsamdez avatar imsamdez commented on June 16, 2024

I have found a fix but don't think if it's smart, can you provide a feedback about this ? I added those 3 lines

module.exports = function omit(obj, props, fn) {
  var copy = {};                           // Added line #1
  ObjectCopy(copy, obj)                    // Added line #2
  obj = copy;                              // Added line #3
  if (!isObject(obj)) return {};

And now the isObject(obj) return true !

P.S: Yes I have used your object-copy module ;-)

from object.omit.

jonschlinkert avatar jonschlinkert commented on June 16, 2024

Sorry for the late reply, and thanks for the detail. I'll try to take a look today.

Yes I have used your object-copy module ;-)

lol very cool, thank you!

from object.omit.

jonschlinkert avatar jonschlinkert commented on June 16, 2024

@sdubrez can you add a complete code snippet that demonstrates the bug so I can easily reproduce? thanks!

from object.omit.

wookieb avatar wookieb commented on June 16, 2024

I believe we should not use is-extendable library in order to check whether a value is an object as it's simply confusing and not valid. is-extendable checks whether object is plain, function or array so the whole library won't work on any objects coming from custom class.

from object.omit.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.