foxkit-js / foxkit-util-legacy

Core package for the foxkit utility module collection
https://www.npmjs.com/package/foxkit
MIT License
0 stars 1 forks source link

dedent crash with \r #4

Open Mitsunee opened 2 years ago

Mitsunee commented 2 years ago
import { dedent } from "foxkit/dedent";
const dd = dedent();

dd("Lorem\rIpsum");

causes `TypeError: Cannot read properties of null (reading '1');

Mitsunee commented 2 years ago

Presumably this function is not able to match rows with \r and thus crashes

https://github.com/foxkit-js/foxkit/blob/2e544a4aff78c0f4c876dfaee242bfaef3e07d27/src/dedent/index.js#L11-L21