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

loop-over-object

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loop-over-object

Small, safe JavaScript function that correctly loops over an object.

  • 0.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

loopOverObject

GitHub | NPM | @jelmerdemaat

Small, safe JavaScript function that correctly loops over an object.

  • ES6 ready.
  • Promise based, resolves for each item.
  • Filters array on object.hasOwnProperty to check if the property really exists.

Usage

Add to your dependencies:

  npm install --save loop-over-object
  # or shorter:
  npm i -S loop-over-object

Use in your JS:

import loopOverObject from 'loop-over-object';

const object = {
  name: 'Jelmer',
  color: 'red',
  cape: false
};

loopOverObject(object).then((item, key) => {
  console.log(item, key);
  // 👆 Logs:
  //    name Jelmer
  //    color red
  //    cape false
});

Keywords

FAQs

Package last updated on 05 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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