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

datamodel

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

datamodel - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

1

lib/datamodel.js

@@ -6,3 +6,2 @@ 'use strict';

;
var async = require('async')
function parallel(tasks, fn) {

@@ -9,0 +8,0 @@ var errors = [], counter = 0, limit = Object.keys(tasks).length, results = {};

2

package.json
{
"name": "datamodel",
"version": "1.0.6",
"version": "1.0.7",
"author": "Nicolas Thouvenin <nthouvenin@gmail.com>",

@@ -5,0 +5,0 @@ "contributors": [],

@@ -130,2 +130,30 @@ # Datamodel

### transform(Function callback)
You can only call `transform` once.
So, if you need to apply two transforms, put them both in the same transform callback.
Example:
```javascript
return datamodel()
.append('years', function(req, fill) {
coll
.aggregate(
{ $project: { Py: 1, _id: 0} },
{ $group: { _id: "$Py", occ: { $sum: 1} } })
.then(fill)
.catch(fill);
})
.transform(function(req, fill) {
var n = this;
var y = {};
this.years.each(function (e) {
y[e._id] = e.occ;
});
n.years = y;
fill(n);
})
```
### send(Function callback)

@@ -132,0 +160,0 @@ ### apply(Mixed input, Mixed output, Function callback)

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