| 22 | var parseConfigCache = {} |
| 23 | |
| 24 | function checkExtend(name) { |
| 25 | var use = ' Use `dangerousExtend` option to disable.' |
| 26 | if (!CONFIG_PATTERN.test(name) && !SCOPED_CONFIG__PATTERN.test(name)) { |
| 27 | throw new BrowserslistError( |
| 28 | 'Browserslist config needs `browserslist-config-` prefix. ' + use |
| 29 | ) |
| 30 | } |
| 31 | if (name.replace(/^@[^/]+\//, '').indexOf('.') !== -1) { |
| 32 | throw new BrowserslistError( |
| 33 | '`.` not allowed in Browserslist config name. ' + use |
| 34 | ) |
| 35 | } |
| 36 | if (name.indexOf('node_modules') !== -1) { |
| 37 | throw new BrowserslistError( |
| 38 | '`node_modules` not allowed in Browserslist config.' + use |
| 39 | ) |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | function getPathType(filepath) { |
| 44 | var stats |