Socket
Socket
Sign inDemoInstall

@transcend-io/type-utils

Package Overview
Dependencies
Maintainers
7
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@transcend-io/type-utils - npm Package Compare versions

Comparing version 1.1.2 to 1.2.0

12

.yarn/sdks/eslint/package.json
{
"name": "eslint",
"version": "8.10.0-sdk",
"version": "8.55.0-sdk",
"main": "./lib/api.js",
"type": "commonjs"
"type": "commonjs",
"bin": {
"eslint": "./bin/eslint.js"
},
"exports": {
"./package.json": "./package.json",
".": "./lib/api.js",
"./use-at-your-own-risk": "./lib/unsupported-api.js"
}
}

7

.yarn/sdks/prettier/package.json
{
"name": "prettier",
"version": "2.5.1-sdk",
"main": "./index.js",
"type": "commonjs"
"version": "3.1.0-sdk",
"main": "./index.cjs",
"type": "commonjs",
"bin": "./bin/prettier.cjs"
}
{
"name": "typescript",
"version": "4.5.5-sdk",
"version": "5.3.2-sdk",
"main": "./lib/typescript.js",
"type": "commonjs"
"type": "commonjs",
"bin": {
"tsc": "./bin/tsc",
"tsserver": "./bin/tsserver"
}
}

@@ -18,3 +18,3 @@ import * as t from 'io-ts';

*/
export declare const dictionary: <D extends t.Mixed, C extends t.Mixed>(keys: D, values: C, name?: string | undefined) => DictionaryC<D, C>;
export declare const dictionary: <D extends t.Mixed, C extends t.Mixed>(keys: D, values: C, name?: string) => DictionaryC<D, C>;
//# sourceMappingURL=dictionary.d.ts.map
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

@@ -20,3 +20,3 @@ import * as t from 'io-ts';

/** Override types */
export declare type FixedLengthArray<C extends t.Mixed> = t.TypeOf<t.BrandC<t.ArrayC<C>, FixedLengthArrayBrand<C>>>;
export type FixedLengthArray<C extends t.Mixed> = t.TypeOf<t.BrandC<t.ArrayC<C>, FixedLengthArrayBrand<C>>>;
//# sourceMappingURL=FixedLengthArray.d.ts.map
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

