const strip = require('{%= name %}');
{%= apidocs("index.js") %}
Remove "raw" trailing numbers that might not actually be increments. Use this with caution.
Type: boolean
Default: undefined
Example:
console.log(strip('foo 1')); //=> 'foo 1'
console.log(strip('foo 1', { removeRawNumbers: true })); //=> 'foo'
console.log(strip('foo (1) 1')); //=> 'foo (1) 1'
console.log(strip('foo (1) 1', { removeRawNumbers: true })); //=> 'foo'
// This following example is not touched either way,
// since it's definitely not an increment.
console.log(strip('foo [1]')); //=> 'foo [1]'
console.log(strip('foo [1]', { removeRawNumbers: true })); //=> 'foo [1]'
All of the following would return foo
console.log(strip('foo (1)'));
console.log(strip('foo (2)'));
console.log(strip('foo (22)'));
All of the following would return foo.txt
console.log(strip('foo (1).txt'));
console.log(strip('foo (2).txt'));
console.log(strip('foo (22).txt'));
All of the following would return foo
console.log(strip('foo copy'));
console.log(strip('foo copy 1'));
console.log(strip('foo copy 2'));
console.log(strip('foo copy 21'));
console.log(strip('foo copy 219 copy 219'));
All of the following would return foo.txt
console.log(strip('foo copy.txt'));
console.log(strip('foo copy 1.txt'));
console.log(strip('foo copy 2.txt'));
console.log(strip('foo copy 21.txt'));
console.log(strip('foo copy 219 copy 219.txt'));