From a7c62011f93c5dec16af40b53dda0766fa137b2a Mon Sep 17 00:00:00 2001 From: Paul Tanasa Date: Mon, 20 Jul 2020 21:05:18 +0300 Subject: [PATCH] [RELEASE] 0.1.1 --- package.json | 2 +- src/query-filter.js | 20 -------------------- src/uri-filter.js | 19 ------------------- 3 files changed, 1 insertion(+), 40 deletions(-) delete mode 100644 src/query-filter.js delete mode 100644 src/uri-filter.js diff --git a/package.json b/package.json index 92ed2d8..7750fd3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@exom-dev/no-clid", - "version": "0.1.0", + "version": "0.1.1", "main": "index.js", "description": "URL query filter for Express.js", "keywords": [ diff --git a/src/query-filter.js b/src/query-filter.js deleted file mode 100644 index dcf256d..0000000 --- a/src/query-filter.js +++ /dev/null @@ -1,20 +0,0 @@ -function queryFilter(query, filter) { - let competent = true; - const result = {}; - - for (const key in query) { - if (Object.prototype.hasOwnProperty.call(filter, key)) { - competent = false; - } else { - result[key] = query[key]; - } - } - - if (competent) { - return null; - } - - return result; -} - -module.exports = queryFilter; diff --git a/src/uri-filter.js b/src/uri-filter.js deleted file mode 100644 index 3fcb15a..0000000 --- a/src/uri-filter.js +++ /dev/null @@ -1,19 +0,0 @@ -const url = require('url'); -const queryFilter = require('./query-filter.js'); - -function uriFilter(path, query, filter) { - const newQuery = queryFilter(query, filter); - - if (newQuery === null) { - return null; - } - - const uri = url.format({ - pathname: path, - query: newQuery, - }); - - return uri; -} - -module.exports = uriFilter;