Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Object methods #3

Open
rodgeraraujo opened this issue Oct 19, 2022 · 2 comments
Open

Add Object methods #3

rodgeraraujo opened this issue Oct 19, 2022 · 2 comments

Comments

@rodgeraraujo
Copy link
Owner

Add methods to use with Object.

@lavanyajain
Copy link

@rodgeraraujo Can I work on this? If you agree please update more information of what is expected

@rodgeraraujo
Copy link
Owner Author

rodgeraraujo commented Oct 20, 2022

Yeah @lavanyajain, you can, I will assign you. The purpose of the library is to create a collection of methods that help in other projects.

For adding new functions related to Object, here are some suggestions:

  • .assign(object, [sources]): Assigns own enumerable string keyed properties of source objects to the destination (can be a single source, or many if possivle) object.

    • Arguments:
      • object (Object): The destination object;
      • [sources] (Vector): The source objects.
    • Returns: (Object) Returns a new object assigned with sources.
  • .has(object, path): Checks if path is a direct property of the object.

    • Arguments:
      • object (Object): The object to query.
      • path (Vector|String): The path to check.
    • Returns: (boolean) Returns true if path exists, else false.
  • .keys(object): Creates an Vector of the own enumerable property names of object.

    • Arguments:
      • object (Object): The object to query.
    • Returns: (Vector) Returns the vector of property keys.
  • .values(object): Creates an Vector of the own enumerable string keyed property values of object.

    • Arguments
      • object (Object): The object to query.
    • Returns: (Vector) Returns the vector of property values.

@lavanyajain lavanyajain removed their assignment Nov 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants