Skip to content

Commit

Permalink
fix: Handle line breaks
Browse files Browse the repository at this point in the history
  • Loading branch information
3y3 committed Feb 20, 2024
1 parent aac315b commit 69a6a1a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utilities/string.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {compose, invoker, juxt, allPass, identity, not, toLower, toUpper, Pred} from 'ramda';
import { compose, invoker, juxt, allPass, identity, not, toLower, toUpper, Pred, match } from 'ramda';

import {allEqual} from './list';

Expand All @@ -9,6 +9,7 @@ const notAlpha = compose(allEqual, juxt([toLower, toUpper]));
const hasAlpha = compose(not, notAlpha);

const startsWithLower = allPass([
compose(compose(not, match(/\n/)), charAt(0)) as Pred<any[]>,
compose(compose(not, notAlpha), charAt(0)) as Pred<any[]>,
compose(allEqual, juxt([identity, toLower]), charAt(0)) as Pred<any[]>,
]);
Expand Down

0 comments on commit 69a6a1a

Please sign in to comment.