fumadocs-openapi 10.8.4 → 10.8.5
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/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/2020.js +110 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/code.js +138 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/index.js +674 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/scope.js +141 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/errors.js +102 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/index.js +223 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/names.js +28 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/ref_error.js +18 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/resolve.js +133 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/rules.js +61 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/util.js +146 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/applicability.js +23 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/boolSchema.js +48 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/dataType.js +172 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/defaults.js +31 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/index.js +433 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/keyword.js +113 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/subschema.js +72 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/core.js +583 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/data.js +18 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/index.js +42 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.js +50 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.js +20 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.js +51 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.js +16 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.js +36 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.js +19 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.js +85 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/schema.js +59 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/equal.js +12 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/ucs2length.js +25 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/uri.js +12 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/validation_error.js +16 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +57 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +96 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js +29 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +16 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/contains.js +89 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +87 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js +16 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/if.js +62 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/index.js +60 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items.js +59 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js +34 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/not.js +31 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +51 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +61 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +17 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/properties.js +52 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +41 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +17 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/code.js +130 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/id.js +14 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/index.js +22 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/ref.js +112 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/index.js +101 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/types.js +14 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/draft2020.js +35 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +46 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js +45 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/index.js +22 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +20 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js +15 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/format.js +92 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/index.js +10 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/metadata.js +23 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/next.js +19 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/index.js +13 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +46 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +59 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/const.js +27 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js +17 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/enum.js +49 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/index.js +48 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitContains.js +18 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js +28 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js +33 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +47 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +28 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +27 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/pattern.js +38 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/required.js +72 -0
- package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +70 -0
- package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js +33 -0
- package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/index.js +236 -0
- package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/schemes.js +187 -0
- package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/utils.js +282 -0
- package/dist/node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js +78 -0
- package/dist/playground/schema.d.ts +0 -2
- package/dist/playground/schema.js +3 -2
- package/package.json +7 -3
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { require_codegen } from "./compile/codegen/index.js";
|
|
3
|
+
import { require_validate } from "./compile/validate/index.js";
|
|
4
|
+
import { require_validation_error } from "./runtime/validation_error.js";
|
|
5
|
+
import { require_ref_error } from "./compile/ref_error.js";
|
|
6
|
+
import { require_core } from "./core.js";
|
|
7
|
+
import { require_draft2020 } from "./vocabularies/draft2020.js";
|
|
8
|
+
import { require_discriminator } from "./vocabularies/discriminator/index.js";
|
|
9
|
+
import { require_json_schema_2020_12 } from "./refs/json-schema-2020-12/index.js";
|
|
10
|
+
//#region ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/2020.js
|
|
11
|
+
var require__2020 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv2020 = void 0;
|
|
14
|
+
const core_1 = require_core();
|
|
15
|
+
const draft2020_1 = require_draft2020();
|
|
16
|
+
const discriminator_1 = require_discriminator();
|
|
17
|
+
const json_schema_2020_12_1 = require_json_schema_2020_12();
|
|
18
|
+
const META_SCHEMA_ID = "https://json-schema.org/draft/2020-12/schema";
|
|
19
|
+
var Ajv2020 = class extends core_1.default {
|
|
20
|
+
constructor(opts = {}) {
|
|
21
|
+
super({
|
|
22
|
+
...opts,
|
|
23
|
+
dynamicRef: true,
|
|
24
|
+
next: true,
|
|
25
|
+
unevaluated: true
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
_addVocabularies() {
|
|
29
|
+
super._addVocabularies();
|
|
30
|
+
draft2020_1.default.forEach((v) => this.addVocabulary(v));
|
|
31
|
+
if (this.opts.discriminator) this.addKeyword(discriminator_1.default);
|
|
32
|
+
}
|
|
33
|
+
_addDefaultMetaSchema() {
|
|
34
|
+
super._addDefaultMetaSchema();
|
|
35
|
+
const { $data, meta } = this.opts;
|
|
36
|
+
if (!meta) return;
|
|
37
|
+
json_schema_2020_12_1.default.call(this, $data);
|
|
38
|
+
this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID;
|
|
39
|
+
}
|
|
40
|
+
defaultMeta() {
|
|
41
|
+
return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
exports.Ajv2020 = Ajv2020;
|
|
45
|
+
module.exports = exports = Ajv2020;
|
|
46
|
+
module.exports.Ajv2020 = Ajv2020;
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.default = Ajv2020;
|
|
49
|
+
var validate_1 = require_validate();
|
|
50
|
+
Object.defineProperty(exports, "KeywordCxt", {
|
|
51
|
+
enumerable: true,
|
|
52
|
+
get: function() {
|
|
53
|
+
return validate_1.KeywordCxt;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
var codegen_1 = require_codegen();
|
|
57
|
+
Object.defineProperty(exports, "_", {
|
|
58
|
+
enumerable: true,
|
|
59
|
+
get: function() {
|
|
60
|
+
return codegen_1._;
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
Object.defineProperty(exports, "str", {
|
|
64
|
+
enumerable: true,
|
|
65
|
+
get: function() {
|
|
66
|
+
return codegen_1.str;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
Object.defineProperty(exports, "stringify", {
|
|
70
|
+
enumerable: true,
|
|
71
|
+
get: function() {
|
|
72
|
+
return codegen_1.stringify;
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
Object.defineProperty(exports, "nil", {
|
|
76
|
+
enumerable: true,
|
|
77
|
+
get: function() {
|
|
78
|
+
return codegen_1.nil;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
Object.defineProperty(exports, "Name", {
|
|
82
|
+
enumerable: true,
|
|
83
|
+
get: function() {
|
|
84
|
+
return codegen_1.Name;
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
Object.defineProperty(exports, "CodeGen", {
|
|
88
|
+
enumerable: true,
|
|
89
|
+
get: function() {
|
|
90
|
+
return codegen_1.CodeGen;
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
var validation_error_1 = require_validation_error();
|
|
94
|
+
Object.defineProperty(exports, "ValidationError", {
|
|
95
|
+
enumerable: true,
|
|
96
|
+
get: function() {
|
|
97
|
+
return validation_error_1.default;
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
var ref_error_1 = require_ref_error();
|
|
101
|
+
Object.defineProperty(exports, "MissingRefError", {
|
|
102
|
+
enumerable: true,
|
|
103
|
+
get: function() {
|
|
104
|
+
return ref_error_1.default;
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}));
|
|
108
|
+
//#endregion
|
|
109
|
+
export default require__2020();
|
|
110
|
+
export { require__2020 };
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/code.js
|
|
3
|
+
var require_code = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0;
|
|
6
|
+
var _CodeOrName = class {};
|
|
7
|
+
exports._CodeOrName = _CodeOrName;
|
|
8
|
+
exports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
|
|
9
|
+
var Name = class extends _CodeOrName {
|
|
10
|
+
constructor(s) {
|
|
11
|
+
super();
|
|
12
|
+
if (!exports.IDENTIFIER.test(s)) throw new Error("CodeGen: name must be a valid identifier");
|
|
13
|
+
this.str = s;
|
|
14
|
+
}
|
|
15
|
+
toString() {
|
|
16
|
+
return this.str;
|
|
17
|
+
}
|
|
18
|
+
emptyStr() {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
get names() {
|
|
22
|
+
return { [this.str]: 1 };
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
exports.Name = Name;
|
|
26
|
+
var _Code = class extends _CodeOrName {
|
|
27
|
+
constructor(code) {
|
|
28
|
+
super();
|
|
29
|
+
this._items = typeof code === "string" ? [code] : code;
|
|
30
|
+
}
|
|
31
|
+
toString() {
|
|
32
|
+
return this.str;
|
|
33
|
+
}
|
|
34
|
+
emptyStr() {
|
|
35
|
+
if (this._items.length > 1) return false;
|
|
36
|
+
const item = this._items[0];
|
|
37
|
+
return item === "" || item === "\"\"";
|
|
38
|
+
}
|
|
39
|
+
get str() {
|
|
40
|
+
var _a;
|
|
41
|
+
return (_a = this._str) !== null && _a !== void 0 ? _a : this._str = this._items.reduce((s, c) => `${s}${c}`, "");
|
|
42
|
+
}
|
|
43
|
+
get names() {
|
|
44
|
+
var _a;
|
|
45
|
+
return (_a = this._names) !== null && _a !== void 0 ? _a : this._names = this._items.reduce((names, c) => {
|
|
46
|
+
if (c instanceof Name) names[c.str] = (names[c.str] || 0) + 1;
|
|
47
|
+
return names;
|
|
48
|
+
}, {});
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
exports._Code = _Code;
|
|
52
|
+
exports.nil = new _Code("");
|
|
53
|
+
function _(strs, ...args) {
|
|
54
|
+
const code = [strs[0]];
|
|
55
|
+
let i = 0;
|
|
56
|
+
while (i < args.length) {
|
|
57
|
+
addCodeArg(code, args[i]);
|
|
58
|
+
code.push(strs[++i]);
|
|
59
|
+
}
|
|
60
|
+
return new _Code(code);
|
|
61
|
+
}
|
|
62
|
+
exports._ = _;
|
|
63
|
+
const plus = new _Code("+");
|
|
64
|
+
function str(strs, ...args) {
|
|
65
|
+
const expr = [safeStringify(strs[0])];
|
|
66
|
+
let i = 0;
|
|
67
|
+
while (i < args.length) {
|
|
68
|
+
expr.push(plus);
|
|
69
|
+
addCodeArg(expr, args[i]);
|
|
70
|
+
expr.push(plus, safeStringify(strs[++i]));
|
|
71
|
+
}
|
|
72
|
+
optimize(expr);
|
|
73
|
+
return new _Code(expr);
|
|
74
|
+
}
|
|
75
|
+
exports.str = str;
|
|
76
|
+
function addCodeArg(code, arg) {
|
|
77
|
+
if (arg instanceof _Code) code.push(...arg._items);
|
|
78
|
+
else if (arg instanceof Name) code.push(arg);
|
|
79
|
+
else code.push(interpolate(arg));
|
|
80
|
+
}
|
|
81
|
+
exports.addCodeArg = addCodeArg;
|
|
82
|
+
function optimize(expr) {
|
|
83
|
+
let i = 1;
|
|
84
|
+
while (i < expr.length - 1) {
|
|
85
|
+
if (expr[i] === plus) {
|
|
86
|
+
const res = mergeExprItems(expr[i - 1], expr[i + 1]);
|
|
87
|
+
if (res !== void 0) {
|
|
88
|
+
expr.splice(i - 1, 3, res);
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
expr[i++] = "+";
|
|
92
|
+
}
|
|
93
|
+
i++;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function mergeExprItems(a, b) {
|
|
97
|
+
if (b === "\"\"") return a;
|
|
98
|
+
if (a === "\"\"") return b;
|
|
99
|
+
if (typeof a == "string") {
|
|
100
|
+
if (b instanceof Name || a[a.length - 1] !== "\"") return;
|
|
101
|
+
if (typeof b != "string") return `${a.slice(0, -1)}${b}"`;
|
|
102
|
+
if (b[0] === "\"") return a.slice(0, -1) + b.slice(1);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (typeof b == "string" && b[0] === "\"" && !(a instanceof Name)) return `"${a}${b.slice(1)}`;
|
|
106
|
+
}
|
|
107
|
+
function strConcat(c1, c2) {
|
|
108
|
+
return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str`${c1}${c2}`;
|
|
109
|
+
}
|
|
110
|
+
exports.strConcat = strConcat;
|
|
111
|
+
function interpolate(x) {
|
|
112
|
+
return typeof x == "number" || typeof x == "boolean" || x === null ? x : safeStringify(Array.isArray(x) ? x.join(",") : x);
|
|
113
|
+
}
|
|
114
|
+
function stringify(x) {
|
|
115
|
+
return new _Code(safeStringify(x));
|
|
116
|
+
}
|
|
117
|
+
exports.stringify = stringify;
|
|
118
|
+
function safeStringify(x) {
|
|
119
|
+
return JSON.stringify(x).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
120
|
+
}
|
|
121
|
+
exports.safeStringify = safeStringify;
|
|
122
|
+
function getProperty(key) {
|
|
123
|
+
return typeof key == "string" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _`[${key}]`;
|
|
124
|
+
}
|
|
125
|
+
exports.getProperty = getProperty;
|
|
126
|
+
function getEsmExportName(key) {
|
|
127
|
+
if (typeof key == "string" && exports.IDENTIFIER.test(key)) return new _Code(`${key}`);
|
|
128
|
+
throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`);
|
|
129
|
+
}
|
|
130
|
+
exports.getEsmExportName = getEsmExportName;
|
|
131
|
+
function regexpCode(rx) {
|
|
132
|
+
return new _Code(rx.toString());
|
|
133
|
+
}
|
|
134
|
+
exports.regexpCode = regexpCode;
|
|
135
|
+
}));
|
|
136
|
+
//#endregion
|
|
137
|
+
export default require_code();
|
|
138
|
+
export { require_code };
|