Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

Parse signature types

node v8.17.0
version: master
endpointsharetweet
function parseSignature (str) { const reg = /\(.+\)|( ?-> ?)/g; return JSON.parse(`["${str.replace(reg, (match, capture) => capture ? `", "` : match)}"]`); } parseSignature("Apple -> (Banana -> Grape) -> Cherry");
Loading…

no comments

    sign in to comment