Apply prototype funtions to strings deep in data types
Install
npm install --save deep-blue-string
Usage
const dbs = ; //Sanitize any data type;//=> {userInput: 'not in my house admin'}
API
dbs(target, function, [fnArgs])
target
Required
Type: Any
function
Required
Type: function
fnArgs
Optional
Type: string
|| array
Description: If the user inputted function takes arguments, supply them here. For multiple arguments (like String.prototype.replace
, input them as an array).
Function overview
Apply function to all strings in target
. Deeply nested strings will be found and operated on. No casting will be done on inputted target
.
Features
Supported target
Data Types:
- String
- Array
- Objects
- Object object
- Strings as objects
- Arrays as objects
- Numbers as objects (returned unmodified)
- Booleans as objects (returned unmodified)
- Regex as objects (returned unmodified)
- Function as objects (returned unmodified)
- Date objects (returned unmodified)
- Number (returned unmodified)
- Boolean (returned unmodified)
- Undefined (returned unmodified)
- Function (returned unmodified)
- Symbol (returned unmodified)
Related
License
MIT © dawsonbotsford