Socket
Socket
Sign inDemoInstall

@sinonjs/commons

Package Overview
Dependencies
1
Maintainers
5
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sinonjs/commons

Simple functions shared among the sinon end user libraries


Version published
Maintainers
5
Weekly downloads
30,709,422
increased by2%
Install size
81.0 kB

Weekly downloads

Package description

What is @sinonjs/commons?

The @sinonjs/commons package is a collection of common utilities used by Sinon.js and its related projects. It provides a set of helper functions and shared components that are used across the Sinon.js ecosystem to ensure consistency and reduce duplication.

What are @sinonjs/commons's main functionalities?

typeOf

Determines the type of a given value. It is a more robust version of JavaScript's typeof operator.

const { typeOf } = require('@sinonjs/commons');
const result = typeOf({}); // 'object'

valueToString

Converts a value to a string representation, useful for debugging and logging.

const { valueToString } = require('@sinonjs/commons');
const result = valueToString('Hello'); // '"Hello"'

isPromise

Checks if a given value is a Promise.

const { isPromise } = require('@sinonjs/commons');
const result = isPromise(Promise.resolve()); // true

Other packages similar to @sinonjs/commons

Readme

Source

commons

CircleCI codecov Contributor Covenant

Simple functions shared among the sinon end user libraries

Rules

  • Follows the Sinon.JS compatibility
  • 100% test coverage
  • Code formatted using Prettier
  • No side effects welcome! (only pure functions)
  • No platform specific functions
  • One export per file (any bundler can do tree shaking)

FAQs

Last updated on 08 Apr 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc