mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-17 22:29:52 +08:00
quotes:code_javascript: Add regex-heavy quote. (#2929) markstos
* quotes:code_javascript: Add regex-heavy quote. This quote contains a long regex that will be a workout for typing symbols and numbers. Source code can be confirmed to available under an open source license here: https://github.com/markstos/parse-coordinates/blob/master/index.js * fixed length Co-authored-by: Miodec <bartnikjack@gmail.com>
This commit is contained in:
parent
28f0a7a936
commit
96fea28d7b
1 changed files with 6 additions and 0 deletions
|
|
@ -264,6 +264,12 @@
|
|||
"source": "date-fns sourcecode",
|
||||
"length": 268,
|
||||
"id": 43
|
||||
},
|
||||
{
|
||||
"text": "function toLatLng (str) {\r\n\tvar match = /^\\s*?(-?[0-9]+\\.?[0-9]+?)\\s*,\\s*(-?[0-9]+\\.?[0-9]+?)\\s*$/.exec(str);\r\n\r\n\tif (match && match.length === 3) {\r\n\t\tvar lat = parseFloat(match[1]);\r\n\t\tvar lng = parseFloat(match[2]);\r\n\r\n\t\tif ((lat >= -90) && (lat <= 90) && (lng >= -180) && (lng <= 180)) {\r\n\t\t\treturn [lat, lng];\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n}",
|
||||
"source": "Mark Stosberg - parse-coordinates sourcecode",
|
||||
"length": 373,
|
||||
"id": 44
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue