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

@byjohann/utils

Package Overview
Dependencies
Maintainers
0
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@byjohann/utils - npm Package Compare versions

Comparing version 0.1.2 to 0.2.0

14

dist/index.d.ts

@@ -26,14 +26,18 @@ type MaybeArray<T> = T | T[];

*/
declare function objectKeys<T extends object>(obj: T): Array<`${keyof T & (string | number | boolean | null | undefined)}`>;
declare function objectKeys<T extends Record<any, any>>(obj: T): Array<`${keyof T & (string | number | boolean | null | undefined)}`>;
/**
* Strictly typed `Object.entries`.
*/
declare function objectEntries<T extends object>(obj: T): Array<[keyof T, T[keyof T]]>;
declare function objectEntries<T extends Record<any, any>>(obj: T): Array<[keyof T, T[keyof T]]>;
/**
* Deeply applies a callback to each key-value pair in the object.
*/
declare function deepApply<T extends Record<any, any>>(data: T, callback: (item: T, key: keyof T, value: T[keyof T]) => void): void;
/**
* Simple template engine to replace variables in a string
* Simple template engine to replace variables in a string.
*/
declare function template(str: string, variables: Record<string | number, any>, fallback?: string | ((key: string) => string)): string;
/**
* Generates a random string
* Generates a random string.
*/

@@ -47,2 +51,2 @@ declare function generateRandomId(size?: number, dict?: string): string;

export { type MaybeArray, createCsv, escapeCsvValue, generateRandomId, objectEntries, objectKeys, template, toArray, tryParseJson, unindent };
export { type MaybeArray, createCsv, deepApply, escapeCsvValue, generateRandomId, objectEntries, objectKeys, template, toArray, tryParseJson, unindent };
{
"name": "@byjohann/utils",
"type": "module",
"version": "0.1.2",
"version": "0.2.0",
"packageManager": "pnpm@9.5.0",

@@ -6,0 +6,0 @@ "description": "A collection of utilities for my projects",

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