bridge-compile
Advanced tools
Comparing version 1.0.10 to 1.0.11
@@ -26,3 +26,3 @@ "use strict"; | ||
if (matches && matches?.length > 1 && matches[1].includes('routes')) { | ||
console.log(matches[1]); | ||
// console.log(matches[1]); | ||
addedCode = `\nconst bridgeGeneratedVariable = initBridge(${matches[1]});\ntype BridgeGenereatedType = typeof bridgeGeneratedVariable['bridgeType'];\n`; | ||
@@ -29,0 +29,0 @@ await fs_1.default.promises.appendFile(absolute, addedCode, 'utf-8'); |
@@ -61,3 +61,3 @@ "use strict"; | ||
else { | ||
console.log(returnVal); | ||
// console.log(returnVal); | ||
// if the handlers returns void, Bridge returns an empty object instead | ||
@@ -64,0 +64,0 @@ if ('primitive' in returnVal && returnVal.primitive === 'void') |
@@ -16,7 +16,5 @@ "use strict"; | ||
if (typeString === 'ObjectId') { | ||
console.log(typeString); | ||
return { primitive: 'string' }; | ||
} | ||
if (typeString.endsWith('?')) | ||
console.log(typeString); | ||
// if (typeString.endsWith('?')) console.log(typeString); | ||
// Depth 3 is the depth of the return | ||
@@ -23,0 +21,0 @@ if (depth === 7 && (0, recursive_checker_1.isTypeDepthGreaterThan)(checker, type, node, 45)) |
@@ -22,12 +22,14 @@ "use strict"; | ||
return '(' + JSONType.union.map((elem) => (0, exports.JSONTypeToTSInterface)(elem)).join(' | ') + ')'; | ||
if ('intersection' in JSONType) | ||
if ('intersection' in JSONType && JSONType.intersection.length > 0) | ||
return '(' + JSONType.intersection.map((elem) => (0, exports.JSONTypeToTSInterface)(elem)).join(' & ') + ')'; | ||
if ('arrayWithPos' in JSONType) | ||
return '[' + JSONType.arrayWithPos.map((elem) => (0, exports.JSONTypeToTSInterface)(elem)).join(', ') + ']'; | ||
return ('{' + | ||
Object.entries(JSONType.object) | ||
.map(([key, value]) => `${key}${value.optional ? '?' : ''}: ${(0, exports.JSONTypeToTSInterface)(value)}`) | ||
.join(';') + | ||
'}'); | ||
else if ('object' in JSONType) | ||
return ('{' + | ||
Object.entries(JSONType.object) | ||
.map(([key, value]) => `${key}${value.optional ? '?' : ''}: ${(0, exports.JSONTypeToTSInterface)(value)}`) | ||
.join(';') + | ||
'}'); | ||
return 'any'; | ||
}; | ||
exports.JSONTypeToTSInterface = JSONTypeToTSInterface; |
{ | ||
"name": "bridge-compile", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"description": "Compile the sdk of your Bridge project with one command locally", | ||
@@ -5,0 +5,0 @@ "author": "Bridge Team <support@bridge.codes>", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39798