Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@forklaunch/common

Package Overview
Dependencies
Maintainers
1
Versions
143
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@forklaunch/common - npm Package Compare versions

Comparing version
0.1.13
to
0.1.14
+2
lib/guards/isNever.d.ts
export declare function isNever(value: never): value is never;
//# sourceMappingURL=isNever.d.ts.map
{"version":3,"file":"isNever.d.ts","sourceRoot":"","sources":["../../src/guards/isNever.ts"],"names":[],"mappings":"AAAA,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,KAAK,CAEpD"}
export function isNever(value) {
return true;
}
/**
* Check if the given object is a record.
*
* @param {unknown} obj - The object to check.
* @returns {boolean} - True if the object is a record, false otherwise.
*/
export declare function isRecord(obj: unknown): obj is Record<string, unknown>;
//# sourceMappingURL=isRecord.d.ts.map
{"version":3,"file":"isRecord.d.ts","sourceRoot":"","sources":["../../src/guards/isRecord.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAErE"}
/**
* Check if the given object is a record.
*
* @param {unknown} obj - The object to check.
* @returns {boolean} - True if the object is a record, false otherwise.
*/
export function isRecord(obj) {
return obj !== null && typeof obj === 'object' && !Array.isArray(obj);
}
/**
* A type that represents the values of an object type `T`.
*
* This utility type takes an object type `T` and produces a union of its value types.
*
* @template T - The object type to extract values from.
*/
export type FlattenValues<T> = T[keyof T];
/**
* A type that represents the keys of an object type `T`.
*
* This utility type takes an object type `T` and produces a union of its key types.
*
* @template T - The object type to extract keys from.
*/
export type FlattenKeys<T> = keyof T;
/**
* A type that flattens an object type `T`.
*
* This utility type takes an object type `T` and recursively flattens it.
*
* @template T - The object type to flatten.
*/
export type Flatten<T> = T extends object ? {
[K in keyof T]: Flatten<T[K]>;
} : T;
//# sourceMappingURL=flatten.types.d.ts.map
{"version":3,"file":"flatten.types.d.ts","sourceRoot":"","sources":["../../src/types/flatten.types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAE1C;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GACrC;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GACjC,CAAC,CAAC"}
type AllPropertiesOptional<T> = T extends Partial<T> ? (Partial<T> extends T ? true : false) : false;
export type MakePropertyOptionalIfChildrenOptional<T> = {
[K in keyof T as AllPropertiesOptional<T[K]> extends true ? K : never]?: T[K];
} & {
[K in keyof T as AllPropertiesOptional<T[K]> extends true ? never : K]: T[K];
};
export {};
//# sourceMappingURL=makePropertyOptionalIfChildrenOptional.types.d.ts.map
{"version":3,"file":"makePropertyOptionalIfChildrenOptional.types.d.ts","sourceRoot":"","sources":["../../src/types/makePropertyOptionalIfChildrenOptional.types.ts"],"names":[],"mappings":"AAAA,KAAK,qBAAqB,CAAC,CAAC,IAC1B,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC;AAEvE,MAAM,MAAM,sCAAsC,CAAC,CAAC,IAAI;KACrD,CAAC,IAAI,MAAM,CAAC,IAAI,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAC9E,GAAG;KACD,CAAC,IAAI,MAAM,CAAC,IAAI,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GAAG,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAC7E,CAAC"}
/**
* A type that "prettifies" the structure of an object type `T`.
*
* This utility type takes an object type `T` and re-maps its keys and values, effectively creating
* a new type with the same keys and values but without any extra type information or attributes.
* This can be useful for simplifying the displayed type information in development tools.
*
* @template T - The object type to prettify.
*/
export type Prettify<T> = {
[K in keyof T]: T[K];
} & {};
//# sourceMappingURL=prettify.types.d.ts.map
{"version":3,"file":"prettify.types.d.ts","sourceRoot":"","sources":["../../src/types/prettify.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI;KACvB,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACrB,GAAG,EAAE,CAAC"}
export type RemoveTrailingSlash<T extends string> = T extends `${infer Route}/` ? Route : T;
//# sourceMappingURL=removeTrailingSlash.types.d.ts.map
{"version":3,"file":"removeTrailingSlash.types.d.ts","sourceRoot":"","sources":["../../src/types/removeTrailingSlash.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,GAAG,MAAM,KAAK,GAAG,GAC3E,KAAK,GACL,CAAC,CAAC"}
export declare function extractArgumentNames(func: {
toString(): string;
}): string[];
//# sourceMappingURL=extractArgumentNames.d.ts.map
{"version":3,"file":"extractArgumentNames.d.ts","sourceRoot":"","sources":["../../src/utils/extractArgumentNames.ts"],"names":[],"mappings":"AAAA,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IAAE,QAAQ,IAAI,MAAM,CAAA;CAAE,GAAG,MAAM,EAAE,CA+B3E"}
export function extractArgumentNames(func) {
const fnStr = func.toString();
const args = fnStr.match(/\(([^)]*)\)/);
if (!args)
return [];
const argsStr = args[1];
const result = [];
let currentArg = '';
let braceCount = 0;
for (let i = 0; i < argsStr.length; i++) {
const char = argsStr[i];
if (char === '{')
braceCount++;
if (char === '}')
braceCount--;
if (char === ',' && braceCount === 0) {
result.push(currentArg.trim());
currentArg = '';
}
else {
if (char === ' ' || char === '\n' || char === '\t' || char === '\r')
continue;
currentArg += char;
}
}
if (currentArg) {
result.push(currentArg.trim());
}
return result;
}
+7
-1

@@ -1,2 +0,8 @@

export * from './src';
export * from './guards/isNever';
export * from './guards/isRecord';
export * from './types/flatten.types';
export * from './types/makePropertyOptionalIfChildrenOptional.types';
export * from './types/prettify.types';
export * from './types/removeTrailingSlash.types';
export * from './utils/extractArgumentNames';
//# sourceMappingURL=index.d.ts.map
+1
-1

@@ -1,1 +0,1 @@

{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC"}
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sDAAsD,CAAC;AACrE,cAAc,wBAAwB,CAAC;AACvC,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC"}

@@ -1,1 +0,7 @@

export * from './src';
export * from './guards/isNever';
export * from './guards/isRecord';
export * from './types/flatten.types';
export * from './types/makePropertyOptionalIfChildrenOptional.types';
export * from './types/prettify.types';
export * from './types/removeTrailingSlash.types';
export * from './utils/extractArgumentNames';
{
"name": "@forklaunch/common",
"version": "0.1.13",
"version": "0.1.14",
"description": "Common package for base types, interfaces, implementations.",

@@ -21,2 +21,3 @@ "files": [

"@eslint/js": "^9.16.0",
"@types/jest": "^29.5.14",
"argparse": "^2.0.1",

@@ -42,4 +43,8 @@ "balanced-match": "^3.0.1",

"uc.micro": "^2.1.0",
"vitest": "^2.1.8",
"yaml": "^2.6.1"
},
"directories": {
"test": "tests"
},
"exports": {

@@ -46,0 +51,0 @@ ".": {

export declare function isNever(value: never): value is never;
//# sourceMappingURL=isNever.d.ts.map
{"version":3,"file":"isNever.d.ts","sourceRoot":"","sources":["../../../src/guards/isNever.ts"],"names":[],"mappings":"AAAA,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,KAAK,CAEpD"}
export function isNever(value) {
return true;
}
/**
* Check if the given object is a record.
*
* @param {unknown} obj - The object to check.
* @returns {boolean} - True if the object is a record, false otherwise.
*/
export declare function isRecord(obj: unknown): obj is Record<string, unknown>;
//# sourceMappingURL=isRecord.d.ts.map
{"version":3,"file":"isRecord.d.ts","sourceRoot":"","sources":["../../../src/guards/isRecord.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAErE"}
/**
* Check if the given object is a record.
*
* @param {unknown} obj - The object to check.
* @returns {boolean} - True if the object is a record, false otherwise.
*/
export function isRecord(obj) {
return obj !== null && typeof obj === 'object' && !Array.isArray(obj);
}
export * from './guards/isNever';
export * from './guards/isRecord';
export * from './types/flatten.types';
export * from './types/makePropertyOptionalIfChildrenOptional.types';
export * from './types/prettify.types';
export * from './types/removeTrailingSlash.types';
export * from './utils/extractArgumentNames';
//# sourceMappingURL=index.d.ts.map
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sDAAsD,CAAC;AACrE,cAAc,wBAAwB,CAAC;AACvC,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC"}
export * from './guards/isNever';
export * from './guards/isRecord';
export * from './types/flatten.types';
export * from './types/makePropertyOptionalIfChildrenOptional.types';
export * from './types/prettify.types';
export * from './types/removeTrailingSlash.types';
export * from './utils/extractArgumentNames';
/**
* A type that represents the values of an object type `T`.
*
* This utility type takes an object type `T` and produces a union of its value types.
*
* @template T - The object type to extract values from.
*/
export type FlattenValues<T> = T[keyof T];
/**
* A type that represents the keys of an object type `T`.
*
* This utility type takes an object type `T` and produces a union of its key types.
*
* @template T - The object type to extract keys from.
*/
export type FlattenKeys<T> = keyof T;
/**
* A type that flattens an object type `T`.
*
* This utility type takes an object type `T` and recursively flattens it.
*
* @template T - The object type to flatten.
*/
export type Flatten<T> = T extends object ? {
[K in keyof T]: Flatten<T[K]>;
} : T;
//# sourceMappingURL=flatten.types.d.ts.map
{"version":3,"file":"flatten.types.d.ts","sourceRoot":"","sources":["../../../src/types/flatten.types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAE1C;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GACrC;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GACjC,CAAC,CAAC"}
type AllPropertiesOptional<T> = T extends Partial<T> ? (Partial<T> extends T ? true : false) : false;
export type MakePropertyOptionalIfChildrenOptional<T> = {
[K in keyof T as AllPropertiesOptional<T[K]> extends true ? K : never]?: T[K];
} & {
[K in keyof T as AllPropertiesOptional<T[K]> extends true ? never : K]: T[K];
};
export {};
//# sourceMappingURL=makePropertyOptionalIfChildrenOptional.types.d.ts.map
{"version":3,"file":"makePropertyOptionalIfChildrenOptional.types.d.ts","sourceRoot":"","sources":["../../../src/types/makePropertyOptionalIfChildrenOptional.types.ts"],"names":[],"mappings":"AAAA,KAAK,qBAAqB,CAAC,CAAC,IAC1B,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC;AAEvE,MAAM,MAAM,sCAAsC,CAAC,CAAC,IAAI;KACrD,CAAC,IAAI,MAAM,CAAC,IAAI,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAC9E,GAAG;KACD,CAAC,IAAI,MAAM,CAAC,IAAI,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GAAG,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAC7E,CAAC"}
/**
* A type that "prettifies" the structure of an object type `T`.
*
* This utility type takes an object type `T` and re-maps its keys and values, effectively creating
* a new type with the same keys and values but without any extra type information or attributes.
* This can be useful for simplifying the displayed type information in development tools.
*
* @template T - The object type to prettify.
*/
export type Prettify<T> = {
[K in keyof T]: T[K];
} & {};
//# sourceMappingURL=prettify.types.d.ts.map
{"version":3,"file":"prettify.types.d.ts","sourceRoot":"","sources":["../../../src/types/prettify.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI;KACvB,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACrB,GAAG,EAAE,CAAC"}
export type RemoveTrailingSlash<T extends string> = T extends `${infer Route}/` ? Route : T;
//# sourceMappingURL=removeTrailingSlash.types.d.ts.map
{"version":3,"file":"removeTrailingSlash.types.d.ts","sourceRoot":"","sources":["../../../src/types/removeTrailingSlash.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,GAAG,MAAM,KAAK,GAAG,GAC3E,KAAK,GACL,CAAC,CAAC"}
export declare function extractArgumentNames(func: {
toString(): string;
}): string[];
//# sourceMappingURL=extractArgumentNames.d.ts.map
{"version":3,"file":"extractArgumentNames.d.ts","sourceRoot":"","sources":["../../../src/utils/extractArgumentNames.ts"],"names":[],"mappings":"AAAA,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IAAE,QAAQ,IAAI,MAAM,CAAA;CAAE,GAAG,MAAM,EAAE,CAQ3E"}
export function extractArgumentNames(func) {
const fnStr = func.toString();
const args = fnStr.match(/\(([^)]*)\)/);
if (!args)
return [];
return args[1].split(',').map((arg) => arg.trim());
}

Sorry, the diff of this file is not supported yet

declare const _default: import("vite").UserConfig;
export default _default;
//# sourceMappingURL=vitest.config.d.ts.map
{"version":3,"file":"vitest.config.d.ts","sourceRoot":"","sources":["../vitest.config.ts"],"names":[],"mappings":";AAEA,wBAKG"}
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
globals: true,
exclude: ['**/lib/**', '**/dist/**', '**/node_modules/**']
}
});