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

@coobaha/typed-fastify

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coobaha/typed-fastify - npm Package Compare versions

Comparing version 2.0.1 to 2.1.0

bin/watcher.d.ts

33

bin/gen.bin.js

@@ -8,21 +8,34 @@ #!/usr/bin/env node

const yargs_1 = __importDefault(require("yargs"));
// @ts-ignore
const helpers_1 = require("yargs/helpers");
const gen_1 = __importDefault(require("./gen"));
const glob_1 = require("glob");
const watcher_1 = require("./watcher");
(0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
.command('gen [files]', 'Generates json schemas next to corresponding ts files', (yargs) => {
yargs
.positional('files', {
describe: 'glob pattern of files',
type: 'string',
demandOption: true,
})
.demandOption(['files']);
}, async (argv) => {
.command('gen [files]', 'Generates json schemas next to corresponding ts files', (yargs) => yargs
.positional('files', {
describe: 'glob pattern of files',
type: 'string',
demandOption: true,
})
.option('watch', {
alias: 'w',
type: 'boolean',
description: 'Watch files for changes',
})
.demandOption(['files'])
.example(`$0 gen -w 'src/example_schema.ts'`, `Generate schemas for example_schema.ts`)
.example(`$0 gen 'src/**/*.ts'`, `Generate schemas for all ts files in src`)
.example(`$0 gen -w 'src/**/*.ts'`, `Watch for changes in src`), async (argv) => {
if (argv.watch) {
console.log('Watching for changes...');
(0, watcher_1.watcher)(argv.files);
return;
}
console.log('Generating schemas...');
const files = await (0, glob_1.glob)(argv.files);
await (0, gen_1.default)({ files });
})
.example(`$0 gen 'src/**/*.ts'`, `Generate schemas for all ts files in src`)
.demandCommand(1, 'You need at least one command before moving on')
.strict().argv;
//# sourceMappingURL=gen.bin.js.map
{
"name": "@coobaha/typed-fastify",
"description": "opinionated types for fastify",
"version": "2.0.1",
"version": "2.1.0",
"bin": {

@@ -11,2 +11,3 @@ "tfs": "bin/gen.bin.js",

"@types/json-schema": "^7.0.13",
"chokidar": "3.5.3",
"crypto-js": "^4.1.1",

@@ -13,0 +14,0 @@ "glob": "^10.3.4",

# Typed Fastify
[![Build Status](https://img.shields.io/github/actions/workflow/status/coobaha/typed-fastify/ci.yml?branch=main&logo=github&style=for-the-badge)](https://github.com/coobaha/typed-fastify/actions/workflows/ci.yml)
[![Build Status](https://img.shields.io/github/actions/workflow/status/coobaha/typed-fastify/main.yml?branch=main&logo=github&style=for-the-badge)](https://github.com/coobaha/typed-fastify/actions/workflows/main.yml)
[![Coverage Status](https://img.shields.io/coveralls/github/Coobaha/typed-fastify.svg?style=for-the-badge)](https://coveralls.io/github/Coobaha/typed-fastify?branch=main)

@@ -8,2 +8,4 @@ [![NPM Version](https://img.shields.io/npm/v/@coobaha/typed-fastify.svg?style=for-the-badge)](https://www.npmjs.com/package/@coobaha/typed-fastify)

**[Online docs](https://coobaha.github.io/typed-fastify/starting-page.html)**
This package adds strong TypeScript support to Fastify request handlers and enforces

@@ -216,2 +218,2 @@ handlers to have typed schema which is used to validate request params and replies. From this schema it does two

- [default fastify AJV options](https://fastify.dev/docs/latest/Reference/Validation-and-Serialization/#validator-compiler)
- [removeAddtitional in AJV](https://ajv.js.org/options.html#removeadditional)
- [removeAddtitional in AJV](https://ajv.js.org/options.html#removeadditional)

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