1 | 'use strict';
|
2 |
|
3 | var map = require('../utilities/map');
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | module.exports = function buildExtensions(keypath, extensions) {
|
13 | var prefix = keypath.length ? keypath.join('.') + '.' : '';
|
14 | return map(extensions, function (properties, keypath) {
|
15 | keypath = (prefix + keypath).replace(/\./g, '\\.').replace(/\*\*/g, '::all::').replace(/\*/g, '::any::').replace(/::all::/g, '.*').replace(/::any::/g, '[^\.]+');
|
16 |
|
17 | keypath = new RegExp('^' + keypath + '$');
|
18 | return [keypath, properties];
|
19 | });
|
20 | }; |
\ | No newline at end of file |