@data7expressions/json-light 5.0.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/CHANGELOG.md +71 -0
- package/LICENSE +21 -0
- package/README.md +262 -0
- package/__tests__/country.test.d.ts +2 -0
- package/__tests__/country.test.d.ts.map +1 -0
- package/__tests__/country.test.js +62 -0
- package/__tests__/country.test.js.map +1 -0
- package/__tests__/order.test.d.ts +2 -0
- package/__tests__/order.test.d.ts.map +1 -0
- package/__tests__/order.test.js +84 -0
- package/__tests__/order.test.js.map +1 -0
- package/application/facade.d.ts +13 -0
- package/application/facade.d.ts.map +1 -0
- package/application/facade.js +26 -0
- package/application/facade.js.map +1 -0
- package/application/index.d.ts +6 -0
- package/application/index.d.ts.map +1 -0
- package/application/index.js +22 -0
- package/application/index.js.map +1 -0
- package/application/services/jsonLightService.d.ts +5 -0
- package/application/services/jsonLightService.d.ts.map +1 -0
- package/application/services/jsonLightService.js +31 -0
- package/application/services/jsonLightService.js.map +1 -0
- package/application/useCases/compress.d.ts +9 -0
- package/application/useCases/compress.d.ts.map +1 -0
- package/application/useCases/compress.js +106 -0
- package/application/useCases/compress.js.map +1 -0
- package/application/useCases/decompress.d.ts +9 -0
- package/application/useCases/decompress.d.ts.map +1 -0
- package/application/useCases/decompress.js +102 -0
- package/application/useCases/decompress.js.map +1 -0
- package/application/useCases/getType.d.ts +5 -0
- package/application/useCases/getType.d.ts.map +1 -0
- package/application/useCases/getType.js +12 -0
- package/application/useCases/getType.js.map +1 -0
- package/domain/index.d.ts +2 -0
- package/domain/index.d.ts.map +1 -0
- package/domain/index.js +18 -0
- package/domain/index.js.map +1 -0
- package/domain/services.d.ts +22 -0
- package/domain/services.d.ts.map +1 -0
- package/domain/services.js +3 -0
- package/domain/services.js.map +1 -0
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -0
- package/index.js +18 -0
- package/index.js.map +1 -0
- package/infrastructure/builder.d.ts +5 -0
- package/infrastructure/builder.d.ts.map +1 -0
- package/infrastructure/builder.js +12 -0
- package/infrastructure/builder.js.map +1 -0
- package/infrastructure/cli/json-light.d.ts +5 -0
- package/infrastructure/cli/json-light.d.ts.map +1 -0
- package/infrastructure/cli/json-light.js +27 -0
- package/infrastructure/cli/json-light.js.map +1 -0
- package/infrastructure/commands/compress.d.ts +2 -0
- package/infrastructure/commands/compress.d.ts.map +1 -0
- package/infrastructure/commands/compress.js +40 -0
- package/infrastructure/commands/compress.js.map +1 -0
- package/infrastructure/commands/decompress.d.ts +2 -0
- package/infrastructure/commands/decompress.d.ts.map +1 -0
- package/infrastructure/commands/decompress.js +39 -0
- package/infrastructure/commands/decompress.js.map +1 -0
- package/infrastructure/commands/help.d.ts +2 -0
- package/infrastructure/commands/help.d.ts.map +1 -0
- package/infrastructure/commands/help.js +38 -0
- package/infrastructure/commands/help.js.map +1 -0
- package/infrastructure/commands/schema.d.ts +2 -0
- package/infrastructure/commands/schema.d.ts.map +1 -0
- package/infrastructure/commands/schema.js +37 -0
- package/infrastructure/commands/schema.js.map +1 -0
- package/infrastructure/commands/version.d.ts +2 -0
- package/infrastructure/commands/version.d.ts.map +1 -0
- package/infrastructure/commands/version.js +6 -0
- package/infrastructure/commands/version.js.map +1 -0
- package/infrastructure/helper.d.ts +5 -0
- package/infrastructure/helper.d.ts.map +1 -0
- package/infrastructure/helper.js +9 -0
- package/infrastructure/helper.js.map +1 -0
- package/infrastructure/index.d.ts +2 -0
- package/infrastructure/index.d.ts.map +1 -0
- package/infrastructure/index.js +6 -0
- package/infrastructure/index.js.map +1 -0
- package/jest-unit-config.json +15 -0
- package/package.json +36 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const index_1 = require("../index");
|
|
13
|
+
const helper_1 = require("../helper");
|
|
14
|
+
module.exports = (args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
+
const input = args.input || args.i;
|
|
16
|
+
const output = args.output || args.o;
|
|
17
|
+
if (!input) {
|
|
18
|
+
console.error('input is required!');
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
let data = index_1.JsonLight.json(input);
|
|
22
|
+
if (data === null) {
|
|
23
|
+
const str = yield helper_1.jsonLightHelp.fs.read(input);
|
|
24
|
+
if (str === null) {
|
|
25
|
+
throw new Error(`File ${input} not found`);
|
|
26
|
+
}
|
|
27
|
+
data = JSON.parse(str);
|
|
28
|
+
}
|
|
29
|
+
const type = index_1.JsonLight.type(data);
|
|
30
|
+
if (output) {
|
|
31
|
+
yield helper_1.jsonLightHelp.fs.write(output, type);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
console.log(type);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/lib/infrastructure/commands/schema.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,oCAAoC;AACpC,sCAAyC;AACzC,MAAM,CAAC,OAAO,GAAG,CAAO,IAAQ,EAAE,EAAE;IACnC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAA;IAClC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAA;IACpC,IAAI,CAAC,KAAK,EAAE,CAAC;QACZ,OAAO,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAA;QACnC,OAAM;IACP,CAAC;IAED,IAAI,IAAI,GAAG,iBAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAChC,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QACnB,MAAM,GAAG,GAAG,MAAM,sBAAa,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAC9C,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CAAC,QAAQ,KAAK,YAAY,CAAC,CAAA;QAC3C,CAAC;QACD,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACvB,CAAC;IAED,MAAM,IAAI,GAAG,iBAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACjC,IAAI,MAAM,EAAE,CAAC;QACZ,MAAM,sBAAa,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;IAC3C,CAAC;SAAM,CAAC;QACP,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IAClB,CAAC;AACF,CAAC,CAAA,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../../src/lib/infrastructure/commands/version.ts"],"names":[],"mappings":"AAAA,QAAA,MAAQ,OAAO,KAAkC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../../src/lib/infrastructure/commands/version.ts"],"names":[],"mappings":";AAAA,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AACjD,MAAM,CAAC,OAAO,GAAG,GAAG,EAAE;IACrB,OAAO,CAAC,GAAG,CAAC,IAAI,OAAO,EAAE,CAAC,CAAA;AAC3B,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../src/lib/infrastructure/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAY,MAAM,yBAAyB,CAAA;AAC5D,qBAAa,aAAc,SAAQ,QAAQ;CAAI;AAC/C,eAAO,MAAM,aAAa,eAA8B,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.jsonLightHelp = exports.JsonLightHelp = void 0;
|
|
4
|
+
const typ3s_1 = require("@data7expressions/typ3s");
|
|
5
|
+
class JsonLightHelp extends typ3s_1.TypeH3lp {
|
|
6
|
+
}
|
|
7
|
+
exports.JsonLightHelp = JsonLightHelp;
|
|
8
|
+
exports.jsonLightHelp = new JsonLightHelp(typ3s_1.typeH3lp);
|
|
9
|
+
//# sourceMappingURL=helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../src/lib/infrastructure/helper.ts"],"names":[],"mappings":";;;AAAA,mDAA4D;AAC5D,MAAa,aAAc,SAAQ,gBAAQ;CAAI;AAA/C,sCAA+C;AAClC,QAAA,aAAa,GAAG,IAAI,aAAa,CAAC,gBAAQ,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/infrastructure/index.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,SAAS,+BAAiC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/infrastructure/index.ts"],"names":[],"mappings":";;;AAAA,uCAA4C;AAC/B,QAAA,SAAS,GAAG,IAAI,0BAAgB,EAAE,CAAC,KAAK,EAAE,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@data7expressions/json-light",
|
|
3
|
+
"version": "5.0.0",
|
|
4
|
+
"description": "Allow to extend yaml or json files configuration",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"test": "npx jest --config jest-unit-config.json"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/data7expressions/json-light.git"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"json",
|
|
14
|
+
"light",
|
|
15
|
+
"serialized",
|
|
16
|
+
"schema",
|
|
17
|
+
"deserializer",
|
|
18
|
+
"parse",
|
|
19
|
+
"stringify"
|
|
20
|
+
],
|
|
21
|
+
"author": "Flavio Lionel Rita <flaviolrita@hotmail.com>",
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/data7expressions/json-light/issues"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://github.com/data7expressions/json-light#readme",
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
},
|
|
30
|
+
"main": "index.js",
|
|
31
|
+
"types": "index.d.ts",
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"minimist": "^1.2.6",
|
|
34
|
+
"@data7expressions/typ3s": "^5.0.0"
|
|
35
|
+
}
|
|
36
|
+
}
|