Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@basketry/sorbet

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@basketry/sorbet - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

57

lib/name-factory.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc