Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
timonson committed May 6, 2024
1 parent 7adf3ea commit 8822a56
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions strings/split.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import { removeLast } from "./update.js";
import { last } from "../collections/single_access.js";

export function split(separator) {
return (s) => s.split(separator);
}
Expand All @@ -16,6 +19,8 @@ export const splitByEqualitySign = split("=");
export const splitByPlus = split("+");
export const splitByPipe = split("|");

export function removeFromLastDot(input) {
return removeLast(`.${last(splitByDot(input))}`)(input);
export function removeFromLastSeparator(splitFunction) {
return (input) => removeLast(`.${last(splitFunction(input))}`)(input);
}

export const removeFromLastDot = removeFromLastSeparator(splitByDot);
1 change: 1 addition & 0 deletions strings/update.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @ts-nocheck
import { length } from "../collections/length.js";
import { first, last } from "../collections/single_access.js";
import { repeat } from "./mapping.js";

function surroundWith(beginning) {
Expand Down

0 comments on commit 8822a56

Please sign in to comment.