Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

chance-object

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chance-object

A Chance.js mixin to generate objects.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

chance-object Build Status

A Chance.js mixin to generate objects.

Install

NPM

$ npm i chance-object

Yarn

$ yarn add chance-object

Usage

import Chance from 'chance';
import object from 'chance-object';

const chance = new Chance();

chance.mixin({
    object
});

chance.object();

By default, chance-object will return a randomly generated object.

Example:

{
    randomKey: 'randomValue';
}

chance-object can also take an optional object as a parameter, which will create a randomly generated object and merge it with the supplied object.

Example:

chance.object({
    key: 'value'
});

Result:

{
    randomKey: 'randomValue',
    key: 'value'
}

License

MIT © Michael Novotny

Keywords

chance

FAQs

Package last updated on 01 Aug 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