@compas/code-gen
Advanced tools
Comparing version 0.0.127 to 0.0.128
{ | ||
"name": "@compas/code-gen", | ||
"version": "0.0.127", | ||
"version": "0.0.128", | ||
"description": "Generate various boring parts of your server", | ||
@@ -18,5 +18,5 @@ "main": "./index.js", | ||
"dependencies": { | ||
"@compas/cli": "0.0.127", | ||
"@compas/insight": "0.0.127", | ||
"@compas/stdlib": "0.0.127" | ||
"@compas/cli": "0.0.128", | ||
"@compas/insight": "0.0.128", | ||
"@compas/stdlib": "0.0.128" | ||
}, | ||
@@ -44,3 +44,3 @@ "maintainers": [ | ||
}, | ||
"gitHead": "5bc1438cddeb96b50f0395f7de18ba5c1c5b8c91" | ||
"gitHead": "0ca512dd447ebebc6c6793e2728cfb4c172b0181" | ||
} |
@@ -0,1 +1,2 @@ | ||
import { isNil } from "@compas/stdlib"; | ||
import { TypeBuilder } from "./TypeBuilder.js"; | ||
@@ -23,2 +24,18 @@ | ||
build() { | ||
const result = super.build(); | ||
if ( | ||
!result.validator.floatingPoint && | ||
isNil(result.validator.min) && | ||
isNil(result.validator.max) | ||
) { | ||
// Add default integer sizes when no min & max is specified | ||
result.validator.min = -2_147_483_647; | ||
result.validator.max = 2_147_483_647; | ||
} | ||
return result; | ||
} | ||
/** | ||
@@ -25,0 +42,0 @@ * @param {...number} values |
@@ -25,6 +25,5 @@ import { isNil } from "@compas/stdlib"; | ||
.join("\n") | ||
.replace(/^(\s*\n)+/gm, "\n") // Replace multiple new lines | ||
.replace(/^(\s*\*\s*\n)+/gm, " *\n") // replace empty lines in JSDoc (i.e. line is with ` *`) | ||
.replace(/^(\s*\*.*\n)\s*\n/gm, "$1") // Strip empty new lines after a doc line | ||
.replace(/^\/\*\*\s*(\n\s*\*\s*)+$/gm, "/**\n") // Stip empty lines at the start of a doc block | ||
.replace(/^\/\*\*\s*(\n\s*\*\s*(?=\n))+$/gm, "/**\n") // Strip empty lines at the start of a doc block | ||
.replace(/(\n){3,}/gm, "\n\n"); // Remove too much empty lines | ||
@@ -31,0 +30,0 @@ } |
@@ -161,7 +161,8 @@ import { isNil } from "@compas/stdlib"; | ||
} | ||
return js` | ||
* @returns | ||
{ | ||
${getTypeNameForType(context.context, data[name], "", {})} | ||
}`; | ||
return js`* @returns {${getTypeNameForType( | ||
context.context, | ||
data[name], | ||
"", | ||
{}, | ||
)}}`; | ||
}} | ||
@@ -168,0 +169,0 @@ */ |
Sorry, the diff of this file is too big to display
409576
13243
+ Added@compas/cli@0.0.128(transitive)
+ Added@compas/insight@0.0.128(transitive)
+ Added@compas/stdlib@0.0.128(transitive)
+ Addedc8@7.7.1(transitive)
- Removed@compas/cli@0.0.127(transitive)
- Removed@compas/insight@0.0.127(transitive)
- Removed@compas/stdlib@0.0.127(transitive)
- Removedc8@7.7.0(transitive)
Updated@compas/cli@0.0.128
Updated@compas/insight@0.0.128
Updated@compas/stdlib@0.0.128