quicktype-core 23.2.0 → 23.2.1

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.
@@ -0,0 +1 @@
1
+ export declare const fetch: any;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetch = void 0;
4
+ console.info("=== RUNNING IN CI, USE FETCH.CI ===");
5
+ exports.fetch = require("cross-fetch").default;
@@ -0,0 +1,3 @@
1
+ import type CrossFetch from "cross-fetch";
2
+ declare let fetch: typeof CrossFetch;
3
+ export { fetch };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.fetch = void 0;
5
+ let fetch;
6
+ try {
7
+ exports.fetch = fetch = (_a = global.fetch) !== null && _a !== void 0 ? _a : require("cross-fetch").default;
8
+ }
9
+ catch (_b) {
10
+ exports.fetch = fetch = require("cross-fetch").default;
11
+ }
@@ -44,22 +44,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
44
44
  var __importDefault = (this && this.__importDefault) || function (mod) {
45
45
  return (mod && mod.__esModule) ? mod : { "default": mod };
46
46
  };
47
- var _a;
48
47
  Object.defineProperty(exports, "__esModule", { value: true });
49
48
  exports.readableFromFileOrURL = readableFromFileOrURL;
50
49
  exports.readFromFileOrURL = readFromFileOrURL;
51
- const fs = __importStar(require("fs"));
50
+ const fs = __importStar(require("node:fs"));
52
51
  const ts_necessities_1 = require("@glideapps/ts-necessities");
53
52
  const browser_or_node_1 = require("browser-or-node");
54
53
  const is_url_1 = __importDefault(require("is-url"));
55
54
  const Messages_1 = require("../../Messages");
56
55
  const Support_1 = require("../../support/Support");
57
56
  const get_stream_1 = require("./get-stream");
