quicktype 18.0.6 → 19.0.4
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/README.md +1 -1
- package/dist/{cli/CompressedJSONFromStream.d.ts → CompressedJSONFromStream.d.ts} +1 -1
- package/dist/{cli/CompressedJSONFromStream.js → CompressedJSONFromStream.js} +2 -2
- package/dist/{cli/GraphQLIntrospection.d.ts → GraphQLIntrospection.d.ts} +0 -0
- package/dist/{cli/GraphQLIntrospection.js → GraphQLIntrospection.js} +1 -1
- package/dist/{cli/TypeSource.d.ts → TypeSource.d.ts} +2 -2
- package/dist/{cli/TypeSource.js → TypeSource.js} +0 -0
- package/dist/{cli/URLGrammar.d.ts → URLGrammar.d.ts} +0 -0
- package/dist/{cli/URLGrammar.js → URLGrammar.js} +1 -1
- package/dist/{cli/index.d.ts → index.d.ts} +1 -1
- package/dist/{cli/index.js → index.js} +4 -5
- package/package.json +61 -77
- package/dist/quicktype-core/Annotation.d.ts +0 -8
- package/dist/quicktype-core/Annotation.js +0 -16
- package/dist/quicktype-core/ConvenienceRenderer.d.ts +0 -138
- package/dist/quicktype-core/ConvenienceRenderer.js +0 -668
- package/dist/quicktype-core/DateTime.d.ts +0 -10
- package/dist/quicktype-core/DateTime.js +0 -57
- package/dist/quicktype-core/DeclarationIR.d.ts +0 -14
- package/dist/quicktype-core/DeclarationIR.js +0 -167
- package/dist/quicktype-core/EncodedMarkovChain.d.ts +0 -1
- package/dist/quicktype-core/EncodedMarkovChain.js +0 -4
- package/dist/quicktype-core/GatherNames.d.ts +0 -2
- package/dist/quicktype-core/GatherNames.js +0 -333
- package/dist/quicktype-core/Graph.d.ts +0 -12
- package/dist/quicktype-core/Graph.js +0 -220
- package/dist/quicktype-core/GraphRewriting.d.ts +0 -87
- package/dist/quicktype-core/GraphRewriting.js +0 -421
- package/dist/quicktype-core/MakeTransformations.d.ts +0 -4
- package/dist/quicktype-core/MakeTransformations.js +0 -193
- package/dist/quicktype-core/MarkovChain.d.ts +0 -15
- package/dist/quicktype-core/MarkovChain.js +0 -154
- package/dist/quicktype-core/Messages.d.ts +0 -294
- package/dist/quicktype-core/Messages.js +0 -105
- package/dist/quicktype-core/Naming.d.ts +0 -64
- package/dist/quicktype-core/Naming.js +0 -356
- package/dist/quicktype-core/Renderer.d.ts +0 -50
- package/dist/quicktype-core/Renderer.js +0 -274
- package/dist/quicktype-core/RendererOptions.d.ts +0 -71
- package/dist/quicktype-core/RendererOptions.js +0 -141
- package/dist/quicktype-core/Run.d.ts +0 -174
- package/dist/quicktype-core/Run.js +0 -393
- package/dist/quicktype-core/Source.d.ts +0 -65
- package/dist/quicktype-core/Source.js +0 -204
- package/dist/quicktype-core/TargetLanguage.d.ts +0 -34
- package/dist/quicktype-core/TargetLanguage.js +0 -66
- package/dist/quicktype-core/Transformers.d.ts +0 -209
- package/dist/quicktype-core/Transformers.js +0 -836
- package/dist/quicktype-core/Type.d.ts +0 -206
- package/dist/quicktype-core/Type.js +0 -716
- package/dist/quicktype-core/TypeBuilder.d.ts +0 -61
- package/dist/quicktype-core/TypeBuilder.js +0 -324
- package/dist/quicktype-core/TypeGraph.d.ts +0 -75
- package/dist/quicktype-core/TypeGraph.js +0 -420
- package/dist/quicktype-core/TypeUtils.d.ts +0 -33
- package/dist/quicktype-core/TypeUtils.js +0 -230
- package/dist/quicktype-core/UnifyClasses.d.ts +0 -16
- package/dist/quicktype-core/UnifyClasses.js +0 -159
- package/dist/quicktype-core/UnionBuilder.d.ts +0 -49
- package/dist/quicktype-core/UnionBuilder.js +0 -282
- package/dist/quicktype-core/attributes/AccessorNames.d.ts +0 -18
- package/dist/quicktype-core/attributes/AccessorNames.js +0 -182
- package/dist/quicktype-core/attributes/Constraints.d.ts +0 -38
- package/dist/quicktype-core/attributes/Constraints.js +0 -172
- package/dist/quicktype-core/attributes/Description.d.ts +0 -9
- package/dist/quicktype-core/attributes/Description.js +0 -97
- package/dist/quicktype-core/attributes/EnumValues.d.ts +0 -8
- package/dist/quicktype-core/attributes/EnumValues.js +0 -31
- package/dist/quicktype-core/attributes/StringTypes.d.ts +0 -28
- package/dist/quicktype-core/attributes/StringTypes.js +0 -189
- package/dist/quicktype-core/attributes/TypeAttributes.d.ts +0 -34
- package/dist/quicktype-core/attributes/TypeAttributes.js +0 -119
- package/dist/quicktype-core/attributes/TypeNames.d.ts +0 -46
- package/dist/quicktype-core/attributes/TypeNames.js +0 -274
- package/dist/quicktype-core/attributes/URIAttributes.d.ts +0 -8
- package/dist/quicktype-core/attributes/URIAttributes.js +0 -85
- package/dist/quicktype-core/index.d.ts +0 -48
- package/dist/quicktype-core/index.js +0 -180
- package/dist/quicktype-core/input/CompressedJSON.d.ts +0 -69
- package/dist/quicktype-core/input/CompressedJSON.js +0 -276
- package/dist/quicktype-core/input/FetchingJSONSchemaStore.d.ts +0 -6
- package/dist/quicktype-core/input/FetchingJSONSchemaStore.js +0 -18
- package/dist/quicktype-core/input/Inference.d.ts +0 -22
- package/dist/quicktype-core/input/Inference.js +0 -240
- package/dist/quicktype-core/input/Inputs.d.ts +0 -48
- package/dist/quicktype-core/input/Inputs.js +0 -145
- package/dist/quicktype-core/input/JSONSchemaInput.d.ts +0 -91
- package/dist/quicktype-core/input/JSONSchemaInput.js +0 -1041
- package/dist/quicktype-core/input/JSONSchemaStore.d.ts +0 -8
- package/dist/quicktype-core/input/JSONSchemaStore.js +0 -36
- package/dist/quicktype-core/input/PostmanCollection.d.ts +0 -5
- package/dist/quicktype-core/input/PostmanCollection.js +0 -60
- package/dist/quicktype-core/input/io/NodeIO.d.ts +0 -3
- package/dist/quicktype-core/input/io/NodeIO.js +0 -87
- package/dist/quicktype-core/input/io/get-stream/buffer-stream.d.ts +0 -2
- package/dist/quicktype-core/input/io/get-stream/buffer-stream.js +0 -45
- package/dist/quicktype-core/input/io/get-stream/index.d.ts +0 -9
- package/dist/quicktype-core/input/io/get-stream/index.js +0 -52
- package/dist/quicktype-core/language/All.d.ts +0 -3
- package/dist/quicktype-core/language/All.js +0 -57
- package/dist/quicktype-core/language/CPlusPlus.d.ts +0 -241
- package/dist/quicktype-core/language/CPlusPlus.js +0 -1847
- package/dist/quicktype-core/language/CSharp.d.ts +0 -201
- package/dist/quicktype-core/language/CSharp.js +0 -1850
- package/dist/quicktype-core/language/Crystal.d.ts +0 -37
- package/dist/quicktype-core/language/Crystal.js +0 -337
- package/dist/quicktype-core/language/Dart.d.ts +0 -66
- package/dist/quicktype-core/language/Dart.js +0 -576
- package/dist/quicktype-core/language/Elm.d.ts +0 -58
- package/dist/quicktype-core/language/Elm.js +0 -522
- package/dist/quicktype-core/language/Golang.d.ts +0 -51
- package/dist/quicktype-core/language/Golang.js +0 -460
- package/dist/quicktype-core/language/Haskell.d.ts +0 -56
- package/dist/quicktype-core/language/Haskell.js +0 -411
- package/dist/quicktype-core/language/JSONSchema.d.ts +0 -31
- package/dist/quicktype-core/language/JSONSchema.js +0 -169
- package/dist/quicktype-core/language/Java.d.ts +0 -125
- package/dist/quicktype-core/language/Java.js +0 -1081
- package/dist/quicktype-core/language/JavaScript.d.ts +0 -68
- package/dist/quicktype-core/language/JavaScript.js +0 -435
- package/dist/quicktype-core/language/JavaScriptPropTypes.d.ts +0 -40
- package/dist/quicktype-core/language/JavaScriptPropTypes.js +0 -213
- package/dist/quicktype-core/language/JavaScriptUnicodeMaps.d.ts +0 -2
- package/dist/quicktype-core/language/JavaScriptUnicodeMaps.js +0 -134
- package/dist/quicktype-core/language/Kotlin.d.ts +0 -109
- package/dist/quicktype-core/language/Kotlin.js +0 -832
- package/dist/quicktype-core/language/Objective-C.d.ts +0 -79
- package/dist/quicktype-core/language/Objective-C.js +0 -777
- package/dist/quicktype-core/language/Php.d.ts +0 -80
- package/dist/quicktype-core/language/Php.js +0 -702
- package/dist/quicktype-core/language/Pike.d.ts +0 -37
- package/dist/quicktype-core/language/Pike.js +0 -276
- package/dist/quicktype-core/language/Python.d.ts +0 -107
- package/dist/quicktype-core/language/Python.js +0 -969
- package/dist/quicktype-core/language/Rust.d.ts +0 -56
- package/dist/quicktype-core/language/Rust.js +0 -309
- package/dist/quicktype-core/language/Swift.d.ts +0 -96
- package/dist/quicktype-core/language/Swift.js +0 -1211
- package/dist/quicktype-core/language/TypeScriptFlow.d.ts +0 -77
- package/dist/quicktype-core/language/TypeScriptFlow.js +0 -286
- package/dist/quicktype-core/language/ruby/index.d.ts +0 -52
- package/dist/quicktype-core/language/ruby/index.js +0 -557
- package/dist/quicktype-core/language/ruby/keywords.d.ts +0 -3
- package/dist/quicktype-core/language/ruby/keywords.js +0 -358
- package/dist/quicktype-core/rewrites/CombineClasses.d.ts +0 -3
- package/dist/quicktype-core/rewrites/CombineClasses.js +0 -125
- package/dist/quicktype-core/rewrites/ExpandStrings.d.ts +0 -4
- package/dist/quicktype-core/rewrites/ExpandStrings.js +0 -143
- package/dist/quicktype-core/rewrites/FlattenStrings.d.ts +0 -3
- package/dist/quicktype-core/rewrites/FlattenStrings.js +0 -45
- package/dist/quicktype-core/rewrites/FlattenUnions.d.ts +0 -3
- package/dist/quicktype-core/rewrites/FlattenUnions.js +0 -47
- package/dist/quicktype-core/rewrites/InferMaps.d.ts +0 -3
- package/dist/quicktype-core/rewrites/InferMaps.js +0 -117
- package/dist/quicktype-core/rewrites/ReplaceObjectType.d.ts +0 -3
- package/dist/quicktype-core/rewrites/ReplaceObjectType.js +0 -60
- package/dist/quicktype-core/rewrites/ResolveIntersections.d.ts +0 -3
- package/dist/quicktype-core/rewrites/ResolveIntersections.js +0 -244
- package/dist/quicktype-core/support/Acronyms.d.ts +0 -10
- package/dist/quicktype-core/support/Acronyms.js +0 -1128
- package/dist/quicktype-core/support/Chance.d.ts +0 -38
- package/dist/quicktype-core/support/Chance.js +0 -2146
- package/dist/quicktype-core/support/Converters.d.ts +0 -6
- package/dist/quicktype-core/support/Converters.js +0 -16
- package/dist/quicktype-core/support/Strings.d.ts +0 -44
- package/dist/quicktype-core/support/Strings.js +0 -525
- package/dist/quicktype-core/support/Support.d.ts +0 -29
- package/dist/quicktype-core/support/Support.js +0 -162
- package/dist/quicktype-graphql-input/GraphQLSchema.d.ts +0 -645
- package/dist/quicktype-graphql-input/GraphQLSchema.js +0 -39
- package/dist/quicktype-graphql-input/index.d.ts +0 -17
- package/dist/quicktype-graphql-input/index.js +0 -407
- package/dist/quicktype-typescript-input/index.d.ts +0 -2
- package/dist/quicktype-typescript-input/index.js +0 -98
|
@@ -1,162 +0,0 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.numberEnumValues = exports.indentationString = exports.parseJSON = exports.inflateBase64 = exports.errorMessage = exports.repeatedCall = exports.repeated = exports.mustNotHappen = exports.panic = exports.assert = exports.assertNever = exports.nonNull = exports.defined = exports.checkArray = exports.checkStringMap = exports.checkString = exports.isStringMap = void 0;
|
|
27
|
-
const js_base64_1 = require("js-base64");
|
|
28
|
-
const pako = __importStar(require("pako"));
|
|
29
|
-
const Messages_1 = require("../Messages");
|
|
30
|
-
const YAML = __importStar(require("yaml"));
|
|
31
|
-
function isStringMap(x, checkValue) {
|
|
32
|
-
if (typeof x !== "object" || Array.isArray(x) || x === null) {
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
if (checkValue !== undefined) {
|
|
36
|
-
for (const k of Object.getOwnPropertyNames(x)) {
|
|
37
|
-
const v = x[k];
|
|
38
|
-
if (!checkValue(v)) {
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return true;
|
|
44
|
-
}
|
|
45
|
-
exports.isStringMap = isStringMap;
|
|
46
|
-
function checkString(x) {
|
|
47
|
-
return typeof x === "string";
|
|
48
|
-
}
|
|
49
|
-
exports.checkString = checkString;
|
|
50
|
-
function checkStringMap(x, checkValue) {
|
|
51
|
-
if (isStringMap(x, checkValue))
|
|
52
|
-
return x;
|
|
53
|
-
return panic(`Value must be an object, but is ${x}`);
|
|
54
|
-
}
|
|
55
|
-
exports.checkStringMap = checkStringMap;
|
|
56
|
-
function checkArray(x, checkItem) {
|
|
57
|
-
if (!Array.isArray(x)) {
|
|
58
|
-
return panic(`Value must be an array, but is ${x}`);
|
|
59
|
-
}
|
|
60
|
-
if (checkItem !== undefined) {
|
|
61
|
-
for (const v of x) {
|
|
62
|
-
if (!checkItem(v)) {
|
|
63
|
-
return panic(`Array item does not satisfy constraint: ${v}`);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return x;
|
|
68
|
-
}
|
|
69
|
-
exports.checkArray = checkArray;
|
|
70
|
-
function defined(x) {
|
|
71
|
-
if (x !== undefined)
|
|
72
|
-
return x;
|
|
73
|
-
return panic("Defined value expected, but got undefined");
|
|
74
|
-
}
|
|
75
|
-
exports.defined = defined;
|
|
76
|
-
function nonNull(x) {
|
|
77
|
-
if (x !== null)
|
|
78
|
-
return x;
|
|
79
|
-
return panic("Non-null value expected, but got null");
|
|
80
|
-
}
|
|
81
|
-
exports.nonNull = nonNull;
|
|
82
|
-
function assertNever(x) {
|
|
83
|
-
return (0, Messages_1.messageError)("InternalError", { message: `Unexpected object ${x}` });
|
|
84
|
-
}
|
|
85
|
-
exports.assertNever = assertNever;
|
|
86
|
-
function assert(condition, message = "Assertion failed") {
|
|
87
|
-
if (!condition) {
|
|
88
|
-
return (0, Messages_1.messageError)("InternalError", { message });
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
exports.assert = assert;
|
|
92
|
-
function panic(message) {
|
|
93
|
-
return (0, Messages_1.messageError)("InternalError", { message });
|
|
94
|
-
}
|
|
95
|
-
exports.panic = panic;
|
|
96
|
-
function mustNotHappen() {
|
|
97
|
-
return panic("This must not happen");
|
|
98
|
-
}
|
|
99
|
-
exports.mustNotHappen = mustNotHappen;
|
|
100
|
-
function repeated(n, value) {
|
|
101
|
-
const arr = [];
|
|
102
|
-
for (let i = 0; i < n; i++) {
|
|
103
|
-
arr.push(value);
|
|
104
|
-
}
|
|
105
|
-
return arr;
|
|
106
|
-
}
|
|
107
|
-
exports.repeated = repeated;
|
|
108
|
-
function repeatedCall(n, producer) {
|
|
109
|
-
const arr = [];
|
|
110
|
-
for (let i = 0; i < n; i++) {
|
|
111
|
-
arr.push(producer());
|
|
112
|
-
}
|
|
113
|
-
return arr;
|
|
114
|
-
}
|
|
115
|
-
exports.repeatedCall = repeatedCall;
|
|
116
|
-
function errorMessage(e) {
|
|
117
|
-
if (e instanceof Error) {
|
|
118
|
-
return e.message;
|
|
119
|
-
}
|
|
120
|
-
return e.toString();
|
|
121
|
-
}
|
|
122
|
-
exports.errorMessage = errorMessage;
|
|
123
|
-
function inflateBase64(encoded) {
|
|
124
|
-
const bytes = js_base64_1.Base64.atob(encoded);
|
|
125
|
-
return pako.inflate(bytes, { to: "string" });
|
|
126
|
-
}
|
|
127
|
-
exports.inflateBase64 = inflateBase64;
|
|
128
|
-
function parseJSON(text, description, address = "<unknown>") {
|
|
129
|
-
try {
|
|
130
|
-
// https://gist.github.com/pbakondy/f5045eff725193dad9c7
|
|
131
|
-
if (text.charCodeAt(0) === 0xfeff) {
|
|
132
|
-
text = text.slice(1);
|
|
133
|
-
}
|
|
134
|
-
return YAML.parse(text);
|
|
135
|
-
}
|
|
136
|
-
catch (e) {
|
|
137
|
-
let message;
|
|
138
|
-
if (e instanceof SyntaxError) {
|
|
139
|
-
message = e.message;
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
message = `Unknown exception ${e}`;
|
|
143
|
-
}
|
|
144
|
-
return (0, Messages_1.messageError)("MiscJSONParseError", { description, address, message });
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
exports.parseJSON = parseJSON;
|
|
148
|
-
function indentationString(level) {
|
|
149
|
-
return " ".repeat(level);
|
|
150
|
-
}
|
|
151
|
-
exports.indentationString = indentationString;
|
|
152
|
-
function numberEnumValues(e) {
|
|
153
|
-
const result = [];
|
|
154
|
-
for (const k of Object.keys(e)) {
|
|
155
|
-
const v = e[k];
|
|
156
|
-
if (typeof v === "number") {
|
|
157
|
-
result.push(v);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
return result;
|
|
161
|
-
}
|
|
162
|
-
exports.numberEnumValues = numberEnumValues;
|