(options)
| 156 | @return {Array} An array of patterns to match against and replace |
| 157 | */ |
| 158 | function configReplacePatterns(options) { |
| 159 | return [ |
| 160 | { |
| 161 | match: /{{\s?rootURL\s?}}/g, |
| 162 | replacement(config) { |
| 163 | return normalizeUrl(config.rootURL); |
| 164 | }, |
| 165 | }, |
| 166 | { |
| 167 | match: /{{\s?EMBER_ENV\s?}}/g, |
| 168 | replacement(config) { |
| 169 | return convertObjectToString(config.EmberENV); |
| 170 | }, |
| 171 | }, |
| 172 | { |
| 173 | match: /{{content-for ['"](.+?)["']}}/g, |
| 174 | replacement(config, match, type) { |
| 175 | return contentFor(config, match, type, options); |
| 176 | }, |
| 177 | }, |
| 178 | { |
| 179 | match: /{{\s?MODULE_PREFIX\s?}}/g, |
| 180 | replacement(config) { |
| 181 | return config.modulePrefix; |
| 182 | }, |
| 183 | }, |
| 184 | ]; |
| 185 | } |
| 186 | |
| 187 | module.exports = { normalizeUrl, convertObjectToString, contentFor, configReplacePatterns }; |
no outgoing calls
no test coverage detected
searching dependent graphs…