axios-mock-server
Advanced tools
Comparing version 0.17.1 to 0.17.2
@@ -5,2 +5,9 @@ # Changelog | ||
### [0.17.2](https://github.com/solufa/axios-mock-server/compare/v0.17.1...v0.17.2) (2020-07-26) | ||
### Bug Fixes | ||
* version option of cli ([844ee33](https://github.com/solufa/axios-mock-server/commit/844ee337a42b12b2a613854d195498593034baed)) | ||
### [0.17.1](https://github.com/solufa/axios-mock-server/compare/v0.17.0...v0.17.1) (2020-07-21) | ||
@@ -7,0 +14,0 @@ |
@@ -7,3 +7,3 @@ "use strict"; | ||
exports.run = void 0; | ||
var fs_1 = __importDefault(require("fs")); | ||
var path_1 = __importDefault(require("path")); | ||
var minimist_1 = __importDefault(require("minimist")); | ||
@@ -23,16 +23,9 @@ var getConfig_1 = __importDefault(require("./getConfig")); | ||
if (argv.version !== undefined) { | ||
console.log("v" + require('../../package').version); | ||
console.log("v" + require(path_1.default.join(__dirname, '../../package.json')).version); | ||
} | ||
if (argv.build !== undefined || argv.watch !== undefined) { | ||
getInputs_1.default(config.input).forEach(function (input) { | ||
var prevResult = buildRouteFile_1.default(input, config, argv.baseurl); | ||
writeRouteFile_1.default(prevResult); | ||
writeRouteFile_1.default(buildRouteFile_1.default(input, config, argv.baseurl)); | ||
if (argv.watch !== undefined) { | ||
watchInputDir_1.default(input, function () { | ||
var result = buildRouteFile_1.default(input, config, argv.baseurl); | ||
if (prevResult.text !== result.text || prevResult.filePath !== result.filePath) { | ||
fs_1.default.unlink(prevResult.filePath, function () { return writeRouteFile_1.default(result); }); | ||
prevResult = result; | ||
} | ||
}); | ||
watchInputDir_1.default(input, function () { return writeRouteFile_1.default(buildRouteFile_1.default(input, config, argv.baseurl)); }); | ||
} | ||
@@ -39,0 +32,0 @@ }); |
@@ -9,2 +9,4 @@ "use strict"; | ||
var filePath = _a.filePath, text = _a.text; | ||
if (fs_1.default.existsSync(filePath) && fs_1.default.readFileSync(filePath, 'utf8') === text) | ||
return; | ||
fs_1.default.writeFileSync(filePath, text, 'utf8'); | ||
@@ -11,0 +13,0 @@ console.log(filePath + " was built successfully."); |
{ | ||
"name": "axios-mock-server", | ||
"version": "0.17.1", | ||
"version": "0.17.2", | ||
"description": "RESTful mock server using axios", | ||
@@ -11,3 +11,3 @@ "author": "Solufa <solufa2020@gmail.com>", | ||
"dev": "npm run build && node bin/index.js -c devConfigs/.js.rc -b -u https://example.com/api && node bin/index.js -c devConfigs/.ts.rc -b -u https://example.com/api", | ||
"build": "node -e \"require('fs').rmdirSync('dist', { recursive: true })\" && tsc --project tsconfig.build.json", | ||
"build": "node -e \"require('fs').rmdirSync('dist', { recursive: true })\" && tsc -p tsconfig.build.json", | ||
"release": "standard-version --skip.tag", | ||
@@ -73,2 +73,3 @@ "release:major": "npm run release -- --release-as major", | ||
"trailingComma": "none", | ||
"endOfLine": "auto", | ||
"overrides": [ | ||
@@ -87,3 +88,3 @@ { | ||
"devDependencies": { | ||
"@types/jest": "^26.0.5", | ||
"@types/jest": "^26.0.7", | ||
"@types/minimist": "^1.2.0", | ||
@@ -97,3 +98,3 @@ "@typescript-eslint/eslint-plugin": "^2.34.0", | ||
"eslint-plugin-import": "^2.22.0", | ||
"eslint-plugin-jest": "^23.18.0", | ||
"eslint-plugin-jest": "^23.18.2", | ||
"eslint-plugin-node": "^11.1.0", | ||
@@ -100,0 +101,0 @@ "eslint-plugin-prettier": "^3.1.4", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
93287
864