We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
utilities.class.js
1 parent 96014dc commit 569a05fCopy full SHA for 569a05f
src/lib/utilities.class.js
@@ -1,3 +1,5 @@
1
+import { existsSync, copyFileSync } from 'fs'
2
+
3
class Utility {
4
LoggerType = {
5
'info': "Info",
@@ -22,6 +24,10 @@ class Utility {
22
24
if (condition) console.log(`${typeFormatted}`, text)
23
25
}
26
27
+ copyIfNotExists = (location, source) => {
28
+ if (!existsSync(location)) copyFileSync(source, location)
29
+ }
30
31
#isArrayEmpty = (data = []) => {
32
return (data === undefined || data.length === 0) ? false : true
33
@@ -34,4 +40,4 @@ class Utility {
34
40
35
41
36
42
export default new Utility()
37
-export const { Logger, LoggerType } = new Utility()
43
+export const { Logger, LoggerType, copyIfNotExists } = new Utility()
0 commit comments