ArgueJS
ArgueJS copied to clipboard
arguments order
From the example: __({start: [Number, 0], stop: Number, step: [Number, 1]})
In javascript, if I am not wrong, the objects haven't assured their properties order, so we may not have confidence that will be iterated in the order they are defined.
Then a setting like this __({ aString: String, aNumber: Number }) for a function called myFunction, could check as ok if we call the function with myFunction( 4444, 'aaaa' ) and the VM used invert the object properties order perhaps because decided use alphabetical order.
I found your library very usefull, and the notation too, but also need to note this potential problem.
__([{ aString: String }, { aNumber: Number ]) perhaps is better.
Hello and welcome! That bug is known and described in issue https://github.com/zvictor/ArgueJS/issues/13. There is a pull request (https://github.com/zvictor/ArgueJS/pull/15) and a fork (https://github.com/johmoh/ArgueJS) solving that problem. The pull request describes the new notation.
Ok, thanks for the reply!
When will this pull request be merged? (if it will?)
Sorry for the late response you get... The answer is: Maybe never... I don't know. There is not much (to be specific: there is no) activity in this repository. It seems to be dead.
If you can live with my fork then take my fork (https://github.com/johmoh/ArgueJS (argue2.js)). A "kind of" documentation of the interface can be found here: https://github.com/zvictor/ArgueJS/pull/15 And here you can find information about the different versions: https://github.com/zvictor/ArgueJS/pull/15#issuecomment-18320508 And here are examples: https://github.com/johmoh/ArgueJS/tree/master/examples
And of course: If there is any interest in my fork i will fix bugs if there are any (I do not expect some; the code is very well tested).
@johmoh I was going to use this library, but "http://ejohn.org/blog/javascript-in-chrome/" convinced me that this issue is real. Your fork, however, doesn't seem to be in npm and doesn't seem to have an issue tracker, so I don't trust pulling it in either.