@caruuto/caruuto-js 0.4.0 → 0.4.1
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/lib/extensions.js +10 -13
- package/package.json +1 -1
package/lib/extensions.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
const fs = require('fs')
|
|
2
|
-
const path = require('path')
|
|
3
|
-
|
|
4
1
|
/*
|
|
5
2
|
Each extension should be added to the CaruutoClient prototype, so that
|
|
6
3
|
for example, the email extension can be used as:
|
|
@@ -36,18 +33,18 @@ module.exports = function (CaruutoClient, clientInstance) {
|
|
|
36
33
|
```
|
|
37
34
|
*/
|
|
38
35
|
|
|
36
|
+
const emailExtension = require('./extensions/email')
|
|
37
|
+
const tokensExtension = require('./extensions/tokens')
|
|
38
|
+
|
|
39
39
|
// Load all extensions from the lib/extensions directory/
|
|
40
40
|
module.exports = function (CaruutoClient, clientInstance) {
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
if (typeof emailExtension === 'function') {
|
|
42
|
+
emailExtension(CaruutoClient, clientInstance)
|
|
43
|
+
}
|
|
43
44
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
if (typeof tokensExtension === 'function') {
|
|
46
|
+
tokensExtension(CaruutoClient, clientInstance)
|
|
47
|
+
}
|
|
47
48
|
|
|
48
|
-
|
|
49
|
-
extension(CaruutoClient, clientInstance)
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
})
|
|
49
|
+
// Add any other extensions here.
|
|
53
50
|
}
|