1 | /* global window */
|
2 | var defaultDepth = 3;
|
3 | var matchDepthParameter =
|
4 | typeof window !== 'undefined' &&
|
5 | typeof window.location !== 'undefined' &&
|
6 | window.location.search.match(/[?&]depth=(\d+)(?:$|&)/);
|
7 |
|
8 | if (matchDepthParameter) {
|
9 | defaultDepth = parseInt(matchDepthParameter[1], 10);
|
10 | } else if (typeof process !== 'undefined' && process.env.UNEXPECTED_DEPTH) {
|
11 | defaultDepth = parseInt(process.env.UNEXPECTED_DEPTH, 10);
|
12 | }
|
13 | module.exports = defaultDepth;
|