From 1a5a0daaf13e09b11dd0783f0c9826fef3d0c652 Mon Sep 17 00:00:00 2001 From: dmitrovskiy Date: Mon, 13 Mar 2017 14:38:58 +0200 Subject: [PATCH] Fix: src to lib --- package.json | 4 ++-- src/index.js | 38 -------------------------------------- test/index.test.js | 2 +- 3 files changed, 3 insertions(+), 41 deletions(-) delete mode 100644 src/index.js diff --git a/package.json b/package.json index 16c7ac6..98d5820 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "feathers-multi-service", "description": "A Feathers service wrapper to use multiple services under one", - "version": "0.0.1", + "version": "0.0.2", "homepage": "https://github.com/dmitrovskiy/feathers-multi-service", "main": "lib/", "keywords": [ @@ -34,7 +34,7 @@ "ava": "ava -v ./test/**/**/*.test.js", "build": "redrun clean babel", "clean": "del ./dist", - "babel": "babel --source-maps --copy-files -d dist/ src/" + "babel": "babel --source-maps --copy-files -d dist/ lib/" }, "ava": { "babel": "inherit", diff --git a/src/index.js b/src/index.js deleted file mode 100644 index b1377ed..0000000 --- a/src/index.js +++ /dev/null @@ -1,38 +0,0 @@ -class Service { - constructor(options) { - if (!options) throw new Error('options must be set'); - if (!options.getService) throw new Error('options.getService must be set'); - - Object.assign(this, options); - } - - async find(params) { - return this.getService(params).find(params); - } - - async get(id, params) { - return this.getService(params).get(id, params); - } - - async create(data, params) { - return this.getService(params).create(data, params); - } - - async update(id, data, params) { - return this.getService(params).update(id, data, params); - } - - async patch(id, data, params) { - return this.getService(params).patch(id, data, params); - } - - async remove(id, params) { - return this.getService(params).remove(id, params); - } -} - -export default function init(options) { - return new Service(options); -} - -init.Service = Service; diff --git a/test/index.test.js b/test/index.test.js index 8b8cdc9..1027981 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -1,6 +1,6 @@ import test from 'ava'; import { assert } from 'chai'; -import service from '../src/index'; +import service from '../lib/index'; test('should throw error without options', () => { assert.throws(() => service(), 'options must be set');