From 9ca7cd813bd184760b8cfdb57361a7140aea7edc Mon Sep 17 00:00:00 2001 From: Tom Spencer Date: Wed, 25 Mar 2020 11:37:59 +0000 Subject: [PATCH] Update README and license copyright year --- LICENSE | 2 +- README.md | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/LICENSE b/LICENSE index df0fe71..ab484d2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 Tom Spencer. +Copyright (c) 2015-2020 Tom Spencer. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 580c096..ea78c85 100644 --- a/README.md +++ b/README.md @@ -19,11 +19,11 @@ npm install express-mongo-sanitize Add as a piece of express middleware, before defining your routes. ``` js -var express = require('express'), - bodyParser = require('body-parser'), - mongoSanitize = require('express-mongo-sanitize'); +const express = require('express'); +const bodyParser = require('body-parser'); +const mongoSanitize = require('express-mongo-sanitize'); -var app = express(); +const app = express(); app.use(bodyParser.urlencoded({extended: true})); app.use(bodyParser.json()); @@ -41,9 +41,9 @@ app.use(mongoSanitize({ You can also bypass the middleware and use the module directly: ``` js -var mongoSanitize = require('express-mongo-sanitize'); +const mongoSanitize = require('express-mongo-sanitize'); -var payload = {...}; +const payload = {...}; // Remove any keys containing prohibited characters mongoSanitize.sanitize(payload); @@ -54,7 +54,7 @@ mongoSanitize.sanitize(payload, { }); // Check if the payload has keys with prohibited characters -var hasProhibited = mongoSanitize.has(payload); +const hasProhibited = mongoSanitize.has(payload); ``` ## What?