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

iter-fun

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iter-fun - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

26

index.js

@@ -1,2 +0,2 @@

export function isArray(data) {
function isArray(data) {
try {

@@ -9,3 +9,3 @@ return data.constructor.name.endsWith("Array");

export function hasNext(data) {
function hasNext(data) {
try {

@@ -18,3 +18,3 @@ return typeof data.next === "function";

export function hasIterator(data) {
function hasIterator(data) {
try {

@@ -27,3 +27,3 @@ return "@@iterator" in data;

export function hasSymbolIterator(data) {
function hasSymbolIterator(data) {
try {

@@ -36,3 +36,3 @@ return Symbol.iterator in data.constructor.prototype;

export function getIterator(data) {
function getIterator(data) {
const iter = data["@@iterator"];

@@ -46,3 +46,3 @@ if (hasNext(iter)) {

export function createIterator(data) {
function createIterator(data) {
let i = 0;

@@ -55,3 +55,3 @@ let len = data.length;

export function getOrCreateIterator(data) {
function getOrCreateIterator(data) {
if (hasNext(data)) {

@@ -69,1 +69,13 @@ return data;

}
if (typeof module === "object") {
module.exports = {
isArray,
hasNext,
hasSymbolIterator,
hasIterator,
getIterator,
createIterator,
getOrCreateIterator
};
}
{
"name": "iter-fun",
"version": "0.0.1",
"version": "0.1.0",
"description": "Fun with Iterables",
"main": "index.js",
"type": "module",
"files": [

@@ -8,0 +7,0 @@ "index.js"

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