5 Matching Annotations
  1. Last 7 days
  2. Jul 2020
    1. JSON parsing is always pain in ass. If the input is not as expected it throws an error and crashes what you are doing. You can use the following tiny function to safely parse your input. It always turns an object even if the input is not valid or is already an object which is better for most cases.

      It would be nicer if the parse method provided an option to do it safely and always fall back to returning an object instead of raising exception if it couldn't parse the input.

    1. I agree in general splitting an array, according to some property using the order of the elements (no take_drop_while) or to some other array (this request) is more difficult than it could be.