chore(server): Move api-server in to it's own DIR
This commit is contained in:
committed by
mrugesh mohapatra
parent
9fba6bce4c
commit
46a217d0a5
17
api-server/common/utils/index.js
Normal file
17
api-server/common/utils/index.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import { pick } from 'lodash';
|
||||
|
||||
export function dashify(str) {
|
||||
return ('' + str)
|
||||
.toLowerCase()
|
||||
.replace(/\s/g, '-')
|
||||
.replace(/[^a-z0-9\-\.]/gi, '')
|
||||
.replace(/\:/g, '');
|
||||
}
|
||||
// todo: unify with server/utils/index.js:dasherize
|
||||
const dasherize = dashify;
|
||||
export { dasherize };
|
||||
|
||||
export const fixCompletedChallengeItem = obj => pick(
|
||||
obj,
|
||||
[ 'id', 'completedDate', 'solution', 'githubLink', 'challengeType', 'files' ]
|
||||
);
|
Reference in New Issue
Block a user