Skip to contents

Applies the package's text-normalization rules across an item payload. Titles lose trailing extensions and copy markers, filenames retain their extensions, and creator names and tags are included. Non-text values are returned unchanged.

Usage

ztCleanPayload(payload)

Arguments

payload

An item payload (named list of fields).

Value

The payload with every text field cleaned.

Examples

Payload <- list(
  itemType = "book",
  title = "Structural Analysis (1).pdf",
  creators = list(list(creatorType = "author", firstName = "A.",
                       lastName = "Author")),
  filename = "Structural Analysis (1).pdf"
)
ztCleanPayload(Payload)
#> $itemType
#> [1] "book"
#> 
#> $title
#> [1] "Structural Analysis"
#> 
#> $creators
#> $creators[[1]]
#> $creators[[1]]$creatorType
#> [1] "author"
#> 
#> $creators[[1]]$firstName
#> [1] "A."
#> 
#> $creators[[1]]$lastName
#> [1] "Author"
#> 
#> 
#> 
#> $filename
#> [1] "Structural Analysis.pdf"
#>