Comparing version 1.1.9 to 1.2.0
"use strict"; | ||
const os = require('os'); | ||
module.exports = class ExeFile { | ||
constructor(fileNamePattern, props = { | ||
os: os.platform(), | ||
arch: os.arch() | ||
}) { | ||
this._filenamePattern = fileNamePattern; | ||
this._props = props; | ||
} | ||
get fileName() { | ||
return this._filenamePattern.replace('{{.OS}}', this._os()).replace('{{.Arch}}', this._arch()).replace('{{.Ext}}', this._ext()); | ||
} | ||
_os() { | ||
// https://nodejs.org/dist/latest-v10.x/docs/api/os.html#os_os_platform | ||
return { | ||
win32: 'windows' | ||
}[this._props.os] || this._props.os; | ||
} | ||
_arch() { | ||
// https://nodejs.org/dist/latest-v10.x/docs/api/process.html#process_process_arch | ||
return { | ||
mipsel: 'mipsle', | ||
x32: '386', | ||
x64: 'amd64' | ||
}[this._props.arch] || this._props.arch; | ||
} | ||
_ext() { | ||
return 'windows' === this._os() ? '.exe' : ''; | ||
} | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var os_1 = __importDefault(require("os")); | ||
var ExeFile = /** @class */ (function () { | ||
function ExeFile(fileNamePattern, props) { | ||
if (props === void 0) { props = { | ||
os: os_1.default.platform(), | ||
arch: os_1.default.arch(), | ||
}; } | ||
this.fileNamePattern = fileNamePattern; | ||
this.props = props; | ||
} | ||
Object.defineProperty(ExeFile.prototype, "fileName", { | ||
get: function () { | ||
return this.fileNamePattern | ||
.replace('{{.OS}}', this.os()) | ||
.replace('{{.Arch}}', this.arch()) | ||
.replace('{{.Ext}}', this.ext()); | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
ExeFile.prototype.os = function () { | ||
// https://nodejs.org/dist/latest-v10.x/docs/api/os.html#os_os_platform | ||
var defaults = { | ||
win32: 'windows', | ||
}; | ||
return defaults[this.props.os] || this.props.os; | ||
}; | ||
ExeFile.prototype.arch = function () { | ||
// https://nodejs.org/dist/latest-v10.x/docs/api/process.html#process_process_arch | ||
var defaults = { | ||
mipsel: 'mipsle', | ||
x32: '386', | ||
x64: 'amd64', | ||
}; | ||
return defaults[this.props.arch] || this.props.arch; | ||
}; | ||
ExeFile.prototype.ext = function () { | ||
return 'windows' === this.os() ? '.exe' : ''; | ||
}; | ||
return ExeFile; | ||
}()); | ||
exports.default = ExeFile; | ||
//# sourceMappingURL=ExeFile.js.map |
{ | ||
"name": "c21e", | ||
"version": "1.1.9", | ||
"version": "1.2.0", | ||
"description": "Cucumber Tag Expression parser", | ||
"main": "dist/src/ExeFile.js", | ||
"types": "dist/src/ExeFile.d.ts", | ||
"scripts": { | ||
"test": "mocha", | ||
"eslint-fix": "eslint --fix src test", | ||
"coverage": "nyc --reporter=html --reporter=text mocha", | ||
"build": "babel src --out-dir dist/src", | ||
"build-test": "babel test --out-dir dist/test", | ||
"prepublishOnly": "npm run build", | ||
"mocha-built": "mocha dist/test" | ||
"test": "mocha test/**/*.ts", | ||
"lint": "tslint src/**/*.ts test/**/*.ts", | ||
"lint-fix": "tslint --fix src/**/*.ts test/**/*.ts", | ||
"coverage": "nyc --reporter=html --reporter=text mocha test/**/*.ts", | ||
"build": "tsc", | ||
"prepublishOnly": "npm run build" | ||
}, | ||
@@ -29,16 +29,13 @@ "repository": { | ||
"devDependencies": { | ||
"@babel/cli": "^7.0.0", | ||
"@babel/core": "^7.0.0", | ||
"@babel/plugin-transform-async-to-generator": "^7.0.0", | ||
"@babel/polyfill": "^7.0.0", | ||
"@babel/preset-env": "^7.0.0", | ||
"eslint": "^5.3.0", | ||
"eslint-config-eslint": "^5.0.1", | ||
"eslint-config-prettier": "^4.1.0", | ||
"eslint-plugin-node": "^8.0.0", | ||
"eslint-plugin-prettier": "^3.0.0", | ||
"mocha": "^6.0.2", | ||
"nyc": "^13.1.0", | ||
"prettier": "^1.8.2" | ||
"@types/mocha": "^5.2.6", | ||
"@types/node": "^11.13.9", | ||
"mocha": "^6.1.2", | ||
"nyc": "^14.0.0", | ||
"prettier": "^1.17.0", | ||
"ts-node": "^8.1.0", | ||
"tslint": "^5.16.0", | ||
"tslint-config-prettier": "^1.18.0", | ||
"tslint-plugin-prettier": "^2.0.1", | ||
"typescript": "^3.4.5" | ||
} | ||
} |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12148
10
23
200
1