1 | const { interpolateName } = require('loader-utils');
|
2 |
|
3 | /**
|
4 | * @param {string} pattern
|
5 | * @param {Object} options
|
6 | * @param {string} options.resourcePath
|
7 | * @param {string} [options.context]
|
8 | * @param {string} [options.content]
|
9 | */
|
10 | function interpolate(pattern, options) {
|
11 | const { resourcePath, context, content } = options;
|
12 | return interpolateName({ resourcePath }, pattern, { context, content });
|
13 | }
|
14 |
|
15 | module.exports = interpolate;
|