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

clique-seeds

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clique-seeds - npm Package Compare versions

Comparing version 0.0.4 to 0.0.6

seeds.json

5

package.json
{
"name": "clique-seeds",
"description": "A utility for creating seed data for both the server and client.",
"version": "0.0.4",
"version": "0.0.6",
"author": "Walker Ward <walker.ward1@gmail.com> ()",

@@ -15,3 +15,4 @@ "bugs": {

"chance": "1.0.16",
"common-tags": "1.8.0"
"common-tags": "1.8.0",
"lodash": "4.17.11"
},

@@ -18,0 +19,0 @@ "ava": {

@@ -24,2 +24,4 @@ /**

const pick = require('lodash/pick');
const omit = require('lodash/omit');
const { stripIndents } = require('common-tags');

@@ -114,2 +116,18 @@ const Chance = require('chance');

serialize(recordType) {
const records = this.records[recordType];
const hasManys = Object.keys(this.records);
const belongsTo = ['rootFolder', ...hasManys.map(o => o.replace(/[s]$/, ''))];
return records.map((record) => {
record = omit(record, belongsTo); // eslint-disable-line no-param-reassign
return hasManys.reduce((prev, hasMany) => {
if (typeof prev[hasMany] !== 'undefined') {
prev[hasMany] = prev[hasMany].map(o => pick(o, ['id', 'type'])); // eslint-disable-line no-param-reassign
}
return prev;
}, record);
});
},
/* ======= End Helper Methods ======= */

@@ -116,0 +134,0 @@

@@ -97,1 +97,14 @@ const test = require('ava');

});
test('we can serialize each type', (assert) => {
const seeds = new Seeds();
const types = Object.keys(seeds.records);
assert.plan(types.length);
seeds.init();
types.forEach((type) => {
seeds.records[type] = seeds.serialize(type);
assert.true(seeds.records[type].length > 0);
});
});
yarn.lock

Sorry, the diff of this file is not supported yet

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