cis-api-tool
Version:
根据 swagger/yapi/apifox 的接口定义生成 TypeScript/JavaScript 的接口类型及其请求函数代码。
731 lines (729 loc) • 24.7 kB
JavaScript
const require_chunk = require('./chunk-nOFOJqeH.js');
const require_function = require('./function-Cr5WSwXg.js');
const require_types = require('./types-ufzJEJtt.js');
const require_helpers = require('./helpers-CkwKrNWm.js');
const url = require_chunk.__toESM(require("url"));
const lodash_isEmpty = require_chunk.__toESM(require("lodash/isEmpty"));
const consola = require_chunk.__toESM(require("consola"));
const fs_extra = require_chunk.__toESM(require("fs-extra"));
const path = require_chunk.__toESM(require("path"));
const lodash_castArray = require_chunk.__toESM(require("lodash/castArray"));
const lodash_cloneDeep = require_chunk.__toESM(require("lodash/cloneDeep"));
const lodash_memoize = require_chunk.__toESM(require("lodash/memoize"));
const json_schema_to_typescript = require_chunk.__toESM(require("json-schema-to-typescript"));
const json5 = require_chunk.__toESM(require("json5"));
const lodash_forOwn = require_chunk.__toESM(require("lodash/forOwn"));
const lodash_isArray = require_chunk.__toESM(require("lodash/isArray"));
const lodash_isObject = require_chunk.__toESM(require("lodash/isObject"));
const lodash_mapKeys = require_chunk.__toESM(require("lodash/mapKeys"));
const node_fetch = require_chunk.__toESM(require("node-fetch"));
const prettier = require_chunk.__toESM(require("prettier"));
const proxy_agent = require_chunk.__toESM(require("proxy-agent"));
const pinyin_pro = require_chunk.__toESM(require("pinyin-pro"));
const to_json_schema = require_chunk.__toESM(require("to-json-schema"));
//#region src/utils.ts
/**
* @description 抛出错误。
* @param msg 错误信息
*/
function throwError(...msg) {
/* istanbul ignore next */
throw new Error(msg.join(""));
}
/**
* @description 将路径统一为 unix 风格的路径。
* @param path 路径
* @returns unix 风格的路径
*/
function toUnixPath(path$2) {
return path$2.replace(/[/\\]+/g, "/");
}
/**
* @description 获得规范化的相对路径。
* @param from 来源路径
* @param to 去向路径
* @returns 相对路径
*/
function getNormalizedRelativePath(from, to) {
return toUnixPath(path.default.relative(path.default.dirname(from), to)).replace(/^(?=[^.])/, "./").replace(/\.(ts|js)x?$/i, "");
}
/**
* @description 原地遍历 JSONSchema。
*/
function traverseJsonSchema(jsonSchema, cb, currentPath = []) {
/* istanbul ignore if */
if (!(0, lodash_isObject.default)(jsonSchema)) return jsonSchema;
if ((0, lodash_isArray.default)(jsonSchema.properties)) jsonSchema.properties = jsonSchema.properties.reduce((props, js) => {
props[js.name] = js;
return props;
}, {});
cb(jsonSchema, currentPath);
if (jsonSchema.properties) (0, lodash_forOwn.default)(jsonSchema.properties, (item, key) => {
traverseJsonSchema(item, cb, [...currentPath, key]);
return void 0;
});
if (jsonSchema.items) (0, lodash_castArray.default)(jsonSchema.items).forEach((item, index) => traverseJsonSchema(item, cb, [...currentPath, index]));
if (jsonSchema.oneOf) jsonSchema.oneOf.forEach((item) => traverseJsonSchema(item, cb, currentPath));
if (jsonSchema.anyOf) jsonSchema.anyOf.forEach((item) => traverseJsonSchema(item, cb, currentPath));
if (jsonSchema.allOf) jsonSchema.allOf.forEach((item) => traverseJsonSchema(item, cb, currentPath));
return jsonSchema;
}
/**
* @description 原地处理 JSONSchema。
* @param jsonSchema 待处理的 JSONSchema
* @returns 处理后的 JSONSchema
*/
function processJsonSchema(jsonSchema, customTypeMapping) {
return traverseJsonSchema(jsonSchema, (jsonSchema$1) => {
delete jsonSchema$1.$ref;
delete jsonSchema$1.$$ref;
if (jsonSchema$1.type === "array" && Array.isArray(jsonSchema$1.items) && jsonSchema$1.items.length) jsonSchema$1.items = jsonSchema$1.items[0];
if (jsonSchema$1.type) {
const typeMapping = {
byte: "integer",
short: "integer",
int: "integer",
long: "integer",
float: "number",
double: "number",
bigdecimal: "number",
char: "string",
void: "null",
...(0, lodash_mapKeys.default)(customTypeMapping, (_, key) => key.toLowerCase())
};
const isMultiple = Array.isArray(jsonSchema$1.type);
const types = (0, lodash_castArray.default)(jsonSchema$1.type).map((type) => {
type = type.toLowerCase();
type = typeMapping[type] || type;
return type;
});
jsonSchema$1.type = isMultiple ? types : types[0];
}
if (jsonSchema$1.properties) {
(0, lodash_forOwn.default)(jsonSchema$1.properties, (_, prop) => {
const propDef = jsonSchema$1.properties[prop];
delete jsonSchema$1.properties[prop];
jsonSchema$1.properties[prop.trim()] = propDef;
});
if (Array.isArray(jsonSchema$1.required)) jsonSchema$1.required = jsonSchema$1.required.map((prop) => prop.trim());
}
return jsonSchema$1;
});
}
/**
* @description 获取适用于 JSTT 的 JSONSchema。
* @param jsonSchema 待处理的 JSONSchema
* @returns 适用于 JSTT 的 JSONSchema
*/
function jsonSchemaToJSTTJsonSchema(jsonSchema, typeName) {
if (jsonSchema) delete jsonSchema.description;
return traverseJsonSchema(jsonSchema, (jsonSchema$1, currentPath) => {
const refValue = jsonSchema$1.title == null ? jsonSchema$1.description : jsonSchema$1.title;
if (refValue?.startsWith("&")) {
const typeRelativePath = refValue.substring(1);
const typeAbsolutePath = toUnixPath(path.default.resolve(path.default.dirname(`/${currentPath.join("/")}`.replace(/\/{2,}/g, "/")), typeRelativePath).replace(/^[a-z]+:/i, ""));
const typeAbsolutePathArr = typeAbsolutePath.split("/").filter(Boolean);
let tsTypeLeft = "";
let tsTypeRight = typeName;
for (const key of typeAbsolutePathArr) {
tsTypeLeft += "NonNullable<";
tsTypeRight += `[${JSON.stringify(key)}]>`;
}
const tsType = `${tsTypeLeft}${tsTypeRight}`;
jsonSchema$1.tsType = tsType;
}
delete jsonSchema$1.title;
delete jsonSchema$1.id;
delete jsonSchema$1.minItems;
delete jsonSchema$1.maxItems;
if (jsonSchema$1.type === "object") jsonSchema$1.additionalProperties = false;
delete jsonSchema$1.default;
return jsonSchema$1;
});
}
/**
* @description 将 JSONSchema 字符串转为 JSONSchema 对象。
*jsonSchemaStringToJsonSchema @param str 要转换的 JSONSchema 字符串
* @returns 转换后的 JSONSchema 对象
*/
function jsonSchemaStringToJsonSchema(str, customTypeMapping) {
return processJsonSchema(JSON.parse(str), customTypeMapping);
}
/**
* @description 获得 JSON 数据的 JSONSchema 对象。
* @param json JSON 数据
* @returns JSONSchema 对象
*/
function jsonToJsonSchema(json, customTypeMapping) {
const schema = (0, to_json_schema.default)(json, {
required: false,
arrays: { mode: "first" },
objects: { additionalProperties: false },
strings: { detectFormat: false },
postProcessFnc: (type, schema$1, value) => {
if (!schema$1.description && !!value && type !== "object") schema$1.description = JSON.stringify(value);
return schema$1;
}
});
delete schema.description;
return processJsonSchema(schema, customTypeMapping);
}
/**
* @description 获得 mockjs 模板的 JSONSchema 对象。
* @param template mockjs 模板
* @returns JSONSchema 对象
*/
function mockjsTemplateToJsonSchema(template, customTypeMapping) {
const actions = [];
const keyRe = /(.+)\|(?:\+(\d+)|([+-]?\d+-?[+-]?\d*)?(?:\.(\d+-?\d*))?)/;
const numberPatterns = [
"natural",
"integer",
"float",
"range",
"increment"
];
const boolPatterns = ["boolean", "bool"];
const normalizeValue = (value) => {
if (typeof value === "string" && value.startsWith("@")) {
const pattern = value.slice(1);
if (numberPatterns.some((p) => pattern.startsWith(p))) return 1;
if (boolPatterns.some((p) => pattern.startsWith(p))) return true;
}
return value;
};
require_function.traverse(template, (value, key, parent) => {
if (typeof key === "string") actions.push(() => {
delete parent[key];
parent[key.replace(keyRe, "$1")] = normalizeValue(value);
});
});
actions.forEach((action) => action());
return jsonToJsonSchema(template, customTypeMapping);
}
/**
* @description 获得属性定义列表的 JSONSchema 对象。
* @param propDefinitions 属性定义列表
* @returns JSONSchema 对象
*/
function propDefinitionsToJsonSchema(propDefinitions, customTypeMapping) {
return processJsonSchema({
type: "object",
required: propDefinitions.reduce((res, prop) => {
if (prop.required) res.push(prop.name);
return res;
}, []),
properties: propDefinitions.reduce((res, prop) => {
if (prop.schema) res[prop.name] = {
...prop.schema,
description: prop.comment,
...prop.schema.type === "file" ? { tsType: require_helpers.FileData.name } : {}
};
else res[prop.name] = {
type: prop.type,
description: prop.comment,
...prop.type === "file" ? { tsType: require_helpers.FileData.name } : {}
};
return res;
}, {})
}, customTypeMapping);
}
const JSTTOptions = {
bannerComment: "",
style: {
bracketSpacing: false,
printWidth: 120,
semi: true,
singleQuote: true,
tabWidth: 4,
trailingComma: "none",
useTabs: false
}
};
/**
* @description 根据 JSONSchema 对象生产 TypeScript 类型定义。
* @param jsonSchema JSONSchema 对象
* @param typeName 类型名称
* @returns TypeScript 类型定义
*/
async function jsonSchemaToType(jsonSchema, typeName) {
if ((0, lodash_isEmpty.default)(jsonSchema)) return `export interface ${typeName} {}`;
if (jsonSchema.__is_any__) {
delete jsonSchema.__is_any__;
return `export type ${typeName} = any`;
}
const fakeTypeName = "THISISAFAKETYPENAME";
const code = await (0, json_schema_to_typescript.compile)(jsonSchemaToJSTTJsonSchema((0, lodash_cloneDeep.default)(jsonSchema), typeName), fakeTypeName, JSTTOptions);
return code.replace(fakeTypeName, typeName).trim();
}
function getRequestDataJsonSchema(interfaceInfo, customTypeMapping) {
let jsonSchema;
if (isPostLikeMethod(interfaceInfo.method)) switch (interfaceInfo.req_body_type) {
case require_types.RequestBodyType.form:
jsonSchema = propDefinitionsToJsonSchema(interfaceInfo.req_body_form.map((item) => ({
name: item.name,
required: item.required === require_types.Required.true,
type: item.type === require_types.RequestFormItemType.file ? "file" : "string",
comment: item.desc
})), customTypeMapping);
break;
case require_types.RequestBodyType.json:
if (interfaceInfo.req_body_other) jsonSchema = interfaceInfo.req_body_is_json_schema ? jsonSchemaStringToJsonSchema(interfaceInfo.req_body_other, customTypeMapping) : jsonToJsonSchema(json5.default.parse(interfaceInfo.req_body_other), customTypeMapping);
break;
default:
/* istanbul ignore next */
break;
}
if ((0, lodash_isArray.default)(interfaceInfo.req_query) && interfaceInfo.req_query.length) {
const queryJsonSchema = propDefinitionsToJsonSchema(interfaceInfo.req_query.map((item) => ({
name: item.name,
required: item.required === require_types.Required.true,
type: item.type || "string",
comment: item.desc,
schema: item.schema
})), customTypeMapping);
/* istanbul ignore else */
if (jsonSchema) {
jsonSchema.properties = {
...jsonSchema.properties,
...queryJsonSchema.properties
};
jsonSchema.required = [...Array.isArray(jsonSchema.required) ? jsonSchema.required : [], ...Array.isArray(queryJsonSchema.required) ? queryJsonSchema.required : []];
} else jsonSchema = queryJsonSchema;
}
if ((0, lodash_isArray.default)(interfaceInfo.req_params) && interfaceInfo.req_params.length) {
const paramsJsonSchema = propDefinitionsToJsonSchema(interfaceInfo.req_params.map((item) => ({
name: item.name,
required: true,
type: item.type || "string",
comment: item.desc,
schema: item.schema
})), customTypeMapping);
/* istanbul ignore else */
if (jsonSchema) {
jsonSchema.properties = {
...jsonSchema.properties,
...paramsJsonSchema.properties
};
jsonSchema.required = [...Array.isArray(jsonSchema.required) ? jsonSchema.required : [], ...Array.isArray(paramsJsonSchema.required) ? paramsJsonSchema.required : []];
} else jsonSchema = paramsJsonSchema;
}
return jsonSchema || {};
}
/**
* @description 获得响应数据 JSONSchema 对象。
* @param interfaceInfo 接口信息
* @param customTypeMapping 自定义类型映射
* @param dataKey 数据键
* @returns 响应数据 JSONSchema 对象
*/
function getResponseDataJsonSchema(interfaceInfo, customTypeMapping, dataKey) {
let jsonSchema = {};
switch (interfaceInfo.res_body_type) {
case require_types.ResponseBodyType.json:
if (interfaceInfo.res_body) jsonSchema = interfaceInfo.res_body_is_json_schema ? jsonSchemaStringToJsonSchema(interfaceInfo.res_body, customTypeMapping) : mockjsTemplateToJsonSchema(json5.default.parse(interfaceInfo.res_body), customTypeMapping);
break;
default:
jsonSchema = { __is_any__: true };
break;
}
if (dataKey && jsonSchema) jsonSchema = reachJsonSchema(jsonSchema, dataKey);
return jsonSchema;
}
/**
* @description 获取 JSONSchema 对象的指定路径。
* @param jsonSchema JSONSchema 对象
* @param path 路径
* @returns 指定路径的 JSONSchema 对象
*/
function reachJsonSchema(jsonSchema, path$2) {
let last = jsonSchema;
for (const segment of (0, lodash_castArray.default)(path$2)) {
const _last = last.properties?.[segment];
if (!_last) return jsonSchema;
last = _last;
}
return last;
}
/**
* @description 根据权重排序。
* @param list 列表
* @returns 排序后的列表
*/
function sortByWeights(list) {
list.sort((a, b) => {
const x = a.weights.length > b.weights.length ? b : a;
const minLen = Math.min(a.weights.length, b.weights.length);
const maxLen = Math.max(a.weights.length, b.weights.length);
x.weights.push(...new Array(maxLen - minLen).fill(0));
const w = a.weights.reduce((w$1, _, i) => {
if (w$1 === 0) w$1 = a.weights[i] - b.weights[i];
return w$1;
}, 0);
return w;
});
return list;
}
/**
* @description 判断是否为 GET 类请求。
* @param method 请求方式
* @returns 是否为 GET 类请求
*/
function isGetLikeMethod(method) {
return method === require_types.Method.GET || method === require_types.Method.OPTIONS || method === require_types.Method.HEAD;
}
/**
* @description 判断是否为 POST 类请求。
* @param method 请求方式
* @returns 是否为 POST 类请求
*/
function isPostLikeMethod(method) {
return !isGetLikeMethod(method);
}
/**
* @description 获取 prettier 配置。
* @param cwd 当前工作目录
* @returns prettier 配置
*/
async function getPrettier(cwd) {
const projectPrettierPath = path.default.join(cwd, "node_modules/prettier");
if (await fs_extra.default.pathExists(projectPrettierPath)) return require(projectPrettierPath);
return require("prettier");
}
/**
* @description 获取 prettier 配置。
* @returns prettier 配置
*/
async function getPrettierOptions() {
const prettierOptions = {
parser: "typescript",
printWidth: 120,
tabWidth: 4,
singleQuote: true,
semi: false,
trailingComma: "all",
bracketSpacing: false,
endOfLine: "lf"
};
if (process.env.JEST_WORKER_ID) return prettierOptions;
const [prettierConfigPathErr, prettierConfigPath] = await (async () => {
const [err, path$2] = await prettier.default.resolveConfigFile();
consola.default.debug("获取 prettier 配置路径", path$2);
return [err, path$2];
})();
if (prettierConfigPathErr || !prettierConfigPath) return prettierOptions;
const [prettierConfigErr, prettierConfig] = await (async () => {
const [err, config] = await prettier.default.resolveConfig(prettierConfigPath);
return [err, config];
})();
if (prettierConfigErr || !prettierConfig) return prettierOptions;
return {
...prettierOptions,
...prettierConfig,
parser: "typescript"
};
}
/**
* @description 获取缓存的 prettier 配置。
* @returns prettier 配置
*/
const getCachedPrettierOptions = (0, lodash_memoize.default)(getPrettierOptions);
/**
* @description 获取 HTTP 请求。
* @param url 请求 URL
* @param query 请求参数
* @returns 请求结果
*/
async function httpGet(url$1, query) {
const _url = new url.URL(url$1);
if (query) Object.keys(query).forEach((key) => {
_url.searchParams.set(key, query[key]);
});
url$1 = _url.toString();
const res = await (0, node_fetch.default)(url$1, {
method: "GET",
agent: new proxy_agent.default()
});
return res.json();
}
/**
* @description 生成请求函数名称
* @param interfaceInfo 接口信息
* @param changeCase 大小写转换函数
* @returns 请求函数名称
*/
function getRequestFunctionName(interfaceInfo, changeCase) {
const _method = interfaceInfo.method || "get";
const methodPrefix = _method.toLowerCase();
let path$2 = interfaceInfo.path;
path$2 = path$2.replace(/^\/+/, "").replace(/^api\/+/, "");
path$2 = path$2.replace(/\{([^}]+)\}/g, (_, param) => `By${changeCase.pascalCase(param)}`);
const pathSegments = path$2.split("/").filter(Boolean);
const pathPart = pathSegments.map((segment) => changeCase.pascalCase(segment)).join("");
return `${methodPrefix}${pathPart}Api`;
}
/**
* @description 生成请求数据类型名称
* @param interfaceInfo 接口信息
* @param changeCase 大小写转换函数
* @returns 请求数据类型名称
*/
function getRequestDataTypeName(interfaceInfo, changeCase) {
const _method = interfaceInfo.method || "get";
const methodPrefix = changeCase.pascalCase(_method.toLowerCase());
let path$2 = interfaceInfo.path;
path$2 = path$2.replace(/^\/+/, "").replace(/^api\/+/, "");
path$2 = path$2.replace(/\{([^}]+)\}/g, (_, param) => `By${changeCase.pascalCase(param)}`);
const pathSegments = path$2.split("/").filter(Boolean);
const pathPart = pathSegments.map((segment) => changeCase.pascalCase(segment)).join("");
return `${methodPrefix}${pathPart}RequestType`;
}
/**
* @description 生成响应数据类型名称
* @param interfaceInfo 接口信息
* @param changeCase 大小写转换函数
* @returns 响应数据类型名称
*/
function getReponseDataTypeName(interfaceInfo, changeCase) {
const _method = interfaceInfo.method || "get";
const methodPrefix = changeCase.pascalCase(_method.toLowerCase());
let path$2 = interfaceInfo.path;
path$2 = path$2.replace(/^\/+/, "").replace(/^api\/+/, "");
path$2 = path$2.replace(/\{([^}]+)\}/g, (_, param) => `By${changeCase.pascalCase(param)}`);
const pathSegments = path$2.split("/").filter(Boolean);
const pathPart = pathSegments.map((segment) => changeCase.pascalCase(segment)).join("");
return `${methodPrefix}${pathPart}ResponseType`;
}
function getOutputFilePath(interfaceInfo, changeCase, outputDir = "src/service") {
const dirName = interfaceInfo._category.name;
const dirNameCn = dirName.split("/").filter(Boolean).map((segment) => {
return segment.split("").map((item) => {
return changeCase.upperCaseFirst(changeCase.lowerCase((0, pinyin_pro.pinyin)(item, { toneType: "none" }))).trim();
}).join("");
}).join("/");
return `${outputDir}/${dirNameCn}/index.ts`;
}
function transformPaths(pathsArray, outputDir = "src/service") {
const targetSegments = outputDir.split("/");
return pathsArray.map((originalPath) => {
const normalizedPath = path.default.normalize(originalPath);
const pathSegments = normalizedPath.split(path.default.sep);
let targetIndex = -1;
for (let i = 0; i < pathSegments.length - targetSegments.length + 1; i++) {
let found = true;
for (let j = 0; j < targetSegments.length; j++) if (pathSegments[i + j] !== targetSegments[j]) {
found = false;
break;
}
if (found) {
targetIndex = i;
break;
}
}
if (targetIndex === -1) return `// 无法处理路径: ${originalPath}`;
const relativeSegments = pathSegments.slice(targetIndex + targetSegments.length);
if (relativeSegments.length === 0) return `// 根目录: ${originalPath}`;
const relativePath = "./" + relativeSegments.join("/") + "/index";
return `export * from '${relativePath}'`;
}).filter(Boolean);
}
/**
* 将相对路径转换为 alias 路径
* @param relativePath 相对路径
* @param outputDir 输出目录
* @returns alias 路径
*/
function getAliasPath(relativePath, outputDir = "src/service") {
if (relativePath.startsWith("@/")) return relativePath;
const normalizedPath = relativePath.replace(/\\/g, "/");
if (normalizedPath.includes("/src/")) {
const lastSrcIndex = normalizedPath.lastIndexOf("/src/");
if (lastSrcIndex !== -1) {
const afterSrc = normalizedPath.substring(lastSrcIndex + 5);
const withoutExt = afterSrc.replace(/\.(ts|js|tsx|jsx)$/, "");
return `@/${withoutExt}`;
}
}
return relativePath;
}
/**
* 获取规范化的相对路径,支持 alias 路径
* @param from 源文件路径
* @param to 目标文件路径
* @param outputDir 输出目录
* @returns 规范化的路径
*/
function getNormalizedPathWithAlias(from, to, outputDir = "src/service") {
const aliasPath = getAliasPath(to);
if (aliasPath.startsWith("@/")) return aliasPath;
return getNormalizedRelativePath(from, to);
}
//#endregion
Object.defineProperty(exports, 'getAliasPath', {
enumerable: true,
get: function () {
return getAliasPath;
}
});
Object.defineProperty(exports, 'getCachedPrettierOptions', {
enumerable: true,
get: function () {
return getCachedPrettierOptions;
}
});
Object.defineProperty(exports, 'getNormalizedPathWithAlias', {
enumerable: true,
get: function () {
return getNormalizedPathWithAlias;
}
});
Object.defineProperty(exports, 'getNormalizedRelativePath', {
enumerable: true,
get: function () {
return getNormalizedRelativePath;
}
});
Object.defineProperty(exports, 'getOutputFilePath', {
enumerable: true,
get: function () {
return getOutputFilePath;
}
});
Object.defineProperty(exports, 'getPrettier', {
enumerable: true,
get: function () {
return getPrettier;
}
});
Object.defineProperty(exports, 'getPrettierOptions', {
enumerable: true,
get: function () {
return getPrettierOptions;
}
});
Object.defineProperty(exports, 'getReponseDataTypeName', {
enumerable: true,
get: function () {
return getReponseDataTypeName;
}
});
Object.defineProperty(exports, 'getRequestDataJsonSchema', {
enumerable: true,
get: function () {
return getRequestDataJsonSchema;
}
});
Object.defineProperty(exports, 'getRequestDataTypeName', {
enumerable: true,
get: function () {
return getRequestDataTypeName;
}
});
Object.defineProperty(exports, 'getRequestFunctionName', {
enumerable: true,
get: function () {
return getRequestFunctionName;
}
});
Object.defineProperty(exports, 'getResponseDataJsonSchema', {
enumerable: true,
get: function () {
return getResponseDataJsonSchema;
}
});
Object.defineProperty(exports, 'httpGet', {
enumerable: true,
get: function () {
return httpGet;
}
});
Object.defineProperty(exports, 'isGetLikeMethod', {
enumerable: true,
get: function () {
return isGetLikeMethod;
}
});
Object.defineProperty(exports, 'isPostLikeMethod', {
enumerable: true,
get: function () {
return isPostLikeMethod;
}
});
Object.defineProperty(exports, 'jsonSchemaStringToJsonSchema', {
enumerable: true,
get: function () {
return jsonSchemaStringToJsonSchema;
}
});
Object.defineProperty(exports, 'jsonSchemaToJSTTJsonSchema', {
enumerable: true,
get: function () {
return jsonSchemaToJSTTJsonSchema;
}
});
Object.defineProperty(exports, 'jsonSchemaToType', {
enumerable: true,
get: function () {
return jsonSchemaToType;
}
});
Object.defineProperty(exports, 'jsonToJsonSchema', {
enumerable: true,
get: function () {
return jsonToJsonSchema;
}
});
Object.defineProperty(exports, 'mockjsTemplateToJsonSchema', {
enumerable: true,
get: function () {
return mockjsTemplateToJsonSchema;
}
});
Object.defineProperty(exports, 'processJsonSchema', {
enumerable: true,
get: function () {
return processJsonSchema;
}
});
Object.defineProperty(exports, 'propDefinitionsToJsonSchema', {
enumerable: true,
get: function () {
return propDefinitionsToJsonSchema;
}
});
Object.defineProperty(exports, 'reachJsonSchema', {
enumerable: true,
get: function () {
return reachJsonSchema;
}
});
Object.defineProperty(exports, 'sortByWeights', {
enumerable: true,
get: function () {
return sortByWeights;
}
});
Object.defineProperty(exports, 'throwError', {
enumerable: true,
get: function () {
return throwError;
}
});
Object.defineProperty(exports, 'toUnixPath', {
enumerable: true,
get: function () {
return toUnixPath;
}
});
Object.defineProperty(exports, 'transformPaths', {
enumerable: true,
get: function () {
return transformPaths;
}
});
Object.defineProperty(exports, 'traverseJsonSchema', {
enumerable: true,
get: function () {
return traverseJsonSchema;
}
});