LinusU / LinusU/node-append-field

Reconsider using objects with prototype

Open
#1 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
7
Forks
3
PR merge metrics
No merged PRs in 30d

Description

Returning objects without prototype make the appended values useless in some contexts. For example, I had to create a function to convert all objects to Object instances because Google Analytics used `hasOwnProperty`. I think what's important in this library is that the enumerable properties of the returned objects are those in the "paths", so object instances are fine for that.

Is there a reason to create objects without prototype other than ease the JSON parsing and the property traversing?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry point. First locate where returned objects are created and how paths are traversed, then compare prototype-less and normal objects against the stated Google Analytics and hasOwnProperty use case. Done requires an agreed behavior and regression coverage for the returned objects' enumerable properties.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.