New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

io-ts-from-json-schema

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

io-ts-from-json-schema - npm Package Compare versions

Comparing version 0.0.6-alpha3 to 0.0.6

31

lib/cli.js

@@ -55,3 +55,6 @@ #!/usr/bin/env node

})
.option('importHashLength', { type: 'number', default: 7, hidden: true })
.option('importHashLength', {
type: 'number',
default: 0,
})
.help().argv;

@@ -408,14 +411,24 @@ var imports = argv.import.map(function (imp) { return imp.split('^'); });

}
function importHash(str) {
return crypto
function importBaseName(filePath) {
// eslint-disable-next-line
var _a = __read(filePath.split("/").reverse(), 1), withoutPath = _a[0];
var _b = __read(withoutPath.split('.json'), 1), basefile = _b[0];
var typeName = typenameFromKebab(basefile);
return typeName.concat('_');
}
function importHashName(str) {
if (argv.importHashLength === 0) {
return '';
}
var fullDigest = crypto
.createHash(argv.importHashAlgorithm)
.update(str)
.digest('hex')
.slice(0, argv.importHashLength);
.digest('hex');
var shortDigest = fullDigest.slice(0, argv.importHashLength);
return shortDigest.concat('_');
}
function calculateImportName(filePath, refString) {
// eslint-disable-next-line
var _a = __read(filePath.split("/").reverse(), 1), withoutPath = _a[0];
var _b = __read(withoutPath.split('.json'), 1), basefile = _b[0];
return typenameFromKebab(basefile) + "_" + importHash(refString) + "_";
var baseName = importBaseName(filePath);
var hashName = importHashName(refString);
return baseName.concat(hashName);
}

@@ -422,0 +435,0 @@ function fromRef(refString) {

{
"name": "io-ts-from-json-schema",
"version": "0.0.6-alpha3",
"version": "0.0.6",
"description": "Iotsfjs is a static code generation utility used for converting json schema files into static TypeScript types and io-ts runtime validators.",

@@ -5,0 +5,0 @@ "main": "lib/cli.js",

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