Code Monkey home page Code Monkey logo

curly-bracket-parser's People

Contributors

magynhard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

curly-bracket-parser's Issues

Typescript support with .d.ts ?

Considering this package as a replacement of handlebars (cause it's heavy and dedicated on node envs requires fs.)
Yet I have concerns since my projects are ts based.

Option to ignore unresolved variables error.

Whenever I have a string with multiple variables and there is one variable that is unresolved I currently get this error:
"There are unresolved variables in the given string: {{variable}}"

I would like an option to ignore this error and return the string with all the variables that are resolved and the ones that are not resolved keep as is or return as empty string.

Enhancement : data depth compatibility

I think it would be nice to add the possibility to allow depth in the provided data object.

For exemple {{resume.title}}, {{figure.slider.description}} could be replace with the content of passedData['resume']['title'] and passedData['figure']['slider']['description'] respectively.

For myself, I'm trying to parse a document with an object containing data at varying depth of an object tree.

Currently I have to either flatten my data object, or split the parsing of my page into 6 different steps. And I actually have to add another step on top of it, reading the whole document, because I need one data element multiple times accross the whole document. I can't do at the moment simply due to how the data is arranged.

This is the current exemple

(excerpt of exemple data)
image
(excerpt of exemple javascript)
image
(excerpt of exemple html)
image

With this enhancement, I could parse the whole document at once, in one command, without modifying how my data is stored.

I think it would be very useful in and of itself but would also probably open possibilities for loop filters, and other neat things down the road.

No return on a variable that is undefined

Thanks for building this library.

Whenever I have a variable that is undefined the library does not return anything. My application basically just freezes because it is waiting for a return.

I think it would be better to change undefined variables to a empty string or to return an error that it is not allowed to have a undefined variable.

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.