elliotttf / cleanstring

Utility for cleaning strings for use in URIs
3 stars 0 forks source link

path-cleanstring

Build Status Documented with emdaer Greenkeeper badge

This module can be used to generate clean strings that can be used in URIs, etc. Its implementation is based on and intended to be used in parallel with the Drupal module pathauto‘s pathauto_cleanstring method.

API

CLEANSTRING_REMOVE

Constant for remove action.

Type: string

CLEANSTRING_REPLACE

Constant for replace action.

Type: string

CLEANSTRING_DONOTHING

Constant for do nothing action.

Type: string

cleanstring

Constructs a method for cleaning strings.

Note: passed in config is merged with the default config, but not recursively. Therefore, if you override one of the arrays or objects in the config you must provide all the members that you would like that array or object to contain.

Parameters

Returns CleanstringCallback A function which can be used to clean strings. Accepts a string as its only parameter and will return a string cleaned according to the settings provided.

CleanstringCallback

Method to clean a string according to config.

Type: Function

Parameters