@makerdao/services-core
Advanced tools
Comparing version 0.9.4 to 0.9.5
@@ -119,3 +119,3 @@ 'use strict'; | ||
value: function isValidService(service) { | ||
return service !== null && (typeof service === 'undefined' ? 'undefined' : (0, _typeof3.default)(service)) === 'object' && typeof service.manager === 'function' && service.manager() instanceof ServiceManager; | ||
return service !== null && (typeof service === 'undefined' ? 'undefined' : (0, _typeof3.default)(service)) === 'object' && typeof service.manager === 'function'; | ||
} | ||
@@ -122,0 +122,0 @@ |
{ | ||
"name": "@makerdao/services-core", | ||
"description": "Dependency injection framework", | ||
"version": "0.9.4", | ||
"version": "0.9.5", | ||
"license": "MIT", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"prepublishOnly": "babel -d dist src" | ||
"prepublishOnly": "babel -d dist src", | ||
"test": "jest" | ||
}, | ||
@@ -10,0 +11,0 @@ "devDependencies": { |
# @makerdao/services-core | ||
A dependency injection framework extracted from [dai.js](https://github.com/makerdao/dai.js). | ||
A dependency injection framework extracted from [dai.js](https://github.com/makerdao/dai.js). | ||
### Usage | ||
### TODO | ||
TODO: finish this example. | ||
- [ ] bring [ServiceProvider](https://github.com/makerdao/dai.js/blob/dev/src/config/ServiceProvider.js) over | ||
- [ ] create full usage example | ||
### Usage (TODO) | ||
```js | ||
@@ -10,0 +13,0 @@ class MyService extends PrivateService { |
@@ -57,4 +57,3 @@ import ServiceManagerBase from './ServiceManagerBase'; | ||
typeof service === 'object' && | ||
typeof service.manager === 'function' && | ||
service.manager() instanceof ServiceManager | ||
typeof service.manager === 'function' | ||
); | ||
@@ -61,0 +60,0 @@ } |
@@ -9,3 +9,3 @@ import ServiceManager, { | ||
test('should only mark objects with a method manager() returning a ServiceManager as valid', () => { | ||
test('should only mark objects with a manager() method as valid', () => { | ||
expect( | ||
@@ -16,4 +16,3 @@ ServiceManager.isValidService({ manager: () => new ServiceManager(name) }) | ||
expect(ServiceManager.isValidService({ manager: true })).toBe(false); | ||
expect(ServiceManager.isValidService({ manager: () => true })).toBe(false); | ||
expect(ServiceManager.isValidService({ manager: () => ({}) })).toBe(false); | ||
expect(ServiceManager.isValidService({ manager: () => ({}) })).toBe(true); | ||
}); | ||
@@ -20,0 +19,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31
300028
3459