New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gamla

Package Overview
Dependencies
Maintainers
1
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gamla - npm Package Compare versions

Comparing version 27.0.0 to 28.0.0

5

esm/src/composition.js

@@ -35,4 +35,5 @@ import { reverse } from "./array.js";

export const sideEffect = (f) => (x) => {
f(x);
return x;
const result = f(x);
// @ts-expect-error compiler cannot dynamically infer
return (result instanceof Promise) ? result.then(() => x) : x;
};

@@ -39,0 +40,0 @@ export const wrapSideEffect = (cleanup) => (f) => (...args) => {

3

esm/src/debug.js

@@ -34,5 +34,2 @@ import { currentLocation } from "./trace.js";

};
export const sideLogTable = sideEffect(console.table);
// deno-lint-ignore no-explicit-any
export const logWith = (...x) => sideEffect((y) => console.log(...x, y));
const getTimestampMilliseconds = () => new Date().getTime();

@@ -39,0 +36,0 @@ export const timeit = (handler, f) => ((...x) => {

@@ -6,3 +6,3 @@ {

"name": "gamla",
"version": "27.0.0",
"version": "28.0.0",
"description": "Functional programming with async and type safety",

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

@@ -43,4 +43,5 @@ "use strict";

const sideEffect = (f) => (x) => {
f(x);
return x;
const result = f(x);
// @ts-expect-error compiler cannot dynamically infer
return (result instanceof Promise) ? result.then(() => x) : x;
};

@@ -47,0 +48,0 @@ exports.sideEffect = sideEffect;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.assert = exports.timeit = exports.logWith = exports.sideLogTable = exports.sideLogBefore = exports.sideLogAfter = exports.sideLog = void 0;
exports.assert = exports.timeit = exports.sideLogBefore = exports.sideLogAfter = exports.sideLog = void 0;
const trace_js_1 = require("./trace.js");

@@ -40,6 +40,2 @@ const composition_js_1 = require("./composition.js");

exports.sideLogBefore = sideLogBefore;
exports.sideLogTable = (0, composition_js_1.sideEffect)(console.table);
// deno-lint-ignore no-explicit-any
const logWith = (...x) => (0, composition_js_1.sideEffect)((y) => console.log(...x, y));
exports.logWith = logWith;
const getTimestampMilliseconds = () => new Date().getTime();

@@ -46,0 +42,0 @@ const timeit = (handler, f) => ((...x) => {

@@ -1,3 +0,4 @@

import { AnyAsync, Func, Last, ReturnTypeUnwrapped } from "./typing.js";
import { AnyAsync, AsyncFunction, Func, Last, ReturnTypeUnwrapped } from "./typing.js";
type UnaryFn<A, R> = (a: A) => R;
type UnaryFnUntyped = (a: any) => any;
type Arg<F extends Func> = Parameters<F>[0];

@@ -19,3 +20,3 @@ type Res<F> = F extends UnaryFn<any, infer R> ? R : never;

export declare const complement: <F extends Func>(f: F) => (...x: Parameters<F>) => boolean;
export declare const sideEffect: <T>(f: (_: T) => void) => (x: T) => T;
export declare const sideEffect: <F extends UnaryFnUntyped>(f: F) => (x: Parameters<F>[0]) => F extends AsyncFunction ? Promise<Parameters<F>[0]> : Parameters<F>[0];
export declare const wrapSideEffect: <Args extends unknown[], Result>(cleanup: (...args: Args) => void | Promise<void>) => (f: (...args: Args) => Result) => (...args: Args) => Result | Promise<Result>;

@@ -22,0 +23,0 @@ export declare const applyTo: <A extends unknown[]>(...args: A) => (f: (...args: A) => unknown) => unknown;

@@ -5,5 +5,3 @@ import { Func, ReturnTypeUnwrapped } from "./typing.js";

export declare const sideLogBefore: <F extends Func>(f: F) => F;
export declare const sideLogTable: (x: any) => any;
export declare const logWith: <T>(...x: any[]) => (x: T) => T;
export declare const timeit: <F extends Func>(handler: (elapsed: number, args: Parameters<F>, result: ReturnTypeUnwrapped<F>) => void, f: F) => F;
export declare const assert: <T>(condition: (_: T) => boolean, errorMessage: string) => (x: T) => T;
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