@bemoje/fs 0.2.6 → 0.2.7
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 +1 -1
- package/src/index.d.ts +3 -0
- package/src/index.js +3 -0
- package/src/index.js.map +1 -1
- package/src/lib/getOS.d.ts +6 -0
- package/src/lib/getOS.js +22 -0
- package/src/lib/getOS.js.map +1 -0
- package/src/lib/isLinux.d.ts +6 -0
- package/src/lib/isLinux.js +13 -0
- package/src/lib/isLinux.js.map +1 -0
- package/src/lib/isOSX.d.ts +6 -0
- package/src/lib/isOSX.js +13 -0
- package/src/lib/isOSX.js.map +1 -0
- package/src/lib/isWindows.d.ts +7 -2
- package/src/lib/isWindows.js +8 -9
- package/src/lib/isWindows.js.map +1 -1
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -15,7 +15,10 @@ export * from './lib/getDiskDrivesWindows';
|
|
|
15
15
|
export * from './lib/getDownloadsDirectory';
|
|
16
16
|
export * from './lib/getHomeDirectory';
|
|
17
17
|
export * from './lib/getLastMofifiedFileIn';
|
|
18
|
+
export * from './lib/getOS';
|
|
18
19
|
export * from './lib/getRootDir';
|
|
20
|
+
export * from './lib/isLinux';
|
|
21
|
+
export * from './lib/isOSX';
|
|
19
22
|
export * from './lib/isWindows';
|
|
20
23
|
export * from './lib/JsonFile';
|
|
21
24
|
export * from './lib/LogFile';
|
package/src/index.js
CHANGED
|
@@ -18,7 +18,10 @@ tslib_1.__exportStar(require("./lib/getDiskDrivesWindows"), exports);
|
|
|
18
18
|
tslib_1.__exportStar(require("./lib/getDownloadsDirectory"), exports);
|
|
19
19
|
tslib_1.__exportStar(require("./lib/getHomeDirectory"), exports);
|
|
20
20
|
tslib_1.__exportStar(require("./lib/getLastMofifiedFileIn"), exports);
|
|
21
|
+
tslib_1.__exportStar(require("./lib/getOS"), exports);
|
|
21
22
|
tslib_1.__exportStar(require("./lib/getRootDir"), exports);
|
|
23
|
+
tslib_1.__exportStar(require("./lib/isLinux"), exports);
|
|
24
|
+
tslib_1.__exportStar(require("./lib/isOSX"), exports);
|
|
22
25
|
tslib_1.__exportStar(require("./lib/isWindows"), exports);
|
|
23
26
|
tslib_1.__exportStar(require("./lib/JsonFile"), exports);
|
|
24
27
|
tslib_1.__exportStar(require("./lib/LogFile"), exports);
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/fs/src/index.ts"],"names":[],"mappings":";;;AAAA,uEAA4C;AAC5C,wDAA6B;AAC7B,iEAAsC;AACtC,mEAAwC;AACxC,gEAAqC;AACrC,oEAAyC;AACzC,0EAA+C;AAC/C,wDAA6B;AAC7B,gEAAqC;AACrC,oEAAyC;AACzC,wEAA6C;AAC7C,oEAAyC;AACzC,uEAA4C;AAC5C,qEAA0C;AAC1C,sEAA2C;AAC3C,iEAAsC;AACtC,sEAA2C;AAC3C,2DAAgC;AAChC,0DAA+B;AAC/B,yDAA8B;AAC9B,wDAA6B;AAC7B,uEAA4C;AAC5C,kEAAuC;AACvC,6DAAkC;AAClC,iEAAsC;AACtC,gEAAqC;AACrC,gFAAqD;AACrD,yDAA8B;AAC9B,qFAA0D;AAC1D,mEAAwC;AACxC,0DAA+B;AAC/B,gEAAqC;AACrC,kEAAuC;AACvC,8DAAmC;AACnC,kEAAuC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/fs/src/index.ts"],"names":[],"mappings":";;;AAAA,uEAA4C;AAC5C,wDAA6B;AAC7B,iEAAsC;AACtC,mEAAwC;AACxC,gEAAqC;AACrC,oEAAyC;AACzC,0EAA+C;AAC/C,wDAA6B;AAC7B,gEAAqC;AACrC,oEAAyC;AACzC,wEAA6C;AAC7C,oEAAyC;AACzC,uEAA4C;AAC5C,qEAA0C;AAC1C,sEAA2C;AAC3C,iEAAsC;AACtC,sEAA2C;AAC3C,sDAA2B;AAC3B,2DAAgC;AAChC,wDAA6B;AAC7B,sDAA2B;AAC3B,0DAA+B;AAC/B,yDAA8B;AAC9B,wDAA6B;AAC7B,uEAA4C;AAC5C,kEAAuC;AACvC,6DAAkC;AAClC,iEAAsC;AACtC,gEAAqC;AACrC,gFAAqD;AACrD,yDAA8B;AAC9B,qFAA0D;AAC1D,mEAAwC;AACxC,0DAA+B;AAC/B,gEAAqC;AACrC,kEAAuC;AACvC,8DAAmC;AACnC,kEAAuC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Determines the current operating system.
|
|
3
|
+
* It uses the isWindows, isOSX, and isLinux functions to determine the current operating system.
|
|
4
|
+
* @returns A string indicating the current operating system. It can be 'windows', 'osx', 'linux', or 'unknown'.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getOS(): 'windows' | 'osx' | 'linux' | 'unknown';
|
package/src/lib/getOS.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getOS = void 0;
|
|
4
|
+
const isLinux_1 = require("./isLinux");
|
|
5
|
+
const isOSX_1 = require("./isOSX");
|
|
6
|
+
const isWindows_1 = require("./isWindows");
|
|
7
|
+
/**
|
|
8
|
+
* Determines the current operating system.
|
|
9
|
+
* It uses the isWindows, isOSX, and isLinux functions to determine the current operating system.
|
|
10
|
+
* @returns A string indicating the current operating system. It can be 'windows', 'osx', 'linux', or 'unknown'.
|
|
11
|
+
*/
|
|
12
|
+
function getOS() {
|
|
13
|
+
if ((0, isLinux_1.isLinux)())
|
|
14
|
+
return 'linux';
|
|
15
|
+
if ((0, isOSX_1.isOSX)())
|
|
16
|
+
return 'osx';
|
|
17
|
+
if ((0, isWindows_1.isWindows)())
|
|
18
|
+
return 'windows';
|
|
19
|
+
return 'unknown';
|
|
20
|
+
}
|
|
21
|
+
exports.getOS = getOS;
|
|
22
|
+
//# sourceMappingURL=getOS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getOS.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/getOS.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AACnC,mCAA+B;AAC/B,2CAAuC;AAEvC;;;;GAIG;AAEH,SAAgB,KAAK;IACnB,IAAI,IAAA,iBAAO,GAAE;QAAE,OAAO,OAAO,CAAA;IAC7B,IAAI,IAAA,aAAK,GAAE;QAAE,OAAO,KAAK,CAAA;IACzB,IAAI,IAAA,qBAAS,GAAE;QAAE,OAAO,SAAS,CAAA;IACjC,OAAO,SAAS,CAAA;AAClB,CAAC;AALD,sBAKC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if the current platform is Linux.
|
|
3
|
+
* It checks the 'process' object and the 'platform' property to determine if the platform is 'linux'.
|
|
4
|
+
* @returns A boolean indicating whether the current platform is Linux.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isLinux(): boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Checks if the current platform is Linux.
|
|
4
|
+
* It checks the 'process' object and the 'platform' property to determine if the platform is 'linux'.
|
|
5
|
+
* @returns A boolean indicating whether the current platform is Linux.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.isLinux = void 0;
|
|
9
|
+
function isLinux() {
|
|
10
|
+
return process.platform === 'linux';
|
|
11
|
+
}
|
|
12
|
+
exports.isLinux = isLinux;
|
|
13
|
+
//# sourceMappingURL=isLinux.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isLinux.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/isLinux.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,SAAgB,OAAO;IACrB,OAAO,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAA;AACrC,CAAC;AAFD,0BAEC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if the current platform is OSX.
|
|
3
|
+
* It checks the 'process' object and the 'platform' property to determine if the platform is 'darwin'.
|
|
4
|
+
* @returns A boolean indicating whether the current platform is OSX.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isOSX(): boolean;
|
package/src/lib/isOSX.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Checks if the current platform is OSX.
|
|
4
|
+
* It checks the 'process' object and the 'platform' property to determine if the platform is 'darwin'.
|
|
5
|
+
* @returns A boolean indicating whether the current platform is OSX.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.isOSX = void 0;
|
|
9
|
+
function isOSX() {
|
|
10
|
+
return process.platform === 'darwin';
|
|
11
|
+
}
|
|
12
|
+
exports.isOSX = isOSX;
|
|
13
|
+
//# sourceMappingURL=isOSX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isOSX.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/isOSX.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,SAAgB,KAAK;IACnB,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAA;AACtC,CAAC;AAFD,sBAEC"}
|
package/src/lib/isWindows.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if the current platform is Windows.
|
|
3
|
+
* @remarks
|
|
4
|
+
* It checks the 'process' object and the 'platform' property to determine if the platform is 'win32'.
|
|
5
|
+
* It also checks the 'OSTYPE' environment variable to see if it matches 'msys' or 'cygwin'.
|
|
6
|
+
* @returns A boolean indicating whether the current platform is Windows.
|
|
7
|
+
*/
|
|
1
8
|
export declare function isWindows(): boolean;
|
|
2
|
-
export declare function isOSX(): boolean;
|
|
3
|
-
export declare function isLinux(): boolean;
|
package/src/lib/isWindows.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isWindows = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Checks if the current platform is Windows.
|
|
6
|
+
* @remarks
|
|
7
|
+
* It checks the 'process' object and the 'platform' property to determine if the platform is 'win32'.
|
|
8
|
+
* It also checks the 'OSTYPE' environment variable to see if it matches 'msys' or 'cygwin'.
|
|
9
|
+
* @returns A boolean indicating whether the current platform is Windows.
|
|
10
|
+
*/
|
|
4
11
|
function isWindows() {
|
|
5
12
|
return process && (process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env['OSTYPE'] || ''));
|
|
6
13
|
}
|
|
7
14
|
exports.isWindows = isWindows;
|
|
8
|
-
function isOSX() {
|
|
9
|
-
return process.platform === 'darwin';
|
|
10
|
-
}
|
|
11
|
-
exports.isOSX = isOSX;
|
|
12
|
-
function isLinux() {
|
|
13
|
-
return process.platform === 'linux';
|
|
14
|
-
}
|
|
15
|
-
exports.isLinux = isLinux;
|
|
16
15
|
//# sourceMappingURL=isWindows.js.map
|
package/src/lib/isWindows.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isWindows.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/isWindows.ts"],"names":[],"mappings":";;;AAAA,SAAgB,SAAS;IACvB,OAAO,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO,IAAI,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;AACzG,CAAC;AAFD,8BAEC
|
|
1
|
+
{"version":3,"file":"isWindows.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/isWindows.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,SAAgB,SAAS;IACvB,OAAO,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO,IAAI,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;AACzG,CAAC;AAFD,8BAEC"}
|