@crowdin/app-project-module 0.26.0 → 0.26.2
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/out/index.d.ts +1 -1
- package/out/index.js +2 -1
- package/out/util/index.js +1 -1
- package/package.json +1 -1
package/out/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Express } from 'express';
|
|
2
2
|
import { Config, CrowdinAppUtilities } from './models';
|
|
3
3
|
export { Scope } from './models';
|
|
4
|
-
export declare function addCrowdinEndpoints(app: Express,
|
|
4
|
+
export declare function addCrowdinEndpoints(app: Express, plainConfig: Config): CrowdinAppUtilities;
|
|
5
5
|
export declare function createApp(config: Config): void;
|
package/out/index.js
CHANGED
|
@@ -68,7 +68,8 @@ const cron_1 = require("./util/cron");
|
|
|
68
68
|
const defaults_1 = require("./util/defaults");
|
|
69
69
|
var models_1 = require("./models");
|
|
70
70
|
Object.defineProperty(exports, "Scope", { enumerable: true, get: function () { return models_1.Scope; } });
|
|
71
|
-
function addCrowdinEndpoints(app,
|
|
71
|
+
function addCrowdinEndpoints(app, plainConfig) {
|
|
72
|
+
const config = Object.assign(Object.assign({}, plainConfig), { baseUrl: plainConfig.baseUrl.endsWith('/') ? plainConfig.baseUrl.slice(0, -1) : plainConfig.baseUrl });
|
|
72
73
|
storage.initialize(config);
|
|
73
74
|
app.use(express_1.default.json({ limit: '50mb' }));
|
|
74
75
|
app.use('/assets', express_1.default.static((0, path_1.join)(__dirname, 'static')));
|
package/out/util/index.js
CHANGED
|
@@ -122,6 +122,6 @@ function executeWithRetry(func, numOfRetries = 2) {
|
|
|
122
122
|
exports.executeWithRetry = executeWithRetry;
|
|
123
123
|
function isExtendedResultType(data) {
|
|
124
124
|
const dataTyped = data;
|
|
125
|
-
return !Array.isArray(dataTyped);
|
|
125
|
+
return !!dataTyped && !Array.isArray(dataTyped);
|
|
126
126
|
}
|
|
127
127
|
exports.isExtendedResultType = isExtendedResultType;
|
package/package.json
CHANGED