@@ -10,12 +10,6 @@ const _ = require('lodash')
10
10
*/
11
11
const getMeta = ( metadata = [ ] , key ) => _ . find ( metadata , meta => meta . name === key )
12
12
13
- /**
14
- * Convert string to bool
15
- * @param {String } v the value
16
- */
17
- const toBool = v => _ . toString ( v ) . toLowerCase ( ) === 'true'
18
-
19
13
/**
20
14
* Extract billing project
21
15
* @param {Object } challenge the challenge object
@@ -74,7 +68,7 @@ function extractDrPoints (challenge, defaultValue) {
74
68
function extractApprovalRequired ( challenge , defaultValue ) {
75
69
const entry = getMeta ( challenge . metadata , 'approvalRequired' )
76
70
if ( ! entry ) return defaultValue
77
- return toBool ( entry . value )
71
+ return _ . toString ( entry . value )
78
72
}
79
73
80
74
/**
@@ -85,7 +79,7 @@ function extractApprovalRequired (challenge, defaultValue) {
85
79
function extractPostMortemRequired ( challenge , defaultValue ) {
86
80
const entry = getMeta ( challenge . metadata , 'postMortemRequired' )
87
81
if ( ! entry ) return defaultValue
88
- return toBool ( entry . value )
82
+ return _ . toString ( entry . value )
89
83
}
90
84
91
85
/**
@@ -96,7 +90,7 @@ function extractPostMortemRequired (challenge, defaultValue) {
96
90
function extractTrackLateDeliverablesRequired ( challenge , defaultValue ) {
97
91
const entry = getMeta ( challenge . metadata , 'trackLateDeliverables' )
98
92
if ( ! entry ) return defaultValue
99
- return toBool ( entry . value )
93
+ return _ . toString ( entry . value )
100
94
}
101
95
102
96
/**
@@ -107,7 +101,7 @@ function extractTrackLateDeliverablesRequired (challenge, defaultValue) {
107
101
function extractAllowStockArtRequired ( challenge , defaultValue ) {
108
102
const entry = getMeta ( challenge . metadata , 'allowStockArt' )
109
103
if ( ! entry ) return defaultValue
110
- return toBool ( entry . value )
104
+ return _ . toString ( entry . value )
111
105
}
112
106
113
107
/**
@@ -118,7 +112,7 @@ function extractAllowStockArtRequired (challenge, defaultValue) {
118
112
function extractSubmissionViewable ( challenge , defaultValue ) {
119
113
const entry = getMeta ( challenge . metadata , 'submissionViewable' )
120
114
if ( ! entry ) return defaultValue
121
- return toBool ( entry . value )
115
+ return _ . toString ( entry . value )
122
116
}
123
117
124
118
/**
@@ -129,7 +123,7 @@ function extractSubmissionViewable (challenge, defaultValue) {
129
123
function extractReviewFeedback ( challenge , defaultValue ) {
130
124
const entry = getMeta ( challenge . metadata , 'reviewFeedback' )
131
125
if ( ! entry ) return defaultValue
132
- return toBool ( entry . value )
126
+ return _ . toString ( entry . value )
133
127
}
134
128
135
129
/**
0 commit comments