1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.ApiExtension = void 0;
|
4 | const constants_1 = require("../constants");
|
5 | const helpers_1 = require("./helpers");
|
6 | const lodash_1 = require("lodash");
|
7 | function ApiExtension(extensionKey, extensionProperties) {
|
8 | if (!extensionKey.startsWith('x-')) {
|
9 | throw new Error('Extension key is not prefixed. Please ensure you prefix it with `x-`.');
|
10 | }
|
11 | const extensionObject = {
|
12 | [extensionKey]: lodash_1.clone(extensionProperties)
|
13 | };
|
14 | return helpers_1.createMixedDecorator(constants_1.DECORATORS.API_EXTENSION, extensionObject);
|
15 | }
|
16 | exports.ApiExtension = ApiExtension;
|