| 93 | * @returns {Record<string, string | string[] | T>} options to spread or pass |
| 94 | */ |
| 95 | const scope = (scope, options) => { |
| 96 | /** @type {Record<string, string | string[] | T>} */ |
| 97 | const obj = {}; |
| 98 | process( |
| 99 | options, |
| 100 | (item) => /** @type {string | string[] | T} */ (item), |
| 101 | (item) => /** @type {string | string[] | T} */ (item), |
| 102 | (key, value) => { |
| 103 | obj[ |
| 104 | key.startsWith("./") ? `${scope}${key.slice(1)}` : `${scope}/${key}` |
| 105 | ] = value; |
| 106 | } |
| 107 | ); |
| 108 | return obj; |
| 109 | }; |
| 110 | |
| 111 | module.exports.parseOptions = parseOptions; |
| 112 | module.exports.scope = scope; |