mock-config-server 2.0.2 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +47 -3
- package/dist/bin/{mock-config-server.d.ts → bin.d.ts} +2 -2
- package/dist/bin/bin.js +8 -0
- package/dist/bin/cli.d.ts +1 -0
- package/dist/bin/cli.js +36 -0
- package/dist/bin/{resolveExportsFromSourceCode.d.ts → resolveExportsFromSourceCode/resolveExportsFromSourceCode.d.ts} +1 -1
- package/dist/bin/{resolveExportsFromSourceCode.js → resolveExportsFromSourceCode/resolveExportsFromSourceCode.js} +11 -11
- package/dist/bin/start.d.ts +3 -0
- package/dist/bin/{mock-config-server.js → start.js} +73 -67
- package/dist/bin/validateMockServerConfig/validateBaseUrl/validateBaseUrl.d.ts +1 -1
- package/dist/bin/validateMockServerConfig/validateBaseUrl/validateBaseUrl.js +12 -12
- package/dist/bin/validateMockServerConfig/validateCors/validateCors.d.ts +1 -1
- package/dist/bin/validateMockServerConfig/validateCors/validateCors.js +82 -82
- package/dist/bin/validateMockServerConfig/validateGraphqlConfig/validateGraphqlConfig.d.ts +1 -1
- package/dist/bin/validateMockServerConfig/validateGraphqlConfig/validateGraphqlConfig.js +48 -48
- package/dist/bin/validateMockServerConfig/validateGraphqlConfig/validateRoutes/validateRoutes.d.ts +2 -2
- package/dist/bin/validateMockServerConfig/validateGraphqlConfig/validateRoutes/validateRoutes.js +71 -71
- package/dist/bin/validateMockServerConfig/validateInterceptors/validateInterceptors.d.ts +1 -1
- package/dist/bin/validateMockServerConfig/validateInterceptors/validateInterceptors.js +21 -21
- package/dist/bin/validateMockServerConfig/validateMockServerConfig.d.ts +2 -1
- package/dist/bin/validateMockServerConfig/validateMockServerConfig.js +30 -34
- package/dist/bin/validateMockServerConfig/validatePort/validatePort.d.ts +1 -1
- package/dist/bin/validateMockServerConfig/validatePort/validatePort.js +9 -9
- package/dist/bin/validateMockServerConfig/validateRestConfig/validateRestConfig.d.ts +1 -1
- package/dist/bin/validateMockServerConfig/validateRestConfig/validateRestConfig.js +52 -52
- package/dist/bin/validateMockServerConfig/validateRestConfig/validateRoutes/validateRoutes.d.ts +2 -2
- package/dist/bin/validateMockServerConfig/validateRestConfig/validateRoutes/validateRoutes.js +105 -104
- package/dist/bin/validateMockServerConfig/validateStaticPath/validateStaticPath.d.ts +1 -1
- package/dist/bin/validateMockServerConfig/validateStaticPath/validateStaticPath.js +44 -44
- package/dist/index.d.ts +1 -1
- package/dist/index.js +17 -17
- package/dist/src/{graphql → core/graphql}/createGraphQLRoutes/createGraphQLRoutes.d.ts +3 -3
- package/dist/src/{graphql → core/graphql}/createGraphQLRoutes/createGraphQLRoutes.js +76 -73
- package/dist/src/core/graphql/createGraphQLRoutes/helpers/index.d.ts +1 -0
- package/dist/src/{notFound/urlSuggestions → core/graphql/createGraphQLRoutes/helpers}/index.js +17 -18
- package/dist/src/{graphql → core/graphql/createGraphQLRoutes/helpers}/prepareGraphQLRequestConfigs/prepareGraphQLRequestConfigs.d.ts +2 -2
- package/dist/src/{graphql → core/graphql/createGraphQLRoutes/helpers}/prepareGraphQLRequestConfigs/prepareGraphQLRequestConfigs.js +28 -28
- package/dist/src/core/graphql/index.d.ts +1 -0
- package/dist/src/{notFound/urlSuggestions/getGraphqlUrlSuggestions → core/graphql}/index.js +17 -17
- package/dist/src/{cors → core/middlewares}/corsMiddleware/corsMiddleware.d.ts +3 -3
- package/dist/src/{cors → core/middlewares}/corsMiddleware/corsMiddleware.js +44 -44
- package/dist/src/{cors/getOrigins → core/middlewares/corsMiddleware/helpers/getAllowedOrigins}/getAllowedOrigins.d.ts +2 -2
- package/dist/src/{cors/getOrigins → core/middlewares/corsMiddleware/helpers/getAllowedOrigins}/getAllowedOrigins.js +13 -13
- package/dist/src/core/middlewares/corsMiddleware/helpers/index.d.ts +1 -0
- package/dist/src/{notFound/urlSuggestions/getRestUrlSuggestions → core/middlewares/corsMiddleware/helpers}/index.js +17 -17
- package/dist/src/core/middlewares/index.d.ts +4 -0
- package/dist/src/core/middlewares/index.js +20 -0
- package/dist/src/{cors → core/middlewares}/noCorsMiddleware/noCorsMiddleware.d.ts +2 -2
- package/dist/src/{cors → core/middlewares}/noCorsMiddleware/noCorsMiddleware.js +24 -20
- package/dist/src/{notFound/urlSuggestions → core/middlewares/notFoundMiddleware/helpers}/getGraphqlUrlSuggestions/getGraphqlUrlSuggestions.d.ts +6 -6
- package/dist/src/{notFound/urlSuggestions → core/middlewares/notFoundMiddleware/helpers}/getGraphqlUrlSuggestions/getGraphqlUrlSuggestions.js +18 -18
- package/dist/src/{notFound/urlSuggestions → core/middlewares/notFoundMiddleware/helpers}/getLevenshteinDistance/getLevenshteinDistance.d.ts +1 -1
- package/dist/src/{notFound/urlSuggestions → core/middlewares/notFoundMiddleware/helpers}/getLevenshteinDistance/getLevenshteinDistance.js +80 -80
- package/dist/src/{notFound/urlSuggestions → core/middlewares/notFoundMiddleware/helpers}/getRestUrlSuggestions/getRestUrlSuggestions.d.ts +6 -6
- package/dist/src/{notFound/urlSuggestions → core/middlewares/notFoundMiddleware/helpers}/getRestUrlSuggestions/getRestUrlSuggestions.js +34 -34
- package/dist/src/{notFound/urlSuggestions → core/middlewares/notFoundMiddleware/helpers}/getRestUrlSuggestions/helpers/getActualRestUrlMeaningfulString/getActualRestUrlMeaningfulString.d.ts +1 -1
- package/dist/src/{notFound/urlSuggestions → core/middlewares/notFoundMiddleware/helpers}/getRestUrlSuggestions/helpers/getActualRestUrlMeaningfulString/getActualRestUrlMeaningfulString.js +7 -7
- package/dist/src/{notFound/urlSuggestions → core/middlewares/notFoundMiddleware/helpers}/getRestUrlSuggestions/helpers/getPatternRestUrlMeaningfulString/getPatternRestUrlMeaningfulString.d.ts +1 -1
- package/dist/src/{notFound/urlSuggestions → core/middlewares/notFoundMiddleware/helpers}/getRestUrlSuggestions/helpers/getPatternRestUrlMeaningfulString/getPatternRestUrlMeaningfulString.js +5 -5
- package/dist/src/{notFound/urlSuggestions → core/middlewares/notFoundMiddleware/helpers}/getRestUrlSuggestions/helpers/index.d.ts +2 -2
- package/dist/src/{notFound/urlSuggestions → core/middlewares/notFoundMiddleware/helpers}/getRestUrlSuggestions/helpers/index.js +18 -18
- package/dist/src/core/middlewares/notFoundMiddleware/helpers/index.d.ts +3 -0
- package/dist/src/core/middlewares/notFoundMiddleware/helpers/index.js +19 -0
- package/dist/src/{notFound → core/middlewares/notFoundMiddleware}/notFoundMiddleware.d.ts +8 -8
- package/dist/src/{notFound → core/middlewares/notFoundMiddleware}/notFoundMiddleware.js +47 -47
- package/dist/src/{static → core/middlewares}/staticMiddleware/staticMiddleware.d.ts +3 -3
- package/dist/src/{static → core/middlewares}/staticMiddleware/staticMiddleware.js +30 -30
- package/dist/src/{rest → core/rest}/createRestRoutes/createRestRoutes.d.ts +3 -3
- package/dist/src/{rest → core/rest}/createRestRoutes/createRestRoutes.js +46 -41
- package/dist/src/core/rest/createRestRoutes/helpers/index.d.ts +1 -0
- package/dist/src/core/rest/createRestRoutes/helpers/index.js +17 -0
- package/dist/src/{rest → core/rest/createRestRoutes/helpers}/prepareRestRequestConfigs/prepareRestRequestConfigs.d.ts +2 -2
- package/dist/src/{rest → core/rest/createRestRoutes/helpers}/prepareRestRequestConfigs/prepareRestRequestConfigs.js +30 -30
- package/dist/src/core/rest/index.d.ts +1 -0
- package/dist/src/core/rest/index.js +17 -0
- package/dist/src/index.d.ts +3 -3
- package/dist/src/index.js +19 -19
- package/dist/src/server/createMockServer/createMockServer.d.ts +3 -3
- package/dist/src/server/createMockServer/createMockServer.js +46 -49
- package/dist/src/server/index.d.ts +2 -0
- package/dist/src/server/index.js +18 -0
- package/dist/src/server/startMockServer/startMockServer.d.ts +2 -2
- package/dist/src/server/startMockServer/startMockServer.js +17 -17
- package/dist/src/utils/constants/appPath.d.ts +1 -1
- package/dist/src/utils/constants/appPath.js +4 -4
- package/dist/src/utils/constants/default.d.ts +11 -11
- package/dist/src/utils/constants/default.js +14 -14
- package/dist/src/utils/constants/index.d.ts +2 -2
- package/dist/src/utils/constants/index.js +18 -18
- package/dist/src/utils/helpers/config/index.d.ts +1 -0
- package/dist/src/utils/helpers/config/index.js +17 -0
- package/dist/src/{configs → utils/helpers/config}/isEntitiesEqual/isEntityValuesEqual.d.ts +1 -1
- package/dist/src/{configs → utils/helpers/config}/isEntitiesEqual/isEntityValuesEqual.js +29 -29
- package/dist/src/{graphql → utils/helpers/graphql}/getGraphQLInput/getGraphQLInput.d.ts +3 -3
- package/dist/src/{graphql → utils/helpers/graphql}/getGraphQLInput/getGraphQLInput.js +21 -21
- package/dist/src/utils/helpers/graphql/index.d.ts +3 -0
- package/dist/src/utils/helpers/graphql/index.js +19 -0
- package/dist/src/{graphql → utils/helpers/graphql}/parseGraphQLRequest/parseGraphQLRequest.d.ts +3 -3
- package/dist/src/{graphql → utils/helpers/graphql}/parseGraphQLRequest/parseGraphQLRequest.js +12 -12
- package/dist/src/{graphql → utils/helpers/graphql}/parseQuery/parseQuery.d.ts +7 -7
- package/dist/src/{graphql → utils/helpers/graphql}/parseQuery/parseQuery.js +21 -21
- package/dist/src/utils/helpers/index.d.ts +6 -3
- package/dist/src/utils/helpers/index.js +22 -19
- package/dist/src/{routes → utils/helpers/interceptors}/callRequestInterceptors/callRequestInterceptors.d.ts +12 -12
- package/dist/src/{routes → utils/helpers/interceptors}/callRequestInterceptors/callRequestInterceptors.js +13 -13
- package/dist/src/{routes → utils/helpers/interceptors}/callResponseInterceptors/callResponseInterceptors.d.ts +14 -14
- package/dist/src/{routes → utils/helpers/interceptors}/callResponseInterceptors/callResponseInterceptors.js +55 -31
- package/dist/src/utils/helpers/interceptors/index.d.ts +2 -0
- package/dist/src/utils/helpers/interceptors/index.js +18 -0
- package/dist/src/utils/helpers/{isPlainObject.d.ts → isPlainObject/isPlainObject.d.ts} +1 -1
- package/dist/src/utils/helpers/{isPlainObject.js → isPlainObject/isPlainObject.js} +5 -5
- package/dist/src/utils/helpers/sleep.d.ts +1 -1
- package/dist/src/utils/helpers/sleep.js +7 -7
- package/dist/src/utils/helpers/url/convertWin32PathToUnix/convertWin32PathToUnix.d.ts +1 -1
- package/dist/src/utils/helpers/url/convertWin32PathToUnix/convertWin32PathToUnix.js +8 -8
- package/dist/src/utils/helpers/url/getUrlParts/getUrlParts.d.ts +1 -1
- package/dist/src/utils/helpers/url/getUrlParts/getUrlParts.js +6 -6
- package/dist/src/utils/helpers/url/index.d.ts +4 -4
- package/dist/src/utils/helpers/url/index.js +20 -20
- package/dist/src/utils/helpers/url/removeLeadingAndTrailingSlashes/removeLeadingAndTrailingSlashes.d.ts +1 -1
- package/dist/src/utils/helpers/url/removeLeadingAndTrailingSlashes/removeLeadingAndTrailingSlashes.js +5 -5
- package/dist/src/utils/helpers/url/urlJoin/urlJoin.d.ts +1 -1
- package/dist/src/utils/helpers/url/urlJoin/urlJoin.js +14 -14
- package/dist/src/utils/types/graphql.d.ts +34 -5
- package/dist/src/utils/types/graphql.js +2 -2
- package/dist/src/utils/types/index.d.ts +5 -4
- package/dist/src/utils/types/index.js +21 -20
- package/dist/src/utils/types/interceptors.d.ts +21 -15
- package/dist/src/utils/types/interceptors.js +2 -2
- package/dist/src/utils/types/rest.d.ts +38 -0
- package/dist/src/utils/types/{configs.js → rest.js} +2 -2
- package/dist/src/utils/types/server.d.ts +37 -32
- package/dist/src/utils/types/server.js +2 -2
- package/dist/src/utils/types/values.d.ts +9 -0
- package/dist/src/utils/types/values.js +2 -0
- package/package.json +22 -18
- package/dist/src/notFound/urlSuggestions/getGraphqlUrlSuggestions/index.d.ts +0 -1
- package/dist/src/notFound/urlSuggestions/getRestUrlSuggestions/index.d.ts +0 -1
- package/dist/src/notFound/urlSuggestions/index.d.ts +0 -2
- package/dist/src/utils/types/configs.d.ts +0 -63
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const isEntityValuesEqual: (firstEntityValue: any, secondEntityValue: any) => boolean;
|
|
1
|
+
export declare const isEntityValuesEqual: (firstEntityValue: any, secondEntityValue: any) => boolean;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isEntityValuesEqual = void 0;
|
|
4
|
-
const flat_1 = require("flat");
|
|
5
|
-
const
|
|
6
|
-
const isEntityValuesEqual = (firstEntityValue, secondEntityValue) => {
|
|
7
|
-
const isValuesArePlainObjects = (0,
|
|
8
|
-
if (isValuesArePlainObjects) {
|
|
9
|
-
const flattenFirstEntityValue = (0, flat_1.flatten)(firstEntityValue);
|
|
10
|
-
const flattenSecondEntityValue = (0, flat_1.flatten)(secondEntityValue);
|
|
11
|
-
return Object.keys(flattenFirstEntityValue).every((key) =>
|
|
12
|
-
// ✅ important:
|
|
13
|
-
// call 'toString' for ignore types of values
|
|
14
|
-
flattenFirstEntityValue[key].toString() === flattenSecondEntityValue[key]?.toString());
|
|
15
|
-
}
|
|
16
|
-
const isValuesAreArrays = Array.isArray(firstEntityValue) && Array.isArray(secondEntityValue);
|
|
17
|
-
if (isValuesAreArrays) {
|
|
18
|
-
const flattenFirstEntityValue = (0, flat_1.flatten)(firstEntityValue);
|
|
19
|
-
const flattenSecondEntityValue = (0, flat_1.flatten)(secondEntityValue);
|
|
20
|
-
return (Object.keys(flattenFirstEntityValue).length ===
|
|
21
|
-
Object.keys(flattenSecondEntityValue).length &&
|
|
22
|
-
Object.keys(flattenFirstEntityValue).every((key) =>
|
|
23
|
-
// ✅ important:
|
|
24
|
-
// call 'toString' for ignore types of values
|
|
25
|
-
flattenFirstEntityValue[key].toString() === flattenSecondEntityValue[key].toString()));
|
|
26
|
-
}
|
|
27
|
-
return `${firstEntityValue}` === `${secondEntityValue}`;
|
|
28
|
-
};
|
|
29
|
-
exports.isEntityValuesEqual = isEntityValuesEqual;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isEntityValuesEqual = void 0;
|
|
4
|
+
const flat_1 = require("flat");
|
|
5
|
+
const isPlainObject_1 = require("../../isPlainObject/isPlainObject");
|
|
6
|
+
const isEntityValuesEqual = (firstEntityValue, secondEntityValue) => {
|
|
7
|
+
const isValuesArePlainObjects = (0, isPlainObject_1.isPlainObject)(firstEntityValue) && (0, isPlainObject_1.isPlainObject)(secondEntityValue);
|
|
8
|
+
if (isValuesArePlainObjects) {
|
|
9
|
+
const flattenFirstEntityValue = (0, flat_1.flatten)(firstEntityValue);
|
|
10
|
+
const flattenSecondEntityValue = (0, flat_1.flatten)(secondEntityValue);
|
|
11
|
+
return Object.keys(flattenFirstEntityValue).every((key) =>
|
|
12
|
+
// ✅ important:
|
|
13
|
+
// call 'toString' for ignore types of values
|
|
14
|
+
flattenFirstEntityValue[key].toString() === flattenSecondEntityValue[key]?.toString());
|
|
15
|
+
}
|
|
16
|
+
const isValuesAreArrays = Array.isArray(firstEntityValue) && Array.isArray(secondEntityValue);
|
|
17
|
+
if (isValuesAreArrays) {
|
|
18
|
+
const flattenFirstEntityValue = (0, flat_1.flatten)(firstEntityValue);
|
|
19
|
+
const flattenSecondEntityValue = (0, flat_1.flatten)(secondEntityValue);
|
|
20
|
+
return (Object.keys(flattenFirstEntityValue).length ===
|
|
21
|
+
Object.keys(flattenSecondEntityValue).length &&
|
|
22
|
+
Object.keys(flattenFirstEntityValue).every((key) =>
|
|
23
|
+
// ✅ important:
|
|
24
|
+
// call 'toString' for ignore types of values
|
|
25
|
+
flattenFirstEntityValue[key].toString() === flattenSecondEntityValue[key].toString()));
|
|
26
|
+
}
|
|
27
|
+
return `${firstEntityValue}` === `${secondEntityValue}`;
|
|
28
|
+
};
|
|
29
|
+
exports.isEntityValuesEqual = isEntityValuesEqual;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { Request } from 'express';
|
|
2
|
-
import type { GraphQLInput } from '
|
|
3
|
-
export declare const getGraphQLInput: (request: Request) => GraphQLInput;
|
|
1
|
+
import type { Request } from 'express';
|
|
2
|
+
import type { GraphQLInput } from '../../../types';
|
|
3
|
+
export declare const getGraphQLInput: (request: Request) => GraphQLInput;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getGraphQLInput = void 0;
|
|
4
|
-
const getGraphQLInput = (request) => {
|
|
5
|
-
if (request.method === 'GET') {
|
|
6
|
-
const { query, variables } = request.query;
|
|
7
|
-
return {
|
|
8
|
-
query: query?.toString(),
|
|
9
|
-
variables: JSON.parse(variables ?? '{}')
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
if (request.method === 'POST') {
|
|
13
|
-
const { query, variables } = request.body;
|
|
14
|
-
return {
|
|
15
|
-
query,
|
|
16
|
-
variables: variables ?? {}
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
throw new Error('Not allowed request method for graphql request');
|
|
20
|
-
};
|
|
21
|
-
exports.getGraphQLInput = getGraphQLInput;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getGraphQLInput = void 0;
|
|
4
|
+
const getGraphQLInput = (request) => {
|
|
5
|
+
if (request.method === 'GET') {
|
|
6
|
+
const { query, variables } = request.query;
|
|
7
|
+
return {
|
|
8
|
+
query: query?.toString(),
|
|
9
|
+
variables: JSON.parse(variables ?? '{}')
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
if (request.method === 'POST') {
|
|
13
|
+
const { query, variables } = request.body;
|
|
14
|
+
return {
|
|
15
|
+
query,
|
|
16
|
+
variables: variables ?? {}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
throw new Error('Not allowed request method for graphql request');
|
|
20
|
+
};
|
|
21
|
+
exports.getGraphQLInput = getGraphQLInput;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./parseGraphQLRequest/parseGraphQLRequest"), exports);
|
|
18
|
+
__exportStar(require("./parseQuery/parseQuery"), exports);
|
|
19
|
+
__exportStar(require("./getGraphQLInput/getGraphQLInput"), exports);
|
package/dist/src/{graphql → utils/helpers/graphql}/parseGraphQLRequest/parseGraphQLRequest.d.ts
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Request } from 'express';
|
|
2
|
-
import { parseQuery } from '../parseQuery/parseQuery';
|
|
3
|
-
export declare const parseGraphQLRequest: (request: Request) => ReturnType<typeof parseQuery>;
|
|
1
|
+
import type { Request } from 'express';
|
|
2
|
+
import { parseQuery } from '../parseQuery/parseQuery';
|
|
3
|
+
export declare const parseGraphQLRequest: (request: Request) => ReturnType<typeof parseQuery>;
|
package/dist/src/{graphql → utils/helpers/graphql}/parseGraphQLRequest/parseGraphQLRequest.js
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseGraphQLRequest = void 0;
|
|
4
|
-
const getGraphQLInput_1 = require("../getGraphQLInput/getGraphQLInput");
|
|
5
|
-
const parseQuery_1 = require("../parseQuery/parseQuery");
|
|
6
|
-
const parseGraphQLRequest = (request) => {
|
|
7
|
-
const graphQLInput = (0, getGraphQLInput_1.getGraphQLInput)(request);
|
|
8
|
-
if (!graphQLInput.query)
|
|
9
|
-
return null;
|
|
10
|
-
return (0, parseQuery_1.parseQuery)(graphQLInput.query);
|
|
11
|
-
};
|
|
12
|
-
exports.parseGraphQLRequest = parseGraphQLRequest;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseGraphQLRequest = void 0;
|
|
4
|
+
const getGraphQLInput_1 = require("../getGraphQLInput/getGraphQLInput");
|
|
5
|
+
const parseQuery_1 = require("../parseQuery/parseQuery");
|
|
6
|
+
const parseGraphQLRequest = (request) => {
|
|
7
|
+
const graphQLInput = (0, getGraphQLInput_1.getGraphQLInput)(request);
|
|
8
|
+
if (!graphQLInput.query)
|
|
9
|
+
return null;
|
|
10
|
+
return (0, parseQuery_1.parseQuery)(graphQLInput.query);
|
|
11
|
+
};
|
|
12
|
+
exports.parseGraphQLRequest = parseGraphQLRequest;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { OperationTypeNode } from 'graphql';
|
|
2
|
-
interface ParseDocumentNodeResult {
|
|
3
|
-
operationType: OperationTypeNode;
|
|
4
|
-
operationName: string;
|
|
5
|
-
}
|
|
6
|
-
export declare const parseQuery: (query: string) => ParseDocumentNodeResult | null;
|
|
7
|
-
export {};
|
|
1
|
+
import type { OperationTypeNode } from 'graphql';
|
|
2
|
+
interface ParseDocumentNodeResult {
|
|
3
|
+
operationType: OperationTypeNode;
|
|
4
|
+
operationName: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const parseQuery: (query: string) => ParseDocumentNodeResult | null;
|
|
7
|
+
export {};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseQuery = void 0;
|
|
4
|
-
const graphql_1 = require("graphql");
|
|
5
|
-
const parseDocumentNode = (node) => {
|
|
6
|
-
const operationDefinition = node.definitions.find((definition) => definition.kind === 'OperationDefinition');
|
|
7
|
-
return {
|
|
8
|
-
operationType: operationDefinition.operation,
|
|
9
|
-
operationName: operationDefinition.name?.value ?? ''
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
const parseQuery = (query) => {
|
|
13
|
-
try {
|
|
14
|
-
const document = (0, graphql_1.parse)(query);
|
|
15
|
-
return parseDocumentNode(document);
|
|
16
|
-
}
|
|
17
|
-
catch {
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
exports.parseQuery = parseQuery;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseQuery = void 0;
|
|
4
|
+
const graphql_1 = require("graphql");
|
|
5
|
+
const parseDocumentNode = (node) => {
|
|
6
|
+
const operationDefinition = node.definitions.find((definition) => definition.kind === 'OperationDefinition');
|
|
7
|
+
return {
|
|
8
|
+
operationType: operationDefinition.operation,
|
|
9
|
+
operationName: operationDefinition.name?.value ?? ''
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
const parseQuery = (query) => {
|
|
13
|
+
try {
|
|
14
|
+
const document = (0, graphql_1.parse)(query);
|
|
15
|
+
return parseDocumentNode(document);
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
exports.parseQuery = parseQuery;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
export * from './isPlainObject';
|
|
2
|
-
export * from './sleep';
|
|
3
|
-
export * from './url';
|
|
1
|
+
export * from './isPlainObject/isPlainObject';
|
|
2
|
+
export * from './sleep';
|
|
3
|
+
export * from './url';
|
|
4
|
+
export * from './config';
|
|
5
|
+
export * from './interceptors';
|
|
6
|
+
export * from './graphql';
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./isPlainObject"), exports);
|
|
18
|
-
__exportStar(require("./sleep"), exports);
|
|
19
|
-
__exportStar(require("./url"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./isPlainObject/isPlainObject"), exports);
|
|
18
|
+
__exportStar(require("./sleep"), exports);
|
|
19
|
+
__exportStar(require("./url"), exports);
|
|
20
|
+
__exportStar(require("./config"), exports);
|
|
21
|
+
__exportStar(require("./interceptors"), exports);
|
|
22
|
+
__exportStar(require("./graphql"), exports);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { Request } from 'express';
|
|
2
|
-
import { InterceptorRequest } from '
|
|
3
|
-
interface CallRequestInterceptorsParams {
|
|
4
|
-
request: Request;
|
|
5
|
-
interceptors?: {
|
|
6
|
-
routeInterceptor?: InterceptorRequest | undefined;
|
|
7
|
-
requestInterceptor?: InterceptorRequest | undefined;
|
|
8
|
-
serverInterceptor?: InterceptorRequest | undefined;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
export declare const callRequestInterceptors: (params: CallRequestInterceptorsParams) => void;
|
|
12
|
-
export {};
|
|
1
|
+
import type { Request } from 'express';
|
|
2
|
+
import type { InterceptorRequest } from '../../../types';
|
|
3
|
+
interface CallRequestInterceptorsParams {
|
|
4
|
+
request: Request;
|
|
5
|
+
interceptors?: {
|
|
6
|
+
routeInterceptor?: InterceptorRequest | undefined;
|
|
7
|
+
requestInterceptor?: InterceptorRequest | undefined;
|
|
8
|
+
serverInterceptor?: InterceptorRequest | undefined;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export declare const callRequestInterceptors: (params: CallRequestInterceptorsParams) => void;
|
|
12
|
+
export {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.callRequestInterceptors = void 0;
|
|
4
|
-
const callRequestInterceptors = (params) => {
|
|
5
|
-
const { request, interceptors } = params;
|
|
6
|
-
if (interceptors?.routeInterceptor)
|
|
7
|
-
interceptors.routeInterceptor({ request });
|
|
8
|
-
if (interceptors?.requestInterceptor)
|
|
9
|
-
interceptors.requestInterceptor({ request });
|
|
10
|
-
if (interceptors?.serverInterceptor)
|
|
11
|
-
interceptors.serverInterceptor({ request });
|
|
12
|
-
};
|
|
13
|
-
exports.callRequestInterceptors = callRequestInterceptors;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.callRequestInterceptors = void 0;
|
|
4
|
+
const callRequestInterceptors = (params) => {
|
|
5
|
+
const { request, interceptors } = params;
|
|
6
|
+
if (interceptors?.routeInterceptor)
|
|
7
|
+
interceptors.routeInterceptor({ request });
|
|
8
|
+
if (interceptors?.requestInterceptor)
|
|
9
|
+
interceptors.requestInterceptor({ request });
|
|
10
|
+
if (interceptors?.serverInterceptor)
|
|
11
|
+
interceptors.serverInterceptor({ request });
|
|
12
|
+
};
|
|
13
|
+
exports.callRequestInterceptors = callRequestInterceptors;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { Request, Response } from 'express';
|
|
2
|
-
import type { InterceptorResponse } from '
|
|
3
|
-
interface CallResponseInterceptorsParams
|
|
4
|
-
data:
|
|
5
|
-
request: Request;
|
|
6
|
-
response: Response;
|
|
7
|
-
interceptors?: {
|
|
8
|
-
routeInterceptor?: InterceptorResponse | undefined;
|
|
9
|
-
requestInterceptor?: InterceptorResponse | undefined;
|
|
10
|
-
serverInterceptor?: InterceptorResponse | undefined;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
export declare const callResponseInterceptors:
|
|
14
|
-
export {};
|
|
1
|
+
import type { Request, Response } from 'express';
|
|
2
|
+
import type { Data, InterceptorResponse } from '../../../types';
|
|
3
|
+
interface CallResponseInterceptorsParams {
|
|
4
|
+
data: Data;
|
|
5
|
+
request: Request;
|
|
6
|
+
response: Response;
|
|
7
|
+
interceptors?: {
|
|
8
|
+
routeInterceptor?: InterceptorResponse | undefined;
|
|
9
|
+
requestInterceptor?: InterceptorResponse | undefined;
|
|
10
|
+
serverInterceptor?: InterceptorResponse | undefined;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export declare const callResponseInterceptors: (params: CallResponseInterceptorsParams) => Data;
|
|
14
|
+
export {};
|
|
@@ -1,31 +1,55 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.callResponseInterceptors = void 0;
|
|
4
|
-
const
|
|
5
|
-
const callResponseInterceptors = (params) => {
|
|
6
|
-
const { data, request, response, interceptors } = params;
|
|
7
|
-
const setDelay = async (delay) => {
|
|
8
|
-
await (0,
|
|
9
|
-
};
|
|
10
|
-
const setStatusCode = (statusCode) => {
|
|
11
|
-
response.statusCode = statusCode;
|
|
12
|
-
};
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.callResponseInterceptors = void 0;
|
|
4
|
+
const sleep_1 = require("../../sleep");
|
|
5
|
+
const callResponseInterceptors = (params) => {
|
|
6
|
+
const { data, request, response, interceptors } = params;
|
|
7
|
+
const setDelay = async (delay) => {
|
|
8
|
+
await (0, sleep_1.sleep)(delay === Infinity ? 100000 : delay);
|
|
9
|
+
};
|
|
10
|
+
const setStatusCode = (statusCode) => {
|
|
11
|
+
response.statusCode = statusCode;
|
|
12
|
+
};
|
|
13
|
+
const setHeader = (field, value) => {
|
|
14
|
+
response.header(field, value);
|
|
15
|
+
};
|
|
16
|
+
const appendHeader = (field, value) => {
|
|
17
|
+
response.append(field, value);
|
|
18
|
+
};
|
|
19
|
+
const setCookie = (name, value, options) => {
|
|
20
|
+
if (options) {
|
|
21
|
+
response.cookie(name, value, options);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
response.cookie(name, value);
|
|
25
|
+
};
|
|
26
|
+
const clearCookie = (name, options) => {
|
|
27
|
+
response.clearCookie(name, options);
|
|
28
|
+
};
|
|
29
|
+
const attachment = (filename) => {
|
|
30
|
+
response.attachment(filename);
|
|
31
|
+
};
|
|
32
|
+
const interceptorResponseParams = {
|
|
33
|
+
request,
|
|
34
|
+
response,
|
|
35
|
+
setDelay,
|
|
36
|
+
setStatusCode,
|
|
37
|
+
setHeader,
|
|
38
|
+
appendHeader,
|
|
39
|
+
setCookie,
|
|
40
|
+
clearCookie,
|
|
41
|
+
attachment
|
|
42
|
+
};
|
|
43
|
+
let updatedData = data;
|
|
44
|
+
if (interceptors?.routeInterceptor) {
|
|
45
|
+
updatedData = interceptors.routeInterceptor(updatedData, interceptorResponseParams);
|
|
46
|
+
}
|
|
47
|
+
if (interceptors?.requestInterceptor) {
|
|
48
|
+
updatedData = interceptors.requestInterceptor(updatedData, interceptorResponseParams);
|
|
49
|
+
}
|
|
50
|
+
if (interceptors?.serverInterceptor) {
|
|
51
|
+
updatedData = interceptors.serverInterceptor(updatedData, interceptorResponseParams);
|
|
52
|
+
}
|
|
53
|
+
return updatedData;
|
|
54
|
+
};
|
|
55
|
+
exports.callResponseInterceptors = callResponseInterceptors;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./callRequestInterceptors/callRequestInterceptors"), exports);
|
|
18
|
+
__exportStar(require("./callResponseInterceptors/callResponseInterceptors"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const isPlainObject: (value: any) => value is Record<string, unknown>;
|
|
1
|
+
export declare const isPlainObject: (value: any) => value is Record<string, unknown>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isPlainObject = void 0;
|
|
4
|
-
const isPlainObject = (value) => typeof value === 'object' && !Array.isArray(value) && value !== null;
|
|
5
|
-
exports.isPlainObject = isPlainObject;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isPlainObject = void 0;
|
|
4
|
+
const isPlainObject = (value) => typeof value === 'object' && !Array.isArray(value) && value !== null;
|
|
5
|
+
exports.isPlainObject = isPlainObject;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const sleep: (seconds: number) => Promise<unknown>;
|
|
1
|
+
export declare const sleep: (seconds: number) => Promise<unknown>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sleep = void 0;
|
|
4
|
-
const sleep = (seconds) => new Promise((resolve) => {
|
|
5
|
-
setTimeout(resolve, seconds * 1000);
|
|
6
|
-
});
|
|
7
|
-
exports.sleep = sleep;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sleep = void 0;
|
|
4
|
+
const sleep = (seconds) => new Promise((resolve) => {
|
|
5
|
+
setTimeout(resolve, seconds * 1000);
|
|
6
|
+
});
|
|
7
|
+
exports.sleep = sleep;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const convertWin32PathToUnix: (win32Path: string) => string;
|
|
1
|
+
export declare const convertWin32PathToUnix: (win32Path: string) => string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.convertWin32PathToUnix = void 0;
|
|
4
|
-
const convertWin32PathToUnix = (win32Path) => win32Path
|
|
5
|
-
.replace(/^\\\\\?\\/, '')
|
|
6
|
-
.replace(/\\/g, '/')
|
|
7
|
-
.replace(/\/\/+/g, '/');
|
|
8
|
-
exports.convertWin32PathToUnix = convertWin32PathToUnix;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertWin32PathToUnix = void 0;
|
|
4
|
+
const convertWin32PathToUnix = (win32Path) => win32Path
|
|
5
|
+
.replace(/^\\\\\?\\/, '')
|
|
6
|
+
.replace(/\\/g, '/')
|
|
7
|
+
.replace(/\/\/+/g, '/');
|
|
8
|
+
exports.convertWin32PathToUnix = convertWin32PathToUnix;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getUrlParts: (url: string) => string[];
|
|
1
|
+
export declare const getUrlParts: (url: string) => string[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getUrlParts = void 0;
|
|
4
|
-
const removeLeadingAndTrailingSlashes_1 = require("../removeLeadingAndTrailingSlashes/removeLeadingAndTrailingSlashes");
|
|
5
|
-
const getUrlParts = (url) => (0, removeLeadingAndTrailingSlashes_1.removeLeadingAndTrailingSlashes)(url).split('/');
|
|
6
|
-
exports.getUrlParts = getUrlParts;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getUrlParts = void 0;
|
|
4
|
+
const removeLeadingAndTrailingSlashes_1 = require("../removeLeadingAndTrailingSlashes/removeLeadingAndTrailingSlashes");
|
|
5
|
+
const getUrlParts = (url) => (0, removeLeadingAndTrailingSlashes_1.removeLeadingAndTrailingSlashes)(url).split('/');
|
|
6
|
+
exports.getUrlParts = getUrlParts;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './convertWin32PathToUnix/convertWin32PathToUnix';
|
|
2
|
-
export * from './getUrlParts/getUrlParts';
|
|
3
|
-
export * from './removeLeadingAndTrailingSlashes/removeLeadingAndTrailingSlashes';
|
|
4
|
-
export * from './urlJoin/urlJoin';
|
|
1
|
+
export * from './convertWin32PathToUnix/convertWin32PathToUnix';
|
|
2
|
+
export * from './getUrlParts/getUrlParts';
|
|
3
|
+
export * from './removeLeadingAndTrailingSlashes/removeLeadingAndTrailingSlashes';
|
|
4
|
+
export * from './urlJoin/urlJoin';
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./convertWin32PathToUnix/convertWin32PathToUnix"), exports);
|
|
18
|
-
__exportStar(require("./getUrlParts/getUrlParts"), exports);
|
|
19
|
-
__exportStar(require("./removeLeadingAndTrailingSlashes/removeLeadingAndTrailingSlashes"), exports);
|
|
20
|
-
__exportStar(require("./urlJoin/urlJoin"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./convertWin32PathToUnix/convertWin32PathToUnix"), exports);
|
|
18
|
+
__exportStar(require("./getUrlParts/getUrlParts"), exports);
|
|
19
|
+
__exportStar(require("./removeLeadingAndTrailingSlashes/removeLeadingAndTrailingSlashes"), exports);
|
|
20
|
+
__exportStar(require("./urlJoin/urlJoin"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const removeLeadingAndTrailingSlashes: (string: string) => string;
|
|
1
|
+
export declare const removeLeadingAndTrailingSlashes: (string: string) => string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.removeLeadingAndTrailingSlashes = void 0;
|
|
4
|
-
const removeLeadingAndTrailingSlashes = (string) => string.replace(/^\/+|\/+$/g, '');
|
|
5
|
-
exports.removeLeadingAndTrailingSlashes = removeLeadingAndTrailingSlashes;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.removeLeadingAndTrailingSlashes = void 0;
|
|
4
|
+
const removeLeadingAndTrailingSlashes = (string) => string.replace(/^\/+|\/+$/g, '');
|
|
5
|
+
exports.removeLeadingAndTrailingSlashes = removeLeadingAndTrailingSlashes;
|