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

@thi.ng/transducers

Package Overview
Dependencies
Maintainers
1
Versions
331
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@thi.ng/transducers - npm Package Compare versions

Comparing version 1.6.2 to 1.7.0

xform/map-vals.d.ts

12

CHANGELOG.md

@@ -6,2 +6,14 @@ # Change Log

<a name="1.7.0"></a>
# [1.7.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers@1.6.2...@thi.ng/transducers@1.7.0) (2018-03-19)
### Features
* **transducers:** add mapVals() xform ([abc195a](https://github.com/thi-ng/umbrella/commit/abc195a))
* **transducers:** add partitionSync() xform ([bebd118](https://github.com/thi-ng/umbrella/commit/bebd118))
<a name="1.6.2"></a>

@@ -8,0 +20,0 @@ ## [1.6.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers@1.6.1...@thi.ng/transducers@1.6.2) (2018-03-08)

4

index.d.ts

@@ -51,8 +51,9 @@ export * from "./api";

export * from "./xform/labeled";
export * from "./xform/map-deep";
export * from "./xform/map-indexed";
export * from "./xform/map-keys";
export * from "./xform/map-nth";
export * from "./xform/map-vals";
export * from "./xform/map";
export * from "./xform/mapcat";
export * from "./xform/map-deep";
export * from "./xform/moving-average";

@@ -68,2 +69,3 @@ export * from "./xform/moving-median";

export * from "./xform/partition-sort";
export * from "./xform/partition-sync";
export * from "./xform/partition";

@@ -70,0 +72,0 @@ export * from "./xform/pluck";

@@ -56,8 +56,9 @@ "use strict";

__export(require("./xform/labeled"));
__export(require("./xform/map-deep"));
__export(require("./xform/map-indexed"));
__export(require("./xform/map-keys"));
__export(require("./xform/map-nth"));
__export(require("./xform/map-vals"));
__export(require("./xform/map"));
__export(require("./xform/mapcat"));
__export(require("./xform/map-deep"));
__export(require("./xform/moving-average"));

@@ -73,2 +74,3 @@ __export(require("./xform/moving-median"));

__export(require("./xform/partition-sort"));
__export(require("./xform/partition-sync"));
__export(require("./xform/partition"));

@@ -75,0 +77,0 @@ __export(require("./xform/pluck"));

{
"name": "@thi.ng/transducers",
"version": "1.6.2",
"version": "1.7.0",
"description": "Lightweight transducer implementations for ES6 / TypeScript",

@@ -5,0 +5,0 @@ "main": "./index.js",

@@ -608,3 +608,3 @@ # @thi.ng/transducers

#### `labeled<L, T>(id: L): Transducer<T, [L, T]>`
#### `labeled<L, T>(id: L | ((x: T) => L)): Transducer<T, [L, T]>`

@@ -617,3 +617,3 @@ #### `map<A, B>(fn: (x: A) => B): Transducer<A, B>`

#### `mapIndexed<A, B>(fn: (i: number, x: A) => B): Transducer<A, B>`
#### `mapIndexed<A, B>(fn: (i: number, x: A) => B, offset = 0): Transducer<A, B>`

@@ -624,2 +624,5 @@ #### `mapKeys(keys: IObjectOf<(x: any) => any>, copy?: boolean): Transducer<any, any>`

#### `mapVals<A, B>(fn: (v: A) => B, copy = true): Transducer<IObjectOf<A>, IObjectOf<B>>`
#### `movingAverage(n: number): Transducer<number, number>`

@@ -647,2 +650,4 @@

#### `partitionSync<T>(keys: PropertyKey[] | Set<PropertyKey>, keyfn: (x: T) => PropertyKey, reset = true, all = true): Transducer<T, IObjectOf<T>>`
#### `pluck<A, B>(key: PropertyKey): Transducer<A, B>`

@@ -649,0 +654,0 @@

import { Transducer } from "../api";
export declare function labeled<L, T>(id: L): Transducer<T, [L, T]>;
export declare function labeled<L, T>(id: L | ((x: T) => L)): Transducer<T, [L, T]>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const is_function_1 = require("@thi.ng/checks/is-function");
const map_1 = require("./map");
function labeled(id) {
return map_1.map((x) => [id, x]);
return map_1.map(is_function_1.isFunction(id) ?
(x) => [id(x), x] :
(x) => [id, x]);
}
exports.labeled = labeled;
import { Transducer } from "../api";
export declare function mapIndexed<A, B>(fn: (i: number, x: A) => B): Transducer<A, B>;
export declare function mapIndexed<A, B>(fn: (i: number, x: A) => B, offset?: number): Transducer<A, B>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const compr_1 = require("../func/compr");
function mapIndexed(fn) {
function mapIndexed(fn, offset = 0) {
return (rfn) => {
const r = rfn[2];
let i = 0;
let i = offset;
return compr_1.compR(rfn, (acc, x) => r(acc, fn(i++, x)));

@@ -9,0 +9,0 @@ };

@@ -19,3 +19,3 @@ "use strict";

(acc) => {
if (buf.length && (all || buf.length === size)) {
if (all && buf.length > 0) {
acc = reduce(acc, buf);

@@ -22,0 +22,0 @@ buf = [];

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