Skip to content

Commit

Permalink
fix: bug on rgeex when end of the file name was -abe
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorybesson committed Sep 17, 2017
1 parent d4cef2b commit 36bb1d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/cli/cms/data/attr.js
@@ -1,8 +1,6 @@
import {cmsData} from '../../'

var fullAttr = '-abe-(.+?)(?=.'
var captureAttr = '-abe-(.+?)(?=.'

const captureAttr = '-abe-([a-z A-Z]{1}[0-9]{1}.+?)(?=.'
/**
* Class Attr
* Work string to manage string attributes key/value
Expand Down Expand Up @@ -39,7 +37,7 @@ export default class Attr {
remove() {
if (this.str != null) {
return this.str.replace(
new RegExp(fullAttr + this.getExtension() + ')'),
new RegExp(captureAttr + this.getExtension() + ')'),
''
)
}
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/cms/data/attr.js
Expand Up @@ -27,7 +27,7 @@ describe('Attr', function() {
*
*/
it('new attr', function() {
var attr = new cmsData.attr("article-abe-d20160920T125255138Z.shtml")
var attr = new cmsData.attr("article-mon-abe-abe-d20160920T125255138Z.shtml")
chai.expect(attr.str).to.not.be.undefined;
chai.expect(attr.val.s).to.not.be.undefined;
chai.expect(attr.val.s).to.be.equal('d');
Expand Down

0 comments on commit 36bb1d4

Please sign in to comment.