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

dodos

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dodos - npm Package Compare versions

Comparing version 2.4.0 to 2.4.1

lib/dodo.js

17

package.json
{
"name": "dodos",
"version": "2.4.0",
"version": "2.4.1",
"description": "Pandas-inspired iterator-based data wrangling library for js",
"main": "dist/dodos.js",
"main": "lib/dodo.js",
"scripts": {
"build": "webpack",
"build": "npm run build:lib && npm run build:umd",
"build:lib": "babel src --out-dir lib",
"build:umd": "webpack",
"clean": "rimraf lib dist coverage .nyc_output",
"test": "ava",

@@ -12,4 +15,9 @@ "test:watch": "ava --watch",

"prepush": "npm test",
"prepublish": "npm test && npm run build"
"prepublish": "npm test && npm run clean && npm run build"
},
"files": [
"dist",
"lib",
"src"
],
"repository": {

@@ -40,2 +48,3 @@ "type": "git",

"nyc": "~6.1.1",
"rimraf": "~2.5.2",
"table": "~3.7.8",

@@ -42,0 +51,0 @@ "webpack": "~1.12.14"

@@ -6,7 +6,7 @@ import invariant from 'invariant'

import flatten from 'lodash/flatten'
import {map, filter, drop, take, seq, transduce} from 'transducers.js'
import {map, filter, drop, take, transduce} from 'transducers.js'
import {
identity, combineReducers, REDUCERS, spread, createGrouper, isfunc,
arrayToIndex, compose
arrayToIndex, compose, transduceNoBreak, arrayReducer
} from './helpers'

@@ -24,2 +24,5 @@

const needSlowCase = a =>
a.toString().includes('new Take') || a.toString().includes('new Drop')
export default class Dodo {

@@ -63,3 +66,8 @@ constructor(array, index, actions=noActions) {

if (this.actions.length)
return seq(Arrays.get(this), compose(this.actions))
return (this.actions.some(needSlowCase) ? transduce : transduceNoBreak)(
Arrays.get(this),
compose(this.actions),
arrayReducer,
[]
)
else

@@ -154,3 +162,3 @@ return Arrays.get(this)

`Dodo#reduce(fn, init, final) — final not a function`)
return transduce(
return (this.actions.some(needSlowCase) ? transduce : transduceNoBreak)(
Arrays.get(this),

@@ -157,0 +165,0 @@ compose(this.actions),

import zipObject from 'lodash/zipObject'
export const identity = a => a
export function compose(funcs) {

@@ -26,2 +28,22 @@ var len = funcs.length

export const arrayReducer = {
['@@transducer/result']: identity,
['@@transducer/step'](arr, v) {
arr.push(v)
return arr
},
}
export function transduceNoBreak(coll, xform, reducer, init) {
xform = xform(reducer)
var result = init;
var index = -1;
var len = coll.length;
while(++index < len) {
result = xform['@@transducer/step'](result, coll[index]);
}
return xform['@@transducer/result'](result);
}
export function combineReducers(fns, spread) {

@@ -48,4 +70,2 @@ const len = fns.length

export const identity = a => a
export const REDUCERS = {

@@ -52,0 +72,0 @@ max: [(max, el) => max > el ? max : el, () => -Infinity, identity],

Sorry, the diff of this file is too big to display

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