Skip to content

Commit

Permalink
Unify snip and snipWhere
Browse files Browse the repository at this point in the history
  • Loading branch information
propensive committed Jan 15, 2025
1 parent 27df48e commit db6bc77
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/core/gossamer-core.scala
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,8 @@ extension [TextType: Textual](text: TextType)
text.where(!pred(_)).lay(TextType.empty): ordinal =>
text.before(ordinal)

def snipWhere(pred: Char => Boolean, index: Ordinal = Prim): Optional[(TextType, TextType)] =
text.where(pred, index).let: ordinal =>
text.snip(ordinal.n0)
def snip(pred: Char => Boolean, index: Ordinal = Prim): Optional[(TextType, TextType)] =
text.where(pred, index).let(_.n0).let(text.snip(_))

def mapChars(lambda: Char => Char): TextType = TextType.map(text, lambda)

Expand Down
2 changes: 1 addition & 1 deletion src/core/soundness+gossamer-core.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export gossamer.{Bidi, Buffer, Cuttable, Decimalizer, Interpolation, Joinable, N
Presentational, Pue, RangeError, TextBuffer, Textual, append, construct, fill, txt, t, utf8,
utf16, ascii, hex, text, pue, cut, pascal, camel, snake, kebab, length, populated, lower,
upper, plain, skip, keep, capitalize, uncapitalize, tail, init, empty, chars,
snip, reverse, contains, trim, where, upto, dropWhile, snipWhere,
snip, reverse, contains, trim, where, upto, dropWhile,
mapChars, count, metrics, pad, center, fit, uncamel, unkebab, unsnake, starts, ends,
tr, subscript, superscript, sub, flatMap, urlEncode, urlDecode, punycode, bytes,
sysBytes, lev, join, add, words, lines, appendln, spaced, slices, seek, search}
Expand Down

0 comments on commit db6bc77

Please sign in to comment.