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

@faast/ts-common

Package Overview
Dependencies
Maintainers
3
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@faast/ts-common - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

dist/lib/types/basic.d.ts

2

dist/lib/types/helpers.d.ts
import * as t from 'io-ts';
export declare function partialRecord<KS extends t.KeyofType<any>, T extends t.Any>(k: KS, type: T, name?: string): t.PartialC<Record<keyof KS['keys'], T>>;
export declare function autoImplement<T>(getValues: () => T): new () => T;
export declare const nullable: <T extends t.Mixed>(codec: T) => t.UnionC<[T, t.NullC]>;

@@ -3,0 +5,0 @@ export declare const optional: <T extends t.Mixed>(codec: T) => t.UnionC<[T, t.UndefinedC]>;

import * as t from 'io-ts';
import { map } from 'fp-ts/lib/Record';
import { isEmptyObject } from '#/guards';
export function partialRecord(k, type, name) {
return t.partial(map(k.keys, () => type), name);
}
export function autoImplement(getValues) {
return class {
constructor() {
Object.assign(this, getValues());
}
};
}
export const nullable = (codec) => t.union([codec, t.nullType], `${codec.name}Nullable`);

@@ -4,0 +15,0 @@ export const optional = (codec) => t.union([codec, t.undefined], `${codec.name}Optional`);

export * from './DateT';
export * from './Logger';
export * from './helpers';
export * from './basic';

2

package.json
{
"name": "@faast/ts-common",
"version": "0.2.1",
"version": "0.2.2",
"description": "Common typescript types and utils used by faast",

@@ -5,0 +5,0 @@ "license": "MIT",

import * as t from 'io-ts'
import { map } from 'fp-ts/lib/Record'
import { isEmptyObject } from '#/guards'
export function partialRecord<KS extends t.KeyofType<any>, T extends t.Any>(
k: KS,
type: T,
name?: string,
): t.PartialC<Record<keyof KS['keys'], T>> {
return t.partial(map(k.keys, () => type) as any, name)
}
export function autoImplement<T>(getValues: () => T) {
return class {
constructor() {
Object.assign(this, getValues())
}
} as new () => T
}
export const nullable = <T extends t.Mixed>(codec: T) => t.union([codec, t.nullType], `${codec.name}Nullable`)

@@ -5,0 +22,0 @@ export const optional = <T extends t.Mixed>(codec: T) => t.union([codec, t.undefined], `${codec.name}Optional`)

export * from './DateT'
export * from './Logger'
export * from './helpers'
export * from './basic'

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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