4
votes
1answer
56 views

Is this a good algorithm to unflat js objects?

I am dealing with a scenario where I get data in the following form: ...
1
vote
2answers
54 views

Looking for matching names among two text files

I'm trying to enhance the execution speed of my below code. I am using only vanilla JavaScript. I would be willing to bring in additional libraries and plugins as long as they will enhance the overall ...
8
votes
1answer
90 views

Reduce duplicate sequences

I am writing a copy paste detector using esprima.js and Hmm. This particular function checks a number of sequences and reduces them. Due to the parsing I might have 2 sequences with the same piece of ...
2
votes
1answer
49 views

Is this `img` creator decently secure from XSS?

This is being used now, seems decent to me but I'm curious. ...
0
votes
1answer
60 views

Getting data from the server via JSON callback and parsing the data to HTML

I'm pretty new to web development with JS and was wondering if anyone can tell me how I can improve my code. I just feel like when it comes to maintainability my code would be very difficult to ...
2
votes
1answer
33 views

Parsing playlists efficiently

I have this regexp working, simple, but I feel like it may not be the best way to code it. Basically, I have a playlist separated by line breaks returned as tcp data like so: ...
5
votes
3answers
196 views

Converting KML/XML to Javascript

So, I have the boundaries of every states in the US, from the google map KML file. This KML file is actually a XML file. I'm converting this file to a JS file compatible with google map in order to ...
6
votes
2answers
77 views

Performance tuning on a text file to object conversion

I'm using an API which returns text in the following format: ...
1
vote
2answers
102 views

How to handle JSON's undefined value in a better way?

I'm working on Google Book API to post a book's basic information. I notice that some of the books will always miss a value or two under volumeInfo, like this book ...
1
vote
2answers
164 views

node.js library for extracting words from a text

I'm looking for feedback on my library for extracting words from a text: https://npmjs.org/package/uwords The extracted word is defined as sequence of Unicode characters from Lu, Ll, Lt, Lm, Lo ...
6
votes
1answer
129 views

Parsing function is 50 lines long

This is a parsing function that will at tildes (~) to end of search terms in certain circumstances. Example an inputs and outputs: Input: Output: name:(john doe) ...
6
votes
3answers
361 views

Coderbyte SimpleSymbols challenge in Javascript

I am working on a CoderByte problem in JavaScript. I have solved the problem below. Although I am trying to figure out if there is an easier way to do it? I am guessing RegEx will come up, although I ...
0
votes
2answers
64 views

How to optimize Cookie Parsing?

I have written this code for cookie parsing. Can anyone tell me what optimizations we can do in this or what can we do to make it more concise? ...
4
votes
1answer
420 views

PEG.js grammar for parsing CSS selectors

I have a library that's parsing some expressions, part of which is a CSS selector. More accurately, it's a jQuery-compatible selector. The selector itself is opaque to my library - I don't need to ...
2
votes
1answer
93 views

Function to parse floats optionally followed by %, more strict than parseFloat in javascript

I'm not a Javascript expert, so please review this function for me. Also, it could be that there is something in any of the library we're using in our project that can do something similar for me ...
0
votes
1answer
148 views

Javascript parsing performance

I am using some string which contains an html. As follows ...
-1
votes
1answer
286 views

Parsing large text area - difficulty extracting info - Javascript [closed]

I am writing a program that will deal with formatting the text in a text area. The user will use Ctrl + A, Ctrl + C to copy the entirety of a web page, then paste that text into a text area. The ...
3
votes
1answer
113 views

JavaScript templating language: ivy-markup

This library is a markup parser which is intended to be used in node.js and browser environment. I've decided to use Jasmine for tests. The library's name is ivy-markup. URL: ...
4
votes
1answer
106 views

Is my PHP script/embed remover robust?

The goal of this question: Your goal here is to find a security hole in my code which allows a user to create input that contains a script doing anything they want, without that script being stopped ...
3
votes
1answer
317 views

JQuery Promise Interface for a (very) simple JSON Parser

I have written a parser function that returns a JQuery Promise. You can see from the code that this is the top level parser and it delegates out to two other more specific parsers. At the minute it ...
2
votes
1answer
154 views

Javascript XML Parser wrapper

I created an XML wrapper to easily access XML data. Please tell me what do you think about it. Performance Scalability Anything else... This is how you use it: ...
3
votes
1answer
336 views

DnD dice roll parser

Some time ago I've written a small parser (about 250 LoC) which is capable of executing the four arithmetic operators +-*/ as well as a dice-roll operator, ...
2
votes
1answer
1k views

Code to Parse dollars and cents?

I've written code to parse dollars and cents entered by the user. The value returned is the total number of cents. For example: ...
4
votes
2answers
4k views

Parsing JSON with JavaScript

I need to write some JavaScript code that will take a JSON string, parse it, and return the names of the most-deeply nested properties. For example, for this input: ...
5
votes
3answers
344 views

Is this query-string parser bug-free?

I tried to implement a definitive, reliable URL query string parser that handles every corner case: it tries to be efficient by avoiding regex it takes full URLs or just query strings (as long as ...
5
votes
3answers
436 views

Javascript Object Placement / String Parsing Method

This JS function is intended to retrieve or place a value into an object with the nested keys as a string. For example ...