fable-serviceproviderbase 3.0.3 → 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -9,16 +9,25 @@ class FableServiceProviderBase
|
|
|
9
9
|
{
|
|
10
10
|
this.fable = pFable;
|
|
11
11
|
|
|
12
|
-
this.options = (typeof(pOptions) === 'object') ? pOptions
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
this.options = (typeof(pOptions) === 'object') ? pOptions
|
|
13
|
+
: ((typeof(pFable) === 'object') && !pFable.isFable) ? pFable
|
|
14
|
+
: {};
|
|
15
|
+
|
|
16
|
+
this.serviceType = 'Unknown';
|
|
17
|
+
|
|
18
|
+
if (typeof(pFable.getUUID) == 'function')
|
|
19
|
+
{
|
|
20
|
+
this.UUID = pFable.getUUID();
|
|
21
|
+
}
|
|
22
|
+
else
|
|
23
|
+
{
|
|
24
|
+
this.UUID = `NoFABLESVC-${Math.floor((Math.random() * (99999 - 10000)) + 10000)}`
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
this.Hash = (typeof(pServiceHash) === 'string') ? pServiceHash : `${this.UUID}`;
|
|
19
28
|
}
|
|
20
29
|
|
|
21
|
-
|
|
30
|
+
static isFableService = true;
|
|
22
31
|
}
|
|
23
32
|
|
|
24
33
|
module.exports = FableServiceProviderBase;
|
|
@@ -88,7 +88,7 @@ suite
|
|
|
88
88
|
function()
|
|
89
89
|
{
|
|
90
90
|
testFable = new libFable();
|
|
91
|
-
|
|
91
|
+
|
|
92
92
|
let tmpSimpleService = new SimpleService(testFable, {SomeOption: true});
|
|
93
93
|
|
|
94
94
|
tmpSimpleService.doSomething();
|
|
@@ -241,6 +241,18 @@ suite
|
|
|
241
241
|
}
|
|
242
242
|
)
|
|
243
243
|
|
|
244
|
+
test
|
|
245
|
+
(
|
|
246
|
+
'Construct a service without a fable at all',
|
|
247
|
+
function()
|
|
248
|
+
{
|
|
249
|
+
let tmpService = new SimpleService({Setting:'Something'});
|
|
250
|
+
|
|
251
|
+
Expect(tmpService.options.Setting).to.equal('Something');
|
|
252
|
+
Expect(tmpService.UUID).to.be.a('string');
|
|
253
|
+
}
|
|
254
|
+
)
|
|
255
|
+
|
|
244
256
|
test
|
|
245
257
|
(
|
|
246
258
|
'Attempt to change the default service provider to a nonexistant provider',
|