Skip to content

Commit

Permalink
remove uppercase
Browse files Browse the repository at this point in the history
  • Loading branch information
onrige authored and svagi committed Sep 25, 2017
1 parent a081e7b commit 7188855
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function prefixType(prefix, type) {
if (typeof prefix !== 'string') {
throw new Error('Invalid routine prefix. It should be string.');
}
return prefix.toUpperCase() + '_' + type;
return prefix + '_' + type;
}

function createAction(type, payload) {
Expand Down
3 changes: 3 additions & 0 deletions lib/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,7 @@ describe('prefixType', function () {
it('should prefix type', function () {
expect((0, _index.prefixType)('TEST', 'TYPE')).toBe('TEST_TYPE');
});
it('should not modify prefix to uppercase', function () {
expect((0, _index.prefixType)('@@test/TEST', 'TYPE')).toBe('@@test/TEST_TYPE');
});
});
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function prefixType (prefix, type) {
if (typeof prefix !== 'string') {
throw new Error('Invalid routine prefix. It should be string.')
}
return `${prefix.toUpperCase()}_${type}`
return `${prefix}_${type}`
}

export function createAction (type, payload, ...args) {
Expand Down
3 changes: 3 additions & 0 deletions src/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,7 @@ describe('prefixType', () => {
it('should prefix type', () => {
expect(prefixType('TEST', 'TYPE')).toBe('TEST_TYPE')
})
it('should not modify prefix to uppercase', () => {
expect(prefixType('@@test/TEST', 'TYPE')).toBe('@@test/TEST_TYPE')
})
})

0 comments on commit 7188855

Please sign in to comment.