Giter Site home page Giter Site logo

checked-constants's People

Contributors

brianfields avatar ephetic avatar

Watchers

 avatar  avatar

checked-constants's Issues

Research enumify etc for native solution

Frozen objects and getters that throw could do a lot of the same. Could be grepable with a definition syntax that enforced symmetry between definition and reference:

const cc = require('@ephetic/checked-constants')
cc.foo.bar.somekey = 111

where cleverness in cc allows the chain of previously undefined namespaces to be created. Would need a way to prevent grabbing object references at partial/parent paths of valid namespaces that are not themselves valid namespaces (e.g. cc.foo in previous). Would need way to keep cc extensible without namespaces being mutable, akin to #5.

Ponder constant definitions

If a namespace can be added to anywhere, some of the desired explicitness is lost. Perhaps there should be a restriction that each namespace can only be written to once, thus requiring all constants in that namespace to be in a single multiple definition.

Alternately, if the definition syntax is sufficiently grepable that dispersed definitions are as easily found as their references, then it isn't a problem.

Ponder how users publish registered constants

Given a module that uses this library, how would it announce to its users what constants are available? Traditionally this would be via documentation, but enums and constants objects would have tool support making this easier.

Implement isolated

e.g.

    const cc = require('checked-constants')
    const ns = cc.isolated()
    cc`foo/bar${'global'}`
    ns`foo/bar${'distinct'}`
    cc`foo/bar' //=> 'global'
    ns`foo/bar' //=> 'distinct'

Add yarn instructions

Will require packages.json changes and would be a good time for src/test refactoring.

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.