Coder Social home page Coder Social logo

object-bystring's People

Contributors

dependabot[bot] avatar tamb avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

object-bystring's Issues

Code readability

Write the code to be more legible.

I strongly suggest you work on your code's legibility. I assume you're a relatively junior developer.

Making code terse (almost "leetcode") might sound cool in principle, but it's incredibly hard to read. So, please name variables in a way that's clear what they are. Single-letter variables aren't helping with performance in any way and just make things harder.

s = s.toString().replace(/^./, ""); I get regex's are cool, but you could just do if (s[0] == '.') { s = s.slice(1); }. Much easier to read (many devs hate regexs) and possibly faster too

From reddit https://www.reddit.com/r/javascript/comments/d5zx65/wtf_wednesday_september_18_2019/f0sgsgc?utm_source=share&utm_medium=web2x

Attribution?

There's no attribution to the original source for the code.

Return value not as advertised

I tried the demo attached to your readme. This works as expected, where when I provide an accessor I get it's associated value. The project available on NPM however, does not work this way.

Consider the following object:

{
    person: {
        name: "Joe",
        age: 33,
    }
}

Expected result for accessor person.name is Joe as a string. Actual result was an object like { name: Joe }.

export non-prototype under `/util`

Create UMD to not clutter the Object.prototype. This should simply export a utility method.
UMD utility : object-bystring/util
Polyfill: object-bystring

Create UMD library with polyfill as optional

UMD should export polyfill in object and util by default.
THIS IS A BREAKING CHANGE.

end results should be

// default util
import byString from 'object-bystring';

// polyfill
import { byStringPolyfill } from 'object-bystring';

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.