Преглед изворни кода

Change number parsing in ExtractNumbers

Changed it to split on numbers and potentially negative symbols, instead
of splitting on everything that's not a number.
ApisNecros пре 1 година
родитељ
комит
257e632aea
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      common.ts

+ 1 - 1
common.ts

@@ -48,5 +48,5 @@ export function DeepClone(value: any): any {
  * @returns {number[]} An array of numbers
  */
 export function ExtractNumbers(str: string): number[] {
-	return str.split(/\D/).filter((n) => n.length).map((n) => Number(n));
+	return str.split(/[^\-0-9]/).filter((n) => n.length).map((n) => Number(n));
 }