Comparing version 0.2.1 to 0.2.2
@@ -6,9 +6,15 @@ var annotate = require('annotate'); | ||
module.exports = annotate('extract', 'Extracts the part of `str` between `start` and `end`'). | ||
on(is.string, is.string, is.string, function(str, start, end) { | ||
var s = str.split(start)[1]; | ||
on(is.string, is.string, is.string, extract). | ||
on(is.string, is.string, function(str, start) { | ||
return extract(str, start); | ||
}). | ||
satisfies(is.string); | ||
if(!is.defined(s)) return ''; | ||
function extract(str, start, end) { | ||
var s = str.split(start)[1]; | ||
return s.trim().split(end)[0].trim(); | ||
}). | ||
satisfies(is.string); | ||
if(!is.defined(s)) return ''; | ||
return s.trim().split(end)[0].trim(); | ||
} | ||
@@ -5,3 +5,3 @@ { | ||
"author": "Juho Vepsalainen <bebraw@gmail.com>", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"dependencies": { | ||
@@ -8,0 +8,0 @@ "annois": "0.3.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11912
270