import * as t from 'io-ts';
/** The type refinement for encoding/decoding strings of fixed length */
export declare type FixedLengthStringBrand<N extends number> = {
export type FixedLengthStringBrand<N extends number> = {
/** The length of the string */

@@ -17,3 +17,3 @@ readonly length: N;

/** Override types */
export declare type FixedLengthString<N extends number> = t.TypeOf<t.BrandC<t.StringC, FixedLengthStringBrand<N>>>;
export type FixedLengthString<N extends number> = t.TypeOf<t.BrandC<t.StringC, FixedLengthStringBrand<N>>>;
//# sourceMappingURL=FixedLengthString.d.ts.map
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

import * as t from 'io-ts';
/** The type refinement for encoding/decoding non-empty strings */
declare type NonEmptyStringBrand = {
type NonEmptyStringBrand = {
/** Unique symbol to ensure uniqueness of this type across modules/packages */

@@ -10,4 +10,4 @@ readonly NonEmptyString: symbol;

/** Override types */
export declare type NonEmptyString = t.TypeOf<typeof NonEmptyString>;
export type NonEmptyString = t.TypeOf<typeof NonEmptyString>;
export {};
//# sourceMappingURL=NonEmptyString.d.ts.map
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

@@ -16,3 +16,3 @@ import * as t from 'io-ts';

*/
export declare const partialRecord: <D extends t.Mixed, C extends t.Mixed>(domain: D, codomain: C, name?: string | undefined) => PartialRecordC<D, C>;
export declare const partialRecord: <D extends t.Mixed, C extends t.Mixed>(domain: D, codomain: C, name?: string) => PartialRecordC<D, C>;
//# sourceMappingURL=partialRecord.d.ts.map
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

@@ -5,3 +5,3 @@ import type { ObjByString } from './types';

*/
export declare type Enumerate<T = string, TKey extends string = string> = {
export type Enumerate<T = string, TKey extends string = string> = {
[key in TKey]: T;

@@ -12,3 +12,3 @@ };

*/
export declare type TypescriptEnum = {
export type TypescriptEnum = {
[key in string]: string;

@@ -21,3 +21,3 @@ } | {

*/
export declare type EnumInput<T, TKey extends string = string> = Enumerate<T, TKey> | string[];
export type EnumInput<T, TKey extends string = string> = Enumerate<T, TKey> | string[];
/**

@@ -24,0 +24,0 @@ * Convert a list of strings to an "enum" object

@@ -19,3 +19,3 @@ /**

*/
export declare type HttpMethod = typeof HttpMethod[keyof typeof HttpMethod];
export type HttpMethod = typeof HttpMethod[keyof typeof HttpMethod];
//# sourceMappingURL=enums.d.ts.map

@@ -8,3 +8,3 @@ /**

*/
export declare type Gql<TGraphQLType extends object> = string & {
export type Gql<TGraphQLType extends object> = string & {
/** The typescript type definition that relates to the gql */

@@ -11,0 +11,0 @@ graphQLType: TGraphQLType;

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

/**
* An arbitrary object keyed by strings for naming consistency
*/
export declare type ObjByString = {
export type ObjByString = {
[key in string]: any;

@@ -10,27 +10,27 @@ };

*/
export declare type AnyFunction = (...args: any[]) => any;
export type AnyFunction = (...args: any[]) => any;
/**
* An arbitrary array
*/
export declare type AnyArray = any[];
export type AnyArray = any[];
/**
* The type of the underlying array
*/
export declare type ArrType<TData extends AnyArray> = TData extends (infer DataT)[] ? DataT : never;
export type ArrType<TData extends AnyArray> = TData extends (infer DataT)[] ? DataT : never;
/**
* The type of the underlying promise
*/
export declare type PromiseType<TData> = TData extends Promise<infer R> ? R : TData;
export type PromiseType<TData> = TData extends Promise<infer R> ? R : TData;
/**
* The type of the underlying array
*/
export declare type ArrOrIdentityType<TData> = TData extends (infer DataT)[] ? DataT : TData;
export type ArrOrIdentityType<TData> = TData extends (infer DataT)[] ? DataT : TData;
/**
* Helper to create type or type[]
*/
export declare type OrArray<T> = T | T[];
export type OrArray<T> = T | T[];
/**
* To make the inspected type more tractable than a bunch of intersections
*/
export declare type Identity<T> = {
export type Identity<T> = {
[K in keyof T]: T[K];

@@ -41,3 +41,3 @@ };

*/
export declare type RecursiveIdentity<T> = T extends AnyArray ? ArrType<T> extends object ? Identity<ArrType<T>>[] : T : T extends string ? T : T extends object ? {
export type RecursiveIdentity<T> = T extends AnyArray ? ArrType<T> extends object ? Identity<ArrType<T>>[] : T : T extends string ? T : T extends object ? {
[K in keyof T]: T[K] extends object ? Identity<T[K]> : T[K];

@@ -48,7 +48,7 @@ } : T;

*/
export declare type Optionalize<T, K extends keyof T> = Identity<Omit<T, K> & Partial<T>>;
export type Optionalize<T, K extends keyof T> = Identity<Omit<T, K> & Partial<T>>;
/**
* Make select arguments of a type required
*/
export declare type Requirize<T, K extends keyof T> = Identity<Omit<T, K> & Required<{
export type Requirize<T, K extends keyof T> = Identity<Omit<T, K> & Required<{
[P in K]: T[P];

@@ -59,3 +59,3 @@ }>>;

*/
export declare type Stringify<T, K extends keyof T> = Omit<T, K> & {
export type Stringify<T, K extends keyof T> = Omit<T, K> & {
[P in keyof T]: string;

@@ -66,11 +66,11 @@ };

*/
export declare type StringKeys<TObj extends ObjByString> = Extract<keyof TObj, string>;
export type StringKeys<TObj extends ObjByString> = Extract<keyof TObj, string>;
/**
* Extract associated values of string keys
*/
export declare type StringValues<TObj extends ObjByString> = TObj[keyof TObj];
export type StringValues<TObj extends ObjByString> = TObj[keyof TObj];
/**
* String keys without extends enforcement
*/
export declare type StringKeysSafe<T> = T extends ObjByString ? StringKeys<T> : undefined;
export type StringKeysSafe<T> = T extends ObjByString ? StringKeys<T> : undefined;
/**

@@ -82,3 +82,3 @@ * Extract the sub types of an object, based on some condition.

*/
export declare type SubType<Base, Condition> = Pick<Base, {
export type SubType<Base, Condition> = Pick<Base, {
[Key in keyof Base]: Base[Key] extends Condition ? Key : never;

@@ -89,3 +89,3 @@ }[keyof Base]>;

*/
export declare type SubNotType<Base, Condition> = Pick<Base, {
export type SubNotType<Base, Condition> = Pick<Base, {
[Key in keyof Base]: Base[Key] extends Condition ? never : Key;

@@ -96,7 +96,7 @@ }[keyof Base]>;

*/
export declare type SubTypeRequired<Base, Condition> = SubType<Required<Base>, Condition>;
export type SubTypeRequired<Base, Condition> = SubType<Required<Base>, Condition>;
/**
* Names of properties in T with types that include undefined
*/
declare type OptionalPropertyNames<T> = {
type OptionalPropertyNames<T> = {
[K in keyof T]: undefined extends T[K] ? K : never;

@@ -107,3 +107,3 @@ }[keyof T];

*/
declare type SpreadProperties<L, R, K extends keyof L & keyof R> = {
type SpreadProperties<L, R, K extends keyof L & keyof R> = {
[P in K]: L[P] | Exclude<R[P], undefined>;

@@ -114,11 +114,11 @@ };

*/
export declare type Spread<L, R> = Identity<Pick<L, Exclude<keyof L, keyof R>> & Pick<R, Exclude<keyof R, OptionalPropertyNames<R>>> & Pick<R, Exclude<OptionalPropertyNames<R>, keyof L>> & SpreadProperties<L, R, OptionalPropertyNames<R> & keyof L>>;
export type Spread<L, R> = Identity<Pick<L, Exclude<keyof L, keyof R>> & Pick<R, Exclude<keyof R, OptionalPropertyNames<R>>> & Pick<R, Exclude<OptionalPropertyNames<R>, keyof L>> & SpreadProperties<L, R, OptionalPropertyNames<R> & keyof L>>;
/**
* Soft spread
*/
export declare type Merge<L, R> = Identity<Pick<L, Exclude<keyof L, keyof R>> & R>;
export type Merge<L, R> = Identity<Pick<L, Exclude<keyof L, keyof R>> & R>;
/**
* Convert unions to intersection
*/
export declare type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
/**

@@ -130,3 +130,3 @@ * Loop over an object and recursively replace all values.

*/
export declare type RecursiveTypeReplace<T, TReplace, TReplaceWith> = T extends Promise<infer R> ? Promise<RecursiveTypeReplace<R, TReplace, TReplaceWith>> : T extends (...args: infer ArgsR) => infer ReturnR ? (...args: ArgsR) => RecursiveTypeReplace<ReturnR, TReplace, TReplaceWith> : T extends RegExp ? T : Extract<T, string> extends never ? {
export type RecursiveTypeReplace<T, TReplace, TReplaceWith> = T extends Promise<infer R> ? Promise<RecursiveTypeReplace<R, TReplace, TReplaceWith>> : T extends (...args: infer ArgsR) => infer ReturnR ? (...args: ArgsR) => RecursiveTypeReplace<ReturnR, TReplace, TReplaceWith> : T extends RegExp ? T : Extract<T, string> extends never ? {
[k in keyof T]: RecursiveTypeReplace<T[k], TReplace, TReplaceWith>;

@@ -139,3 +139,3 @@ } : Exclude<{

*/
export declare type RecursiveObjectReplace<TBase, TReplaceCondition, TReplaceWith> = TBase extends TReplaceCondition ? TReplaceWith : TBase extends (infer R)[] ? RecursiveObjectReplace<R, TReplaceCondition, TReplaceWith> : TBase extends object ? {
export type RecursiveObjectReplace<TBase, TReplaceCondition, TReplaceWith> = TBase extends TReplaceCondition ? TReplaceWith : TBase extends (infer R)[] ? RecursiveObjectReplace<R, TReplaceCondition, TReplaceWith> : TBase extends object ? {
[k in keyof TBase]: TBase[k] extends (infer R)[][] ? RecursiveObjectReplace<R, TReplaceCondition, TReplaceWith>[][] : TBase[k] extends (infer R)[][] | undefined ? RecursiveObjectReplace<R, TReplaceCondition, TReplaceWith>[][] | undefined : TBase[k] extends (infer R)[] ? RecursiveObjectReplace<R, TReplaceCondition, TReplaceWith>[] : TBase[k] extends (infer R)[] | undefined ? RecursiveObjectReplace<R, TReplaceCondition, TReplaceWith>[] | undefined : TBase[k] extends TReplaceCondition ? TReplaceWith : TBase[k] extends TReplaceCondition | undefined ? TReplaceWith | undefined : RecursiveObjectReplace<TBase[k], TReplaceCondition, TReplaceWith>;

@@ -146,3 +146,3 @@ } : TBase;

*/
export declare type Nullable<T> = {
export type Nullable<T> = {
[K in keyof T]: T[K] | null;

@@ -153,3 +153,3 @@ };

*/
export declare type DeepPartial<T> = {
export type DeepPartial<T> = {
[P in keyof T]?: DeepPartial<T[P]>;

@@ -162,8 +162,8 @@ };

*/
export declare type Awaited<T> = T extends PromiseLike<infer U> ? U : T;
export type Awaited<T> = T extends PromiseLike<infer U> ? U : T;
/**
* Utility type that passes through the interface given that its keys are exactly equal to the keys string union
*/
export declare type KeysStrictlyEqual<Keys extends string, Interface extends [keyof Interface] extends [Keys] ? [Keys] extends [keyof Interface] ? unknown : never : never> = Interface;
export type KeysStrictlyEqual<Keys extends string, Interface extends [keyof Interface] extends [Keys] ? [Keys] extends [keyof Interface] ? unknown : never : never> = Interface;
export {};
//# sourceMappingURL=types.d.ts.map
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

@@ -5,3 +5,3 @@ {

"description": "Small package containing useful typescript utilities.",
"version": "1.1.2",
"version": "1.2.0",
"homepage": "https://github.com/transcend-io/type-utils",

@@ -21,34 +21,34 @@ "repository": {

"update:deps": "yarn upgrade-interactive && yarn update:sdks",
"build": "yarn pnpify tsc --build",
"clean": "yarn pnpify tsc --build --clean",
"lint": "yarn pnpify eslint src --ext .ts",
"build": "yarn tsc --build",
"clean": "yarn tsc --build --clean",
"lint": "yarn eslint src --ext .ts",
"prepublish": "yarn build",
"test": "yarn pnpify mocha './src/**/*.test.ts'"
"test": "yarn mocha './src/**/*.test.ts'"
},
"dependencies": {
"fp-ts": "^2.11.8",
"io-ts": "^2.2.16"
"fp-ts": "^2.16.1",
"io-ts": "^2.2.21"
},
"devDependencies": {
"@types/chai": "^4.3.0",
"@types/json-schema": "^7.0.11",
"@types/mocha": "^9.1.0",
"@typescript-eslint/eslint-plugin": "^5.12.1",
"@typescript-eslint/parser": "^5.12.1",
"@yarnpkg/pnpify": "^3.1.1",
"@yarnpkg/sdks": "^2.6.0",
"chai": "^4.3.6",
"depcheck": "^1.4.3",
"eslint": "^8.10.0",
"@types/chai": "^4.3.11",
"@types/json-schema": "^7.0.15",
"@types/mocha": "^10.0.6",
"@typescript-eslint/eslint-plugin": "^6.13.2",
"@typescript-eslint/parser": "^6.13.2",
"@yarnpkg/pnpify": "^4.0.1",
"@yarnpkg/sdks": "^3.1.0",
"chai": "^4.3.10",
"depcheck": "^1.4.7",
"eslint": "^8.55.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-import-resolver-typescript": "^2.5.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-jsdoc": "^37.9.4",
"mocha": "^9.2.1",
"prettier": "^2.5.1",
"ts-node": "^10.5.0",
"typescript": "^4.5.5"
"eslint-plugin-import": "2.29.0",
"eslint-plugin-jsdoc": "^46.9.0",
"mocha": "^10.2.0",
"prettier": "^3.1.0",
"ts-node": "^10.9.1",
"typescript": "^5.3.2"
},
"packageManager": "yarn@3.2.0"
"packageManager": "yarn@4.0.2"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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