mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-26 22:11:24 +01:00
merge completed... now to fix all the bugs...
This commit is contained in:
commit
87c4d80fbc
3472 changed files with 466748 additions and 6517 deletions
53
node_modules/tsconfig-paths/lib/filesystem.js
generated
vendored
Normal file
53
node_modules/tsconfig-paths/lib/filesystem.js
generated
vendored
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var fs = require("fs");
|
||||
function fileExistsSync(path) {
|
||||
try {
|
||||
var stats = fs.statSync(path);
|
||||
return stats.isFile();
|
||||
}
|
||||
catch (err) {
|
||||
// If error, assume file did not exist
|
||||
return false;
|
||||
}
|
||||
}
|
||||
exports.fileExistsSync = fileExistsSync;
|
||||
/**
|
||||
* Reads package.json from disk
|
||||
* @param file Path to package.json
|
||||
*/
|
||||
// tslint:disable-next-line:no-any
|
||||
function readJsonFromDiskSync(packageJsonPath) {
|
||||
if (!fs.existsSync(packageJsonPath)) {
|
||||
return undefined;
|
||||
}
|
||||
return require(packageJsonPath);
|
||||
}
|
||||
exports.readJsonFromDiskSync = readJsonFromDiskSync;
|
||||
function readJsonFromDiskAsync(path,
|
||||
// tslint:disable-next-line:no-any
|
||||
callback) {
|
||||
fs.readFile(path, "utf8", function (err, result) {
|
||||
// If error, assume file did not exist
|
||||
if (err || !result) {
|
||||
return callback();
|
||||
}
|
||||
var json = JSON.parse(result);
|
||||
return callback(undefined, json);
|
||||
});
|
||||
}
|
||||
exports.readJsonFromDiskAsync = readJsonFromDiskAsync;
|
||||
function fileExistsAsync(path2, callback2) {
|
||||
fs.stat(path2, function (err, stats) {
|
||||
if (err) {
|
||||
// If error assume file does not exist
|
||||
return callback2(undefined, false);
|
||||
}
|
||||
callback2(undefined, stats ? stats.isFile() : false);
|
||||
});
|
||||
}
|
||||
exports.fileExistsAsync = fileExistsAsync;
|
||||
function removeExtension(path) {
|
||||
return path.substring(0, path.lastIndexOf(".")) || path;
|
||||
}
|
||||
exports.removeExtension = removeExtension;
|
||||
Loading…
Add table
Add a link
Reference in a new issue