quicktype-core 23.0.144 → 23.0.145
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/dist/language/CSharp.js +25 -5
- package/dist/language/Elixir.js +24 -4
- package/dist/language/Objective-C.js +25 -5
- package/dist/language/Python.js +25 -5
- package/dist/language/ruby/index.js +2 -5
- package/dist/support/Strings.js +31 -11
- package/package.json +1 -1
package/dist/language/CSharp.js
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
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;
|
|
4
24
|
};
|
|
5
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
26
|
exports.SystemTextJsonCSharpRenderer = exports.systemTextJsonCSharpOptions = exports.NewtonsoftCSharpRenderer = exports.newtonsoftCSharpOptions = exports.CSharpRenderer = exports.CSharpTargetLanguage = exports.cSharpOptions = exports.AccessModifier = exports.Framework = void 0;
|
|
@@ -17,7 +37,7 @@ const RendererOptions_1 = require("../RendererOptions");
|
|
|
17
37
|
const Annotation_1 = require("../Annotation");
|
|
18
38
|
const Transformers_1 = require("../Transformers");
|
|
19
39
|
const Constraints_1 = require("../attributes/Constraints");
|
|
20
|
-
const
|
|
40
|
+
const unicode = __importStar(require("unicode-properties"));
|
|
21
41
|
var Framework;
|
|
22
42
|
(function (Framework) {
|
|
23
43
|
Framework[Framework["Newtonsoft"] = 0] = "Newtonsoft";
|
|
@@ -183,13 +203,13 @@ const denseJsonPropertyName = "J";
|
|
|
183
203
|
const denseRequiredEnumName = "R";
|
|
184
204
|
const denseNullValueHandlingEnumName = "N";
|
|
185
205
|
function isStartCharacter(utf16Unit) {
|
|
186
|
-
if (
|
|
206
|
+
if (unicode.isAlphabetic(utf16Unit)) {
|
|
187
207
|
return true;
|
|
188
208
|
}
|
|
189
209
|
return utf16Unit === 0x5f; // underscore
|
|
190
210
|
}
|
|
191
211
|
function isPartCharacter(utf16Unit) {
|
|
192
|
-
const category =
|
|
212
|
+
const category = unicode.getCategory(utf16Unit);
|
|
193
213
|
if (["Nd", "Pc", "Mn", "Mc"].indexOf(category) >= 0) {
|
|
194
214
|
return true;
|
|
195
215
|
}
|
package/dist/language/Elixir.js
CHANGED
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
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;
|
|
4
24
|
};
|
|
5
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
26
|
exports.ElixirRenderer = exports.ElixirTargetLanguage = exports.elixirOptions = void 0;
|
|
7
|
-
const
|
|
27
|
+
const unicode = __importStar(require("unicode-properties"));
|
|
8
28
|
const Naming_1 = require("../Naming");
|
|
9
29
|
const ConvenienceRenderer_1 = require("../ConvenienceRenderer");
|
|
10
30
|
const TargetLanguage_1 = require("../TargetLanguage");
|
|
@@ -149,7 +169,7 @@ class ElixirTargetLanguage extends TargetLanguage_1.TargetLanguage {
|
|
|
149
169
|
exports.ElixirTargetLanguage = ElixirTargetLanguage;
|
|
150
170
|
const isStartCharacter = Strings_1.isLetterOrUnderscore;
|
|
151
171
|
function isPartCharacter(utf16Unit) {
|
|
152
|
-
const category =
|
|
172
|
+
const category = unicode.getCategory(utf16Unit);
|
|
153
173
|
return ["Nd", "Pc", "Mn", "Mc"].indexOf(category) >= 0 || isStartCharacter(utf16Unit);
|
|
154
174
|
}
|
|
155
175
|
const legalizeName = (0, Strings_1.legalizeCharacters)(isPartCharacter);
|
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
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;
|
|
4
24
|
};
|
|
5
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
26
|
exports.ObjectiveCRenderer = exports.ObjectiveCTargetLanguage = exports.objcOptions = void 0;
|
|
@@ -14,7 +34,7 @@ const Strings_1 = require("../support/Strings");
|
|
|
14
34
|
const ConvenienceRenderer_1 = require("../ConvenienceRenderer");
|
|
15
35
|
const RendererOptions_1 = require("../RendererOptions");
|
|
16
36
|
const Support_1 = require("../support/Support");
|
|
17
|
-
const
|
|
37
|
+
const unicode = __importStar(require("unicode-properties"));
|
|
18
38
|
const DEBUG = false;
|
|
19
39
|
const DEFAULT_CLASS_PREFIX = "QT";
|
|
20
40
|
exports.objcOptions = {
|
|
@@ -154,10 +174,10 @@ const booleanPrefixes = [
|
|
|
154
174
|
"need"
|
|
155
175
|
];
|
|
156
176
|
function isStartCharacter(utf16Unit) {
|
|
157
|
-
return
|
|
177
|
+
return unicode.isAlphabetic(utf16Unit) || utf16Unit === 0x5f; // underscore
|
|
158
178
|
}
|
|
159
179
|
function isPartCharacter(utf16Unit) {
|
|
160
|
-
const category =
|
|
180
|
+
const category = unicode.getCategory(utf16Unit);
|
|
161
181
|
return ["Nd", "Pc", "Mn", "Mc"].indexOf(category) >= 0 || isStartCharacter(utf16Unit);
|
|
162
182
|
}
|
|
163
183
|
const legalizeName = (0, Strings_1.utf16LegalizeCharacters)(isPartCharacter);
|
package/dist/language/Python.js
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
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;
|
|
4
24
|
};
|
|
5
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
26
|
exports.JSONPythonRenderer = exports.PythonRenderer = exports.PythonTargetLanguage = exports.pythonOptions = void 0;
|
|
@@ -15,7 +35,7 @@ const Source_1 = require("../Source");
|
|
|
15
35
|
const TypeUtils_1 = require("../TypeUtils");
|
|
16
36
|
const Transformers_1 = require("../Transformers");
|
|
17
37
|
const collection_utils_1 = require("collection-utils");
|
|
18
|
-
const
|
|
38
|
+
const unicode = __importStar(require("unicode-properties"));
|
|
19
39
|
const forbiddenTypeNames = [
|
|
20
40
|
"Any",
|
|
21
41
|
"True",
|
|
@@ -123,14 +143,14 @@ class PythonTargetLanguage extends TargetLanguage_1.TargetLanguage {
|
|
|
123
143
|
exports.PythonTargetLanguage = PythonTargetLanguage;
|
|
124
144
|
function isNormalizedStartCharacter3(utf16Unit) {
|
|
125
145
|
// FIXME: add Other_ID_Start - https://docs.python.org/3/reference/lexical_analysis.html#identifiers
|
|
126
|
-
const category =
|
|
146
|
+
const category = unicode.getCategory(utf16Unit);
|
|
127
147
|
return ["Lu", "Ll", "Lt", "Lm", "Lo", "Nl"].indexOf(category) >= 0;
|
|
128
148
|
}
|
|
129
149
|
function isNormalizedPartCharacter3(utf16Unit) {
|
|
130
150
|
// FIXME: add Other_ID_Continue - https://docs.python.org/3/reference/lexical_analysis.html#identifiers
|
|
131
151
|
if (isNormalizedStartCharacter3(utf16Unit))
|
|
132
152
|
return true;
|
|
133
|
-
const category =
|
|
153
|
+
const category = unicode.getCategory(utf16Unit);
|
|
134
154
|
return ["Mn", "Mc", "Nd", "Pc"].indexOf(category) >= 0;
|
|
135
155
|
}
|
|
136
156
|
function isStartCharacter3(utf16Unit) {
|
|
@@ -22,12 +22,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
26
|
exports.RubyRenderer = exports.RubyTargetLanguage = exports.rubyOptions = exports.Strictness = void 0;
|
|
30
|
-
const
|
|
27
|
+
const unicode = __importStar(require("unicode-properties"));
|
|
31
28
|
const Source_1 = require("../../Source");
|
|
32
29
|
const Naming_1 = require("../../Naming");
|
|
33
30
|
const ConvenienceRenderer_1 = require("../../ConvenienceRenderer");
|
|
@@ -77,7 +74,7 @@ class RubyTargetLanguage extends TargetLanguage_1.TargetLanguage {
|
|
|
77
74
|
exports.RubyTargetLanguage = RubyTargetLanguage;
|
|
78
75
|
const isStartCharacter = Strings_1.isLetterOrUnderscore;
|
|
79
76
|
function isPartCharacter(utf16Unit) {
|
|
80
|
-
const category =
|
|
77
|
+
const category = unicode.getCategory(utf16Unit);
|
|
81
78
|
return ["Nd", "Pc", "Mn", "Mc"].indexOf(category) >= 0 || isStartCharacter(utf16Unit);
|
|
82
79
|
}
|
|
83
80
|
const legalizeName = (0, Strings_1.legalizeCharacters)(isPartCharacter);
|
package/dist/support/Strings.js
CHANGED
|
@@ -1,13 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
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;
|
|
4
24
|
};
|
|
5
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
26
|
exports.makeNameStyle = exports.addPrefixIfNecessary = exports.combineWords = exports.allLowerWordStyle = exports.originalWord = exports.allUpperWordStyle = exports.firstUpperWordStyle = exports.splitIntoWords = exports.fastIsUpperCase = exports.startWithLetter = exports.snakeCase = exports.camelCase = exports.pascalCase = exports.decapitalize = exports.capitalize = exports.trimEnd = exports.isWordCharacter = exports.isLetterOrUnderscoreOrDigit = exports.isLetterOrUnderscore = exports.isLetterOrDigit = exports.isNumeric = exports.isDigit = exports.isLetter = exports.isAscii = exports.isPrintable = exports.stringEscape = exports.utf16StringEscape = exports.escapeNonPrintableMapper = exports.standardUnicodeHexEscape = exports.intToHex = exports.repeatString = exports.legalizeCharacters = exports.utf16LegalizeCharacters = exports.utf32ConcatMap = exports.utf16ConcatMap = void 0;
|
|
7
27
|
const Support_1 = require("./Support");
|
|
8
28
|
const Acronyms_1 = require("./Acronyms");
|
|
9
29
|
const Messages_1 = require("../Messages");
|
|
10
|
-
const
|
|
30
|
+
const unicode = __importStar(require("unicode-properties"));
|
|
11
31
|
function computeAsciiMap(mapper) {
|
|
12
32
|
const charStringMap = [];
|
|
13
33
|
const charNoEscapeMap = [];
|
|
@@ -177,7 +197,7 @@ exports.stringEscape = utf32ConcatMap(escapeNonPrintableMapper(isPrintable, stan
|
|
|
177
197
|
function isPrintable(codePoint) {
|
|
178
198
|
if (codePoint > 0xffff)
|
|
179
199
|
return false;
|
|
180
|
-
const category =
|
|
200
|
+
const category = unicode.getCategory(codePoint);
|
|
181
201
|
return ([
|
|
182
202
|
"Mc",
|
|
183
203
|
"No",
|
|
@@ -210,18 +230,18 @@ function isAscii(codePoint) {
|
|
|
210
230
|
}
|
|
211
231
|
exports.isAscii = isAscii;
|
|
212
232
|
function isLetter(codePoint) {
|
|
213
|
-
const category =
|
|
233
|
+
const category = unicode.getCategory(codePoint);
|
|
214
234
|
// FIXME: Include Letter, modifier (Lm)?
|
|
215
235
|
return ["Lu", "Ll", "Lt", "Lo"].indexOf(category) >= 0;
|
|
216
236
|
}
|
|
217
237
|
exports.isLetter = isLetter;
|
|
218
238
|
function isDigit(codePoint) {
|
|
219
|
-
const category =
|
|
239
|
+
const category = unicode.getCategory(codePoint);
|
|
220
240
|
return ["Nd"].indexOf(category) >= 0;
|
|
221
241
|
}
|
|
222
242
|
exports.isDigit = isDigit;
|
|
223
243
|
function isNumeric(codePoint) {
|
|
224
|
-
const category =
|
|
244
|
+
const category = unicode.getCategory(codePoint);
|
|
225
245
|
return ["No", "Nd", "Nl"].indexOf(category) >= 0;
|
|
226
246
|
}
|
|
227
247
|
exports.isNumeric = isNumeric;
|
|
@@ -245,7 +265,7 @@ function trimEnd(str) {
|
|
|
245
265
|
const l = str.length;
|
|
246
266
|
let firstWS = l;
|
|
247
267
|
for (let i = l - 1; i >= 0; i--) {
|
|
248
|
-
if (!
|
|
268
|
+
if (!unicode.isWhiteSpace(str.charCodeAt(i)))
|
|
249
269
|
break;
|
|
250
270
|
firstWS = i;
|
|
251
271
|
}
|
|
@@ -295,9 +315,9 @@ exports.startWithLetter = startWithLetter;
|
|
|
295
315
|
const knownAcronyms = new Set(Acronyms_1.acronyms);
|
|
296
316
|
const fastIsWordCharacter = precomputedCodePointPredicate(isWordCharacter);
|
|
297
317
|
const fastIsNonWordCharacter = precomputedCodePointPredicate(cp => !isWordCharacter(cp));
|
|
298
|
-
const fastIsLowerCase = precomputedCodePointPredicate(cp =>
|
|
299
|
-
exports.fastIsUpperCase = precomputedCodePointPredicate(cp =>
|
|
300
|
-
const fastNonLetter = precomputedCodePointPredicate(cp => !
|
|
318
|
+
const fastIsLowerCase = precomputedCodePointPredicate(cp => unicode.isLowerCase(cp));
|
|
319
|
+
exports.fastIsUpperCase = precomputedCodePointPredicate(cp => unicode.isUpperCase(cp));
|
|
320
|
+
const fastNonLetter = precomputedCodePointPredicate(cp => !unicode.isLowerCase(cp) && !unicode.isUpperCase(cp));
|
|
301
321
|
const fastIsDigit = precomputedCodePointPredicate(isDigit);
|
|
302
322
|
function splitIntoWords(s) {
|
|
303
323
|
// [start, end, allUpper]
|