@prosopo/locale 3.1.2 → 3.1.21
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/CHANGELOG.md +137 -0
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/clover.xml +260 -0
- package/coverage/coverage-final.json +11 -0
- package/coverage/favicon.png +0 -0
- package/coverage/i18SharedOptions.ts.html +151 -0
- package/coverage/i18nBackend.ts.html +244 -0
- package/coverage/i18nFrontend.ts.html +328 -0
- package/coverage/i18nMiddleware.ts.html +160 -0
- package/coverage/index.html +251 -0
- package/coverage/index.ts.html +151 -0
- package/coverage/loadI18next.ts.html +232 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +210 -0
- package/coverage/translationKey.ts.html +229 -0
- package/coverage/translations.ts.html +247 -0
- package/coverage/useTranslation.ts.html +181 -0
- package/coverage/util.ts.html +160 -0
- package/dist/cjs/i18nBackend.cjs +2 -1
- package/dist/cjs/locales/en/translation.json.cjs +1 -1
- package/dist/i18SharedOptions.js +8 -10
- package/dist/i18SharedOptions.js.map +1 -0
- package/dist/i18nBackend.js +24 -26
- package/dist/i18nBackend.js.map +1 -0
- package/dist/i18nFrontend.js +43 -47
- package/dist/i18nFrontend.js.map +1 -0
- package/dist/i18nMiddleware.js +4 -5
- package/dist/i18nMiddleware.js.map +1 -0
- package/dist/index.js +7 -15
- package/dist/index.js.map +1 -0
- package/dist/loadI18next.js +29 -26
- package/dist/loadI18next.js.map +1 -0
- package/dist/locales/ar/translation.json +441 -440
- package/dist/locales/az/translation.json +441 -440
- package/dist/locales/cs/translation.json +441 -440
- package/dist/locales/de/translation.json +441 -440
- package/dist/locales/el/translation.json +441 -440
- package/dist/locales/en/translation.json +441 -440
- package/dist/locales/en/translation.json.js +1 -1
- package/dist/locales/es/translation.json +441 -440
- package/dist/locales/fi/translation.json +441 -440
- package/dist/locales/fr/translation.json +441 -440
- package/dist/locales/hi/translation.json +441 -440
- package/dist/locales/hu/translation.json +441 -440
- package/dist/locales/id/translation.json +441 -440
- package/dist/locales/it/translation.json +441 -440
- package/dist/locales/ja/translation.json +441 -440
- package/dist/locales/jv/translation.json +441 -440
- package/dist/locales/ko/translation.json +441 -440
- package/dist/locales/ml/translation.json +441 -440
- package/dist/locales/ms/translation.json +441 -440
- package/dist/locales/nl/translation.json +441 -440
- package/dist/locales/no/translation.json +441 -440
- package/dist/locales/pl/translation.json +441 -440
- package/dist/locales/pt/translation.json +441 -440
- package/dist/locales/pt-BR/translation.json +441 -440
- package/dist/locales/ro/translation.json +441 -440
- package/dist/locales/ru/translation.json +441 -440
- package/dist/locales/sr/translation.json +441 -440
- package/dist/locales/sv/translation.json +441 -440
- package/dist/locales/th/translation.json +441 -440
- package/dist/locales/tr/translation.json +441 -440
- package/dist/locales/uk/translation.json +441 -440
- package/dist/locales/vi/translation.json +441 -440
- package/dist/locales/zh-CN/translation.json +441 -440
- package/dist/tests/locales.unit.test.js +49 -0
- package/dist/tests/locales.unit.test.js.map +1 -0
- package/dist/translationKey.d.ts.map +1 -1
- package/dist/translationKey.js +15 -21
- package/dist/translationKey.js.map +1 -0
- package/dist/translations.js +35 -40
- package/dist/translations.js.map +1 -0
- package/dist/useTranslation.js +6 -7
- package/dist/useTranslation.js.map +1 -0
- package/dist/util.js +7 -8
- package/dist/util.js.map +1 -0
- package/package.json +11 -14
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { describe, expect, test } from "vitest";
|
|
4
|
+
import { Languages } from "../index.js";
|
|
5
|
+
describe("logging", () => {
|
|
6
|
+
test("Make sure the number of files present in the locales folder is the same size as the Languages array", () => {
|
|
7
|
+
const locales = fs.readdirSync(path.resolve("./src/locales"));
|
|
8
|
+
expect(locales.length).to.equal(Object.keys(Languages).length);
|
|
9
|
+
});
|
|
10
|
+
test("Get all locale JSON files and ensure the keys are identical in each one", () => {
|
|
11
|
+
const locales = Object.values(Languages);
|
|
12
|
+
const sectionKeys = new Set();
|
|
13
|
+
console.log("Local test running at ", path.resolve("."));
|
|
14
|
+
const sectionKeysObj = {};
|
|
15
|
+
const innerKeysObj = {};
|
|
16
|
+
for (const locale of locales) {
|
|
17
|
+
const localeData = fs.readFileSync(path.resolve(`./src/locales/${locale}/translation.json`), "utf8");
|
|
18
|
+
const localeKeys = Object.keys(JSON.parse(localeData));
|
|
19
|
+
for (const sectionKey of localeKeys) {
|
|
20
|
+
sectionKeys.add(sectionKey);
|
|
21
|
+
}
|
|
22
|
+
sectionKeysObj[locale] = new Set(localeKeys);
|
|
23
|
+
for (const sectionKey of localeKeys) {
|
|
24
|
+
const innerKeys = JSON.parse(localeData)[sectionKey];
|
|
25
|
+
if (typeof innerKeys !== "object") {
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
if (!innerKeysObj[locale]) {
|
|
29
|
+
innerKeysObj[locale] = {};
|
|
30
|
+
}
|
|
31
|
+
if (!innerKeysObj[locale][sectionKey]) {
|
|
32
|
+
innerKeysObj[locale][sectionKey] = new Set();
|
|
33
|
+
}
|
|
34
|
+
for (const innerKey of Object.keys(innerKeys)) {
|
|
35
|
+
innerKeysObj[locale][sectionKey].add(innerKey);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
for (const locale of Array.from(locales)) {
|
|
40
|
+
console.log("Checking", locale);
|
|
41
|
+
expect(sectionKeysObj[locale]).to.deep.equal(sectionKeysObj.en);
|
|
42
|
+
for (const sectionKey of Object.keys(innerKeysObj[locale])) {
|
|
43
|
+
console.log(`Checking ${locale} ${sectionKey}`);
|
|
44
|
+
expect(innerKeysObj[locale][sectionKey]).to.deep.equal(innerKeysObj.en[sectionKey]);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=locales.unit.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AM,CAAC,CAAC,EAAE,CAAC;gBAC5D,OAAO,CAAC,GAAG,CAAC,YAAY,MAAM,IAAI,UAAU,EAAE,CAAC,CAAC;gBAEhD,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAErD,YAAY,CAAC,EAAE,CAAC,UAAU,CAAC,CAC3B,CAAC;YACH,CAAC;QACF,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translationKey.d.ts","sourceRoot":"","sources":["../src/translationKey.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"translationKey.d.ts","sourceRoot":"","sources":["../src/translationKey.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA6BxB,eAAO,MAAM,qBAAqB,kCAEjC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
package/dist/translationKey.js
CHANGED
|
@@ -1,25 +1,19 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import translationEn from "./locales/en/translation.json
|
|
2
|
+
import translationEn from "./locales/en/translation.json" with { type: "json" };
|
|
3
3
|
function getLeafFieldPath(obj) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
return Object.keys(obj).reduce((arr, key) => {
|
|
8
|
-
const value = obj[key];
|
|
9
|
-
if (value === void 0) {
|
|
10
|
-
throw new Error(`Undefined value for key ${key}`);
|
|
4
|
+
if (typeof obj === "string") {
|
|
5
|
+
return [];
|
|
11
6
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
return Object.keys(obj).reduce((arr, key) => {
|
|
8
|
+
const value = obj[key];
|
|
9
|
+
if (value === undefined) {
|
|
10
|
+
throw new Error(`Undefined value for key ${key}`);
|
|
11
|
+
}
|
|
12
|
+
const children = getLeafFieldPath(value);
|
|
13
|
+
return arr.concat(children.map((child) => {
|
|
14
|
+
return `${key}.${child}`;
|
|
15
|
+
}));
|
|
16
|
+
}, []);
|
|
19
17
|
}
|
|
20
|
-
const TranslationKeysSchema = z.enum(
|
|
21
|
-
|
|
22
|
-
);
|
|
23
|
-
export {
|
|
24
|
-
TranslationKeysSchema
|
|
25
|
-
};
|
|
18
|
+
export const TranslationKeysSchema = z.enum(getLeafFieldPath(translationEn));
|
|
19
|
+
//# sourceMappingURL=translationKey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translationKey.js","sourceRoot":"","sources":["../src/translationKey.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,aAAa,MAAM,+BAA+B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAQhF,SAAS,gBAAgB,CAAC,GAAS;IAClC,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,EAAE,CAAC;IACX,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QAC3C,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;QACvB,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,2BAA2B,GAAG,EAAE,CAAC,CAAC;QACnD,CAAC;QACD,MAAM,QAAQ,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAEzC,OAAO,GAAG,CAAC,MAAM,CAChB,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACtB,OAAO,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC;QAC1B,CAAC,CAAC,CACF,CAAC;IACH,CAAC,EAAE,EAAc,CAAC,CAAC;AACpB,CAAC;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAC1C,gBAAgB,CAAC,aAAa,CAA0B,CACxD,CAAC"}
|
package/dist/translations.js
CHANGED
|
@@ -1,42 +1,37 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
|
-
const Languages = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
36
|
-
const LanguageSchema = z.enum(
|
|
37
|
-
Object.values(Languages)
|
|
38
|
-
);
|
|
39
|
-
export {
|
|
40
|
-
LanguageSchema,
|
|
41
|
-
Languages
|
|
2
|
+
export const Languages = {
|
|
3
|
+
arabic: "ar",
|
|
4
|
+
azerbaijani: "az",
|
|
5
|
+
czech: "cs",
|
|
6
|
+
german: "de",
|
|
7
|
+
greek: "el",
|
|
8
|
+
english: "en",
|
|
9
|
+
spanish: "es",
|
|
10
|
+
finnish: "fi",
|
|
11
|
+
french: "fr",
|
|
12
|
+
hindi: "hi",
|
|
13
|
+
hungarian: "hu",
|
|
14
|
+
indonesian: "id",
|
|
15
|
+
italian: "it",
|
|
16
|
+
japanese: "ja",
|
|
17
|
+
javanese: "jv",
|
|
18
|
+
korean: "ko",
|
|
19
|
+
malayalam: "ml",
|
|
20
|
+
malay: "ms",
|
|
21
|
+
dutch: "nl",
|
|
22
|
+
norwegian: "no",
|
|
23
|
+
polish: "pl",
|
|
24
|
+
portugeseBrazil: "pt-BR",
|
|
25
|
+
portuguese: "pt",
|
|
26
|
+
romanian: "ro",
|
|
27
|
+
russian: "ru",
|
|
28
|
+
serbian: "sr",
|
|
29
|
+
swedish: "sv",
|
|
30
|
+
thai: "th",
|
|
31
|
+
turkish: "tr",
|
|
32
|
+
ukrainian: "uk",
|
|
33
|
+
vietnamese: "vi",
|
|
34
|
+
chinese: "zh-CN",
|
|
42
35
|
};
|
|
36
|
+
export const LanguageSchema = z.enum(Object.values(Languages));
|
|
37
|
+
//# sourceMappingURL=translations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translations.js","sourceRoot":"","sources":["../src/translations.ts"],"names":[],"mappings":"AAcA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,MAAM,CAAC,MAAM,SAAS,GAAG;IACxB,MAAM,EAAE,IAAI;IACZ,WAAW,EAAE,IAAI;IACjB,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;IACZ,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,IAAI;IACb,MAAM,EAAE,IAAI;IACZ,KAAK,EAAE,IAAI;IACX,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,IAAI;IACd,MAAM,EAAE,IAAI;IACZ,SAAS,EAAE,IAAI;IACf,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;IACX,SAAS,EAAE,IAAI;IACf,MAAM,EAAE,IAAI;IACZ,eAAe,EAAE,OAAO;IACxB,UAAU,EAAE,IAAI;IAChB,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,IAAI;IACb,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,IAAI;IACb,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE,OAAO;CACP,CAAC;AAEX,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CACnC,MAAM,CAAC,MAAM,CAAC,SAAS,CAA0B,CACjD,CAAC"}
|
package/dist/useTranslation.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { useTranslation as
|
|
2
|
-
import
|
|
1
|
+
import { useTranslation as useTranslationDefault, } from "react-i18next";
|
|
2
|
+
import initializeI18n from "./i18nFrontend.js";
|
|
3
3
|
function useTranslation(options) {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const i18n = initializeI18n();
|
|
5
|
+
return useTranslationDefault("translation", { i18n, ...options });
|
|
6
6
|
}
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
};
|
|
7
|
+
export default useTranslation;
|
|
8
|
+
//# sourceMappingURL=useTranslation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTranslation.js","sourceRoot":"","sources":["../src/useTranslation.ts"],"names":[],"mappings":"AAcA,OAAO,EAGN,cAAc,IAAI,qBAAqB,GACvC,MAAM,eAAe,CAAC;AACvB,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAE/C,SAAS,cAAc,CACtB,OAA8C;IAK9C,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;IAC9B,OAAO,qBAAqB,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;AACnE,CAAC;AAED,eAAe,cAAc,CAAC"}
|
package/dist/util.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
const isClientSide = () => {
|
|
2
|
-
|
|
1
|
+
export const isClientSide = () => {
|
|
2
|
+
return !!(typeof window !== "undefined" &&
|
|
3
|
+
window.document &&
|
|
4
|
+
window.document.createElement);
|
|
3
5
|
};
|
|
4
|
-
const isServerSide = () => {
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
export {
|
|
8
|
-
isClientSide,
|
|
9
|
-
isServerSide
|
|
6
|
+
export const isServerSide = () => {
|
|
7
|
+
return !isClientSide();
|
|
10
8
|
};
|
|
9
|
+
//# sourceMappingURL=util.js.map
|
package/dist/util.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAcA,MAAM,CAAC,MAAM,YAAY,GAAG,GAAY,EAAE;IACzC,OAAO,CAAC,CAAC,CACR,OAAO,MAAM,KAAK,WAAW;QAC7B,MAAM,CAAC,QAAQ;QACf,MAAM,CAAC,QAAQ,CAAC,aAAa,CAC7B,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,GAAY,EAAE;IACzC,OAAO,CAAC,YAAY,EAAE,CAAC;AACxB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosopo/locale",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.21",
|
|
4
4
|
"description": "Prosopo locale library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
7
|
-
"node": "
|
|
8
|
-
"npm": "10.
|
|
7
|
+
"node": ">=v20.0.0",
|
|
8
|
+
"npm": ">=10.6.0"
|
|
9
9
|
},
|
|
10
10
|
"main": "dist/index.js",
|
|
11
11
|
"types": "dist/index.d.ts",
|
|
@@ -25,15 +25,13 @@
|
|
|
25
25
|
"build": "NODE_ENV=${NODE_ENV:-development}; vite build --config vite.esm.config.ts --mode $NODE_ENV",
|
|
26
26
|
"build:tsc": "tsc --build --verbose",
|
|
27
27
|
"build:cjs": "NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV",
|
|
28
|
-
"typecheck": "tsc --
|
|
28
|
+
"typecheck": "tsc --project tsconfig.types.json",
|
|
29
29
|
"test": "NODE_ENV=${NODE_ENV:-test}; npx vitest run --config ./vite.test.config.ts"
|
|
30
30
|
},
|
|
31
31
|
"author": "Prosopo Limited",
|
|
32
32
|
"license": "Apache-2.0",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@
|
|
35
|
-
"axios": "1.10.0",
|
|
36
|
-
"esbuild": "0.25.6",
|
|
34
|
+
"@prosopo/config": "3.1.21",
|
|
37
35
|
"i18next": "24.2.2",
|
|
38
36
|
"i18next-browser-languagedetector": "8.0.2",
|
|
39
37
|
"i18next-chained-backend": "4.6.2",
|
|
@@ -41,22 +39,21 @@
|
|
|
41
39
|
"i18next-http-backend": "3.0.2",
|
|
42
40
|
"i18next-http-middleware": "3.7.4",
|
|
43
41
|
"i18next-resources-to-backend": "1.2.1",
|
|
44
|
-
"openpgp": "5.11.3",
|
|
45
42
|
"react-i18next": "15.4.0",
|
|
46
|
-
"zod": "3.23.8"
|
|
47
|
-
"@prosopo/config": "3.1.3",
|
|
48
|
-
"webpack-dev-server": "5.2.2"
|
|
43
|
+
"zod": "3.23.8"
|
|
49
44
|
},
|
|
50
45
|
"devDependencies": {
|
|
51
|
-
"@
|
|
46
|
+
"@types/node": "22.10.2",
|
|
47
|
+
"@vitest/coverage-v8": "3.2.4",
|
|
48
|
+
"concurrently": "9.0.1",
|
|
52
49
|
"del-cli": "6.0.0",
|
|
53
50
|
"dotenv": "16.4.5",
|
|
54
51
|
"npm-run-all": "4.1.5",
|
|
55
52
|
"tslib": "2.7.0",
|
|
56
53
|
"tsx": "4.20.3",
|
|
57
54
|
"typescript": "5.6.2",
|
|
58
|
-
"vite": "6.
|
|
59
|
-
"vitest": "3.
|
|
55
|
+
"vite": "6.4.1",
|
|
56
|
+
"vitest": "3.2.4"
|
|
60
57
|
},
|
|
61
58
|
"repository": {
|
|
62
59
|
"type": "git",
|