n-deep-trim
v0.0.3
Published
deep trim
Downloads
3
Readme
n-deep-trim
deep trim
Usage
ES6
import deepTrim from 'n-deep-trim';
deepTrim(obj);
UMD
// download files
use n-deep-trim/dist/n-deep-trim.js
DeepTrim(obj)
deepTrim(' a b c ');
// 'a b c'
const obj = {
zz: ' cv c2f ',
n: 12,
a: [
{ b: { c: 3 } }
],
e: {
f: [
{ g: ' a lj ' },
{ g: 'kakaka' },
' sd ds '
]
}
};
deepTrim(obj);
/**
*
{
zz: ' cv c2f ',
n: 12,
a: [
{ b: { c: 3 } }
],
e: {
f: [
{ g: ' a lj ' },
{ g: 'kakaka' },
' sd ds '
]
}
}
*/
const objDate = {
zz: ' cv c2f ',
n: 12,
e: {
f: [
{ g: ' a lj ' },
new Date()
]
}
};
deepTrim(obj);
/**
*
{
zz: 'cv c2f',
n: 12,
e: {
f: [
{ g: 'a lj' },
new Date()
]
}
}
*/