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

mocker-data-generator

Package Overview
Dependencies
Maintainers
1
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mocker-data-generator - npm Package Versions

123467

1.0.4

Diff
danibram
published 1.0.4 •

Changelog

Source

(1.0.4)

  • Added on uniqueField two ways to generate the data
  • Starting to add errors
danibram
published 1.0.3 •

Changelog

Source

(1.0.3)

  • Fix Arrays

  • Breaking Change: the older versions aren´t compatible with this module, the way to generate the data are changed:

    var cat = {
        name: {
            values: ['txuri', 'pitxi', 'kitty']
        }
    }
    var m = mocker()
        .schema('cat', cat, 10)
        .schema('cat2', cat, { uniqueField: 'name' })
        .build(function (data) {
            console.log(util.inspect(data, { depth: 10 }))
        })
    
danibram
published 1.0.2 •
danibram
published 1.0.1 •
danibram
published 1.0.0 •
danibram
published 0.7.0 •

Changelog

Source

(0.7.0)

  • Breaking Change: Added the posibility to enable the pluralize on the output entity. Now if you want to pluralize the output follow the example in the doc, by defatult is not anymore pluralized.

    Old call configuration:

    var m = mocker(config)
    m.generate('user', 2)
        .then(m.generate('group', 2))
        .then(m.generate('conditionalField', 2))
        .then(function (data) {
            console.log(util.inspect(data, { depth: 10 }))
            //This returns an object
            // {
            //      user:[array of users],
            //      group: [array of groups],
            //      conditionalField: [array of conditionalFields]
            // }
        })
    

    New array configuration:

    var m = mocker(config)
    m.generate('user', 2)
        .generate('group', 2)
        .generate('conditionalField', 2)
        .build(function (data) {
            console.log(util.inspect(data, { depth: 10 }))
            //This returns an object
            // {
            //      user:[array of users],
            //      group: [array of groups],
            //      conditionalField: [array of conditionalFields]
            // }
        })
    
danibram
published 0.6.0 •

Changelog

Source

(0.6.0)

  • Breaking Change: Added the posibility to enable the pluralize on the output entity. Now if you want to pluralize the output follow the example in the doc, by defatult is not anymore pluralized.
danibram
published 0.5.0 •

Changelog

Source

(0.5.0)

  • Breaking Change: Break Point with array config. Now is more clear.

    Old array configuration:

        [{
            //Any generator
                //Faker
            faker: 'random.arrayElement(db.users)[userId]'
                //Chance
            chance: 'integer'
                //Function
            function: function (){ return /**/ }
    
        }, //Array config
        {length: 10, fixedLength: false}]
    

    New array configuration:

        [{
            //Any generator
                //Faker
            faker: 'random.arrayElement(db.users)[userId]'
                //Chance
            chance: 'integer'
                //Function
            function: function (){ return /**/ }
    
            //Array config
            length: 10,
            fixedLength: false
        }]
    
danibram
published 0.4.7 •

Changelog

Source

(0.4.7)

  • Add virtual fields
danibram
published 0.4.6 •