Skip to content

Commit

Permalink
Merge branch 'release/1.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Akeri committed Feb 10, 2019
2 parents 77ed1f7 + 0302abf commit cc097e6
Show file tree
Hide file tree
Showing 9 changed files with 753 additions and 27 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
node_modules
*.sock
.idea
.nyc_output
.coveralls.yml
4 changes: 4 additions & 0 deletions .nycrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"all": true,
"check-coverage": true
}
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ node_js:
services:
- mongodb
script:
- npm test
- npm run test-with-coverage
after_success:
- npm run publish-coverage
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![Build Status](https://travis-ci.org/aliatech/loopback-mongo-distinct-mixin.svg?branch=master)](https://travis-ci.org/aliatech/loopback-mongo-distinct-mixin)
[![Coverage Status](https://coveralls.io/repos/github/aliatech/loopback-mongo-distinct-mixin/badge.svg?branch=master)](https://coveralls.io/github/aliatech/loopback-mongo-distinct-mixin?branch=master)
[![npm version](https://badge.fury.io/js/loopback-mongo-distinct-mixin.svg)](https://badge.fury.io/js/loopback-mongo-distinct-mixin)

# Loopback Distinct mixin for MongoDB
Expand Down
6 changes: 3 additions & 3 deletions lib/distinct.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ module.exports = (Model, options) => {

/**
* Parse "distinct" methods arguments to ensure they have correct values.
* @param {arguments} arguments Arguments received in "distinct" methods
* @param {arguments} params Arguments received in "distinct" methods
* @returns {{property: string, where: object, next: function} | boolean}
* Valid arguments if could be parsed,
* otherwise return false and invoke next function with error.
*/
function distinctArgs (arguments) {
const args = Array.from(arguments);
function distinctArgs (params) {
const args = Array.from(params);
let property = defaultProperty;
let where = {};
let next = _.noop;
Expand Down
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
"node",
"loopback",
"mongo",
"distinct",
"orm",
"mixin"
],
"author": {
Expand All @@ -24,21 +26,25 @@
},
"scripts": {
"lint": "eslint index.js",
"test": "mocha --exit"
"test": "mocha",
"test-with-coverage": "nyc --reporter=text --reporter=text-summary mocha",
"publish-coverage": "nyc report --reporter=text-lcov | coveralls"
},
"main": "index.js",
"dependencies": {
"lodash": "^4.17.11",
"loopback-connector-mongodb": "^3.9.2"
},
"devDependencies": {
"coveralls": "^3.0.2",
"eslint": "^5.13.0",
"eslint-config-google": "^0.12.0",
"loopback": "^3.25.0",
"loopback-boot": "^2.27.1",
"loopback-component-explorer": "^6.3.1",
"loopback-testing": "^1.4.0",
"mocha": "^5.2.0",
"nyc": "^13.2.0",
"should": "^13.2.3",
"strong-error-handler": "^3.2.0"
}
Expand Down
1 change: 1 addition & 0 deletions test/mocha.opts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
--recursive
--timeout 5000
--exit
3 changes: 3 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const app = require('./fixtures/get-app')('simple-app');
const Seeder = require('./fixtures/simple-app/populate');
const request = require('request');

// Import the mixin.
require('../')(app);


describe('Distinct features', function () {

Expand Down

0 comments on commit cc097e6

Please sign in to comment.