@basketry/sorbet
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -48,6 +48,33 @@ "use strict"; | ||
const arrayify = (n) => type.isArray && !skipArrayify ? `T::Array[${n}]` : n; | ||
if (type.isUnknown) { | ||
return arrayify('T.untyped'); | ||
if (type.isPrimitive) { | ||
const override = (_b = (_a = options === null || options === void 0 ? void 0 : options.sorbet) === null || _a === void 0 ? void 0 : _a.types) === null || _b === void 0 ? void 0 : _b[type.typeName.value]; | ||
if (override) { | ||
return arrayify(override); | ||
} | ||
switch (type.typeName.value) { | ||
case 'null': | ||
return arrayify('nil'); | ||
case 'string': | ||
return arrayify('String'); | ||
case 'number': | ||
return arrayify('Numeric'); | ||
case 'integer': | ||
case 'long': | ||
return arrayify('Integer'); | ||
case 'float': | ||
case 'double': | ||
return arrayify('Float'); | ||
case 'boolean': | ||
return arrayify('T::Boolean'); | ||
case 'date': | ||
return arrayify('Date'); | ||
case 'date-time': | ||
return arrayify('DateTime'); | ||
case 'untyped': | ||
return arrayify('T.untyped'); | ||
default: | ||
return arrayify('T.untyped'); | ||
} | ||
} | ||
else if (type.isLocal) { | ||
else { | ||
let moduleNamespace; | ||
@@ -62,26 +89,2 @@ if (service.types.some((t) => t.name.value === type.typeName.value)) { | ||
} | ||
const override = (_b = (_a = options === null || options === void 0 ? void 0 : options.sorbet) === null || _a === void 0 ? void 0 : _a.types) === null || _b === void 0 ? void 0 : _b[type.typeName.value]; | ||
if (override) { | ||
return arrayify(override); | ||
} | ||
switch (type.typeName.value) { | ||
case 'string': | ||
return arrayify('String'); | ||
case 'number': | ||
return arrayify('Numeric'); | ||
case 'integer': | ||
case 'long': | ||
return arrayify('Integer'); | ||
case 'float': | ||
case 'double': | ||
return arrayify('Float'); | ||
case 'boolean': | ||
return arrayify('T::Boolean'); | ||
case 'date': | ||
return arrayify('Date'); | ||
case 'date-time': | ||
return arrayify('DateTime'); | ||
default: | ||
return arrayify('T.untyped'); | ||
} | ||
} | ||
@@ -88,0 +91,0 @@ exports.buildTypeName = buildTypeName; |
{ | ||
"name": "@basketry/sorbet", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "Basketry generator for generating Sorbet types and interfaces", | ||
@@ -51,3 +51,3 @@ "main": "./lib/index.js", | ||
"dependencies": { | ||
"basketry": "^0.0.17", | ||
"basketry": "^0.0.21", | ||
"case": "^1.6.3", | ||
@@ -54,0 +54,0 @@ "prettier": "^2.5.1" |
Sorry, the diff of this file is not supported yet
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
40585
421
+ Addedbasketry@0.0.21(transitive)
- Removedbasketry@0.0.17(transitive)
Updatedbasketry@^0.0.21