Skip to content

Commit

Permalink
Release 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricardo Gama committed Jun 22, 2016
1 parent cfbfa3c commit 66d20c6
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Changelog

## [1.0.0](https://github.com/seegno/bookshelf-mask/tree/1.0.0)

**Merged pull requests:**

- Add initial code [\#1](https://github.com/seegno/bookshelf-mask/pull/1) ([ricardogama](https://github.com/ricardogama))



\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
36 changes: 36 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
'use strict';

Object.defineProperty(exports, "__esModule", {
value: true
});

var _jsonMask = require('json-mask');

var _jsonMask2 = _interopRequireDefault(_jsonMask);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
* Export `bookshelf-mask` plugin.
*/

exports.default = function (Bookshelf) {
Bookshelf.Model = Bookshelf.Model.extend({
mask: function mask(scope, options) {
return (0, _jsonMask2.default)(this.toJSON(options), this.masks && this.masks[scope] || scope);
}
});

Bookshelf.Collection = Bookshelf.Collection.extend({
mask: function mask(scope, options) {
scope = this.model.prototype.masks && this.model.prototype.masks[scope] || scope;

return this.toJSON(options).map(function (model) {
return (0, _jsonMask2.default)(model, scope);
});
}
});
};
/**
* Module dependencies.
*/

0 comments on commit 66d20c6

Please sign in to comment.