Skip to content

Add functions in transform plugin to cover modify plugin - #1003

Open
timggggggg wants to merge 1 commit into
masterfrom
1000-transform-cover-modify-plugin
Open

Add functions in transform plugin to cover modify plugin#1003
timggggggg wants to merge 1 commit into
masterfrom
1000-transform-cover-modify-plugin

Conversation

@timggggggg

Copy link
Copy Markdown
Collaborator

Description

Functions

Six new functions and one new option on capture:

function signature
find_all find_all(value, pattern, group: 0, limit: -1) — every match as an array
join join(value, separator) — array of strings into one string
trim trim(value, cutset) — strip characters from both ends
trim_left trim_left(value, cutset) — strip from the start
trim_right trim_right(value, cutset) — strip from the end
slice slice(value, start, end: null) — substring by character, negative offsets
capture new numeric_groups: false — also key groups by index: "0", "1", …

New files

  • plugin/action/transform/stdlib/find_all.go + find_all_test.go
  • plugin/action/transform/stdlib/join.go + join_test.go
  • plugin/action/transform/stdlib/trim.go + trim_test.go
  • plugin/action/transform/stdlib/slice.go + slice_test.go

Modified files

  • plugin/action/transform/stdlib/capture.gonumeric_groups option
  • plugin/action/transform/stdlib/registry.go — six registrations
  • plugin/action/transform/stdlib/capture_test.gonumeric_groups tests
  • plugin/action/transform/stdlib/resolve_test.gocallFn helper, binds arguments
    through the compiled signature so named defaults apply
  • plugin/action/transform/transform.go — docs for the new functions
  • plugin/action/transform/README.md — regenerated
  • plugin/action/transform/doc_examples_test.go — compile-checks the new doc snippets

Fixes #1000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: transform plugin — cover the functionality of the modify plugin

2 participants