Socket
Socket
Sign inDemoInstall

itertools

Package Overview
Dependencies
0
Maintainers
2
Versions
50
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.2.1 to 2.2.2

96

dist/index.js

@@ -367,47 +367,2 @@ // src/utils.ts

// src/custom.ts
function isNullish(x) {
return x != null;
}
function isDefined(x) {
return x !== void 0;
}
function icompact(iterable) {
return ifilter(iterable, isNullish);
}
function compact(iterable) {
return Array.from(icompact(iterable));
}
function compactObject(obj) {
const result = {};
for (const [key, value_] of Object.entries(obj)) {
const value = value_;
if (value != null) {
result[key] = value;
}
}
return result;
}
function find(iterable, keyFn) {
if (keyFn === void 0) {
for (const value of iterable) {
return value;
}
return void 0;
} else {
for (const value of iterable) {
if (keyFn(value)) {
return value;
}
}
return void 0;
}
}
function first(iterable, keyFn) {
return find(iterable, keyFn != null ? keyFn : isDefined);
}
function flatmap(iterable, mapper) {
return flatten(imap(iterable, mapper));
}
// src/builtins.ts

@@ -485,7 +440,7 @@ function every(iterable, keyFn = identityPredicate) {

const it = iter(iterable);
const start = find(it);
if (start === void 0) {
const start = it.next();
if (start.done) {
return void 0;
} else {
return reduce3(it, reducer, start);
return reduce3(it, reducer, start.value);
}

@@ -510,2 +465,47 @@ }

}
// src/custom.ts
function isNullish(x) {
return x != null;
}
function isDefined(x) {
return x !== void 0;
}
function icompact(iterable) {
return ifilter(iterable, isNullish);
}
function compact(iterable) {
return Array.from(icompact(iterable));
}
function compactObject(obj) {
const result = {};
for (const [key, value_] of Object.entries(obj)) {
const value = value_;
if (value != null) {
result[key] = value;
}
}
return result;
}
function find(iterable, keyFn) {
if (keyFn === void 0) {
for (const value of iterable) {
return value;
}
return void 0;
} else {
for (const value of iterable) {
if (keyFn(value)) {
return value;
}
}
return void 0;
}
}
function first(iterable, keyFn) {
return find(iterable, keyFn != null ? keyFn : isDefined);
}
function flatmap(iterable, mapper) {
return flatten(imap(iterable, mapper));
}
export {

@@ -512,0 +512,0 @@ all,

{
"name": "itertools",
"version": "2.2.1",
"version": "2.2.2",
"description": "A JavaScript port of Python's awesome itertools standard library",

@@ -54,5 +54,5 @@ "license": "MIT",

"@release-it/keep-a-changelog": "^5.0.0",
"@typescript-eslint/eslint-plugin": "^6.17.0",
"@typescript-eslint/parser": "^6.17.0",
"@vitest/coverage-istanbul": "^1.1.2",
"@typescript-eslint/eslint-plugin": "^6.18.1",
"@typescript-eslint/parser": "^6.18.1",
"@vitest/coverage-istanbul": "^1.1.3",
"eslint": "^8.56.0",

@@ -67,3 +67,3 @@ "fast-check": "^3.15.0",

"vite-tsconfig-paths": "^4.2.3",
"vitest": "^1.1.2"
"vitest": "^1.1.3"
},

@@ -70,0 +70,0 @@ "githubUrl": "https://github.com/nvie/itertools",

[![npm](https://img.shields.io/npm/v/itertools.svg)](https://www.npmjs.com/package/itertools)
[![Build Status](https://github.com/nvie/itertools.js/workflows/test/badge.svg)](https://github.com/nvie/itertools.js/actions)
[![Bundle size for itertools](https://pkg-size.dev/badge/bundle/2130)](https://pkg-size.dev/itertools)

@@ -4,0 +5,0 @@ A JavaScript port of Python's awesome

Sorry, the diff of this file is not supported yet

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc