string with ~ break Dry.parse
See original GitHub issueUse case that break parse:
console.log(Dry.parse('{"path": "~/projects"}'));
return {"path": undefined}
for internal ref usage, it should not be string that can easily by used by user. Maybe something like:
{"__dry__": "ref", "value": "projects"}
if the object have prop __dry__
it mean it internal object and not real object provided by user.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Clean fastest & efficient way to parse a string in c# - Stack ...
The code loops through each row parsing the items in the string. I made a simple class to hold the items; however the...
Read more >Parsing Strings with split - cs.wisc.edu
Strings in Java can be parsed using the split method of the String class. ( StringTokenizer can also be used to parse a...
Read more >optparse — Parser for command line options — Python 3.11.1 ...
When optparse sees the option string -f , it consumes the next argument, foo.txt , and stores it in options.filename . So, after...
Read more >Optimize parsing of strings : r/lua - Reddit
EDIT: Solved - thanks to everyone for the code and lessons. Hello, I am working on a simple module that outputs pango formatted...
Read more >Example of how to parse options with bash/getopt · GitHub
#!/bin/bash. #. # Example of how to parse short/long options with 'getopt'. #. OPTS=`getopt -o vhns: --long verbose,dry-run,help,stack-size: -n ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
+1 for using an object for references.
An earlier iteration of json-dry actually contained its own json.js based parser, but it was more trouble than it’s worth.
Also: the stringifying is an afterthought.
Dry.stringify
is actually just aJSON.stringify
wrapper aroundDry.toDryObject
.So json-dry actually first creates an intermediate object and then stringifies that using the built-in JSON parser. And yeah: this is much faster than using a custom stringifier/parser 😃
If you’re wondering why such an intermediate object would be useful: it’s for times when you can use a structured clone (like in IndexedDB or web workers), which is (again) a lot faster.
And backwards compatibility with json is important. If you would first use
JSON.parse
ton a json-dry string you would get a valid object. That valid object can then still be given toDry.parse