text-scrub
Advanced tools
Comparing version 0.5.5 to 0.5.6
@@ -17,4 +17,4 @@ var _ = require('underscore') | ||
_.each(tools, function(tool, key) { | ||
if (tool.tool && _.indexOf(['clean', 'swap', 'trim', 'grow', 'extractor', 'unique', 'splitter'], tool.tool) > -1) { | ||
line = Scrubber[tool.tool](tool, line) | ||
if (tool.scrub && _.indexOf(['clean', 'swap', 'trim', 'grow', 'extractor', 'unique', 'splitter'], tool.scrub) > -1) { | ||
line = Scrubber[tool.scrub](tool, line) | ||
} else { | ||
@@ -21,0 +21,0 @@ line = 'TextScrub invalid tool: ' + JSON.stringify(tool) |
{ | ||
"name": "text-scrub", | ||
"version": "0.5.5", | ||
"version": "0.5.6", | ||
"description": "Perform trim, grow, extract, scrub, deduplication, and structured splitting operations on lines of text in a chainable fashion. This ain't yo grand daddy's find & replace tool.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -33,4 +33,4 @@ Text Scrub | ||
var new_text = TextScrub.Wash([ | ||
{ tool: 'trim', start: '[doge@fort]$ ' }, | ||
{ tool: 'swap', find: 'path/thunderbird-profile/ImapMail/account-6.com/', replace: 'messages/' } | ||
{ scrub: 'trim', start: '[doge@fort]$ ' }, | ||
{ scrub: 'swap', find: 'path/thunderbird-profile/ImapMail/account-6.com/', replace: 'messages/' } | ||
], old_text) | ||
@@ -37,0 +37,0 @@ ``` |
@@ -113,6 +113,6 @@ var assert = require('assert') | ||
var tools = [ | ||
{ tool: 'trim', start: '/home/root/path/thunderbird-profile/ImapMail/' }, | ||
{ tool: 'swap', regex: 'url', item: 1, replace: '' }, | ||
{ tool: 'trim', start: '/' }, | ||
{ tool: 'splitter', term: '.sbd/', depth: 2, overage: 'unsorted', output: output }, | ||
{ scrub: 'trim', start: '/home/root/path/thunderbird-profile/ImapMail/' }, | ||
{ scrub: 'swap', regex: 'url', item: 1, replace: '' }, | ||
{ scrub: 'trim', start: '/' }, | ||
{ scrub: 'splitter', term: '.sbd/', depth: 2, overage: 'unsorted', output: output }, | ||
] | ||
@@ -119,0 +119,0 @@ var lines = line_nested_multi.split('\n') |
15928