58
- // We need to use cross-fetch in CI or if fetch is not available in the global scope
59
- // We use a dynamic import to avoid punycode deprecated dependency warning on node > 20
60
- const fetch = process.env.CI
61
- ? require("cross-fetch").default
62
- : ((_a = global.fetch) !== null && _a !== void 0 ? _a : require("cross-fetch").default);
57
+ const _fetch_ci_1 = require("./$fetch.ci");
63
58
  function parseHeaders(httpHeaders) {
64
59
  if (!Array.isArray(httpHeaders)) {
65
60
  return {};
@@ -81,12 +76,12 @@ function readableFromFileOrURL(fileOrURL, httpHeaders) {
81
76
  return __awaiter(this, void 0, void 0, function* () {
82
77
  try {
83
78
  if ((0, is_url_1.default)(fileOrURL)) {
84
- const response = yield fetch(fileOrURL, {
79
+ const response = yield (0, _fetch_ci_1.fetch)(fileOrURL, {
85
80
  headers: parseHeaders(httpHeaders),
86
81
  });
87
82
  return (0, ts_necessities_1.defined)(response.body);
88
83
  }
89
- else if (browser_or_node_1.isNode) {
84
+ if (browser_or_node_1.isNode) {
90
85
  if (fileOrURL === "-") {
91
86
  // Cast node readable to isomorphic readable from readable-stream
92
87
  return process.stdin;
@@ -58,7 +58,7 @@ export declare const cSharpOptions: {
58
58
  readonly helpers: false;
59
59
  readonly attributes: false;
60
60
  };
61
- }, "just-types" | "complete" | "attributes-only" | "just-types-and-namespace">;
61
+ }, "complete" | "just-types" | "attributes-only" | "just-types-and-namespace">;
62
62
  readonly baseclass: EnumOption<"base-class", {
63
63
  readonly EntityData: "EntityData";
64
64
  readonly Object: undefined;
@@ -114,7 +114,7 @@ export declare const newtonsoftCSharpOptions: {
114
114
  readonly helpers: false;
115
115
  readonly attributes: false;
116
116
  };
117
- }, "just-types" | "complete" | "attributes-only" | "just-types-and-namespace">;
117
+ }, "complete" | "just-types" | "attributes-only" | "just-types-and-namespace">;
118
118
  readonly baseclass: EnumOption<"base-class", {
119
119
  readonly EntityData: "EntityData";
120
120
  readonly Object: undefined;
@@ -170,7 +170,7 @@ export declare const systemTextJsonCSharpOptions: {
170
170
  readonly helpers: false;
171
171
  readonly attributes: false;
172
172
  };
173
- }, "just-types" | "complete" | "attributes-only" | "just-types-and-namespace">;
173
+ }, "complete" | "just-types" | "attributes-only" | "just-types-and-namespace">;
174
174
  readonly baseclass: EnumOption<"base-class", {
175
175
  readonly EntityData: "EntityData";
176
176
  readonly Object: undefined;
@@ -21,7 +21,7 @@ export declare const javaScriptOptions: {
21
21
  rawType: EnumOption<"raw-type", {
22
22
  readonly json: "json";
23
23
  readonly any: "any";
24
- }, "any" | "json">;
24
+ }, "json" | "any">;
25
25
  };
26
26
  export declare const javaScriptLanguageConfig: {
27
27
  readonly displayName: "JavaScript";
@@ -3,7 +3,7 @@ export declare enum Strictness {
3
3
  Coercible = "Coercible::",
4
4
  None = "Types::"
5
5
  }
6
- export declare const forbiddenForObjectProperties: ("false" | "case" | "true" | "default" | "class" | "method" | "next" | "alias" | "type" | "clone" | "then" | "enum" | "end" | "module" | "and" | "break" | "do" | "else" | "for" | "if" | "not" | "or" | "return" | "try" | "while" | "optional" | "begin" | "def" | "elsif" | "ensure" | "extend" | "in" | "nil" | "rescue" | "self" | "super" | "unless" | "until" | "when" | "with" | "yield" | "hash" | "__ENCODING__" | "__FILE__" | "__LINE__" | "BEGIN" | "defined?" | "END" | "redo" | "retry" | "undef" | "__id__" | "__send__" | "define_singleton_method" | "display" | "dup" | "enum_for" | "freeze" | "inspect" | "instance_eval" | "instance_exec" | "instance_variable_defined?" | "instance_variable_get" | "instance_variable_set" | "instance_variables" | "itself" | "methods" | "object_id" | "private_methods" | "protected_methods" | "public_method" | "public_methods" | "public_send" | "remove_instance_variable" | "send" | "singleton_class" | "singleton_method" | "singleton_methods" | "taint" | "tap" | "to_enum" | "to_s" | "trust" | "untaint" | "untrust" | "call" | "constrained_type" | "constrained?" | "constrained" | "constructor" | "gem" | "meta" | "options" | "pristine" | "rule" | "safe" | "to_ast" | "to_json")[];
6
+ export declare const forbiddenForObjectProperties: ("false" | "case" | "true" | "type" | "optional" | "default" | "module" | "end" | "display" | "meta" | "method" | "options" | "next" | "self" | "class" | "alias" | "clone" | "then" | "enum" | "and" | "break" | "do" | "else" | "for" | "if" | "not" | "or" | "return" | "try" | "while" | "begin" | "def" | "elsif" | "ensure" | "extend" | "in" | "nil" | "rescue" | "super" | "unless" | "until" | "when" | "with" | "yield" | "hash" | "__ENCODING__" | "__FILE__" | "__LINE__" | "BEGIN" | "defined?" | "END" | "redo" | "retry" | "undef" | "__id__" | "__send__" | "define_singleton_method" | "dup" | "enum_for" | "freeze" | "inspect" | "instance_eval" | "instance_exec" | "instance_variable_defined?" | "instance_variable_get" | "instance_variable_set" | "instance_variables" | "itself" | "methods" | "object_id" | "private_methods" | "protected_methods" | "public_method" | "public_methods" | "public_send" | "remove_instance_variable" | "send" | "singleton_class" | "singleton_method" | "singleton_methods" | "taint" | "tap" | "to_enum" | "to_s" | "trust" | "untaint" | "untrust" | "call" | "constrained_type" | "constrained?" | "constrained" | "constructor" | "gem" | "pristine" | "rule" | "safe" | "to_ast" | "to_json")[];
7
7
  export declare const stringEscape: (s: string) => string;
8
8
  export declare function simpleNameStyle(original: string, uppercase: boolean): string;
9
9
  export declare function memberNameStyle(original: string): string;
@@ -13,7 +13,7 @@ export declare const rustOptions: {
13
13
  readonly private: Visibility.Private;
14
14
  readonly crate: Visibility.Crate;
15
15
  readonly public: Visibility.Public;
16
- }, "private" | "crate" | "public">;
16
+ }, "private" | "public" | "crate">;
17
17
  readonly deriveDebug: BooleanOption<"derive-debug">;
18
18
  readonly deriveClone: BooleanOption<"derive-clone">;
19
19
  readonly derivePartialEq: BooleanOption<"derive-partial-eq">;
@@ -37,7 +37,7 @@ export declare const swiftOptions: {
37
37
  accessLevel: EnumOption<"access-level", {
38
38
  readonly internal: "internal";
39
39
  readonly public: "public";
40
- }, "public" | "internal">;
40
+ }, "internal" | "public">;
41
41
  protocol: EnumOption<"protocol", {
42
42
  readonly none: {
43
43
  readonly equatable: false;
@@ -21,7 +21,7 @@ export declare const tsFlowOptions: {
21
21
  rawType: import("../../RendererOptions").EnumOption<"raw-type", {
22
22
  readonly json: "json";
23
23
  readonly any: "any";
24
- }, "any" | "json">;
24
+ }, "json" | "any">;
25
25
  } & {
26
26
  justTypes: BooleanOption<"just-types">;
27
27
  nicePropertyNames: BooleanOption<"nice-property-names">;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quicktype-core",
3
- "version": "23.2.0",
3
+ "version": "23.2.1",
4
4
  "description": "The quicktype engine as a library",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.js",
@@ -8,7 +8,7 @@
8
8
  "repository": "https://github.com/quicktype/quicktype",
9
9
  "scripts": {
10
10
  "clean": "rm -rf dist node_modules *~",
11
- "build": "tsc"
11
+ "build": "./env.sh && tsc"
12
12
  },
13
13
  "dependencies": {
14
14
  "@glideapps/ts-necessities": "2.2.3",
@@ -29,7 +29,7 @@
29
29
  "devDependencies": {
30
30
  "@types/browser-or-node": "^1.3.2",
31
31
  "@types/is-url": "^1.2.32",
32
- "@types/node": "18.19.31",
32
+ "@types/node": "~22.14.0",
33
33
  "@types/pako": "^1.0.0",
34
34
  "@types/pluralize": "0.0.30",
35
35
  "@types/readable-stream": "4.0.10",
@@ -38,6 +38,13 @@
38
38
  "@types/wordwrap": "^1.0.3",
39
39
  "typescript": "~5.8.3"
40
40
  },
41
+ "overrides": {
42
+ "cross-fetch": {
43
+ "node-fetch": {
44
+ "whatwg-url": "^13.0.0"
45
+ }
46
+ }
47
+ },
41
48
  "files": [
42
49
  "dist"
43
50
  ],