Skip to content

Commit

Permalink
[enhance] added method scrub.
Browse files Browse the repository at this point in the history
  • Loading branch information
calvintwr committed Jan 16, 2021
1 parent e7f14ed commit 5be7ea9
Show file tree
Hide file tree
Showing 5 changed files with 186 additions and 251 deletions.
8 changes: 7 additions & 1 deletion dist/not.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = print;

},{}],2:[function(require,module,exports){
/*!
* You-Are-Not v0.7.5
* You-Are-Not v0.7.7
* (c) 2020 Calvin Tan
* Released under the MIT License.
*/
Expand Down Expand Up @@ -351,6 +351,12 @@ You.checkObject = function (name, expectObject, gotObject, callback) {
return not.resolve();
};

You.scrub = function (name, expectObject, gotObject) {
return this.checkObject(name, expectObject, gotObject, {
returnPayload: true
});
};

You.walkObject = function (name, expectObject, gotObject, returnPayload) {
if (returnPayload) var sanitisedPayload = {};

Expand Down
6 changes: 2 additions & 4 deletions dist/not.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "you-are-not",
"version": "0.7.5",
"description": "A minimal, blazing fast, intuitive, API-centric, and customisable type-checking/validation/error handing and messaging helper -- all in a small and neat pack.",
"version": "0.7.7",
"description": "*Not* is a minimal, blazing fast, intuitive, API-centric, and customisable API payload sanitiser/type-checking/validation/error handing and messaging helper -- all in a small and neat pack.",
"main": "index.js",
"browser": "dist/not.min.js",
"browserslist": "> 1%, last 2 versions",
Expand Down

0 comments on commit 5be7ea9

Please sign in to comment.