@boost/common
Advanced tools
Comparing version 2.2.0 to 2.2.1
@@ -6,2 +6,14 @@ # Change Log | ||
### 2.2.1 - 2020-09-15 | ||
#### 📦 Dependencies | ||
- Update Babel, ESLint, Jest, and TypeScript. ([17befe6](https://github.com/milesj/boost/commit/17befe6)) | ||
**Note:** Version bump only for package @boost/common | ||
## 2.2.0 - 2020-08-17 | ||
@@ -8,0 +20,0 @@ |
@@ -5,16 +5,23 @@ 'use strict'; | ||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
var optimal = require('optimal'); | ||
var optimal__default = _interopDefault(optimal); | ||
var internal = require('@boost/internal'); | ||
var fs = _interopDefault(require('fs')); | ||
var path = _interopDefault(require('path')); | ||
var glob = _interopDefault(require('fast-glob')); | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
var glob = require('fast-glob'); | ||
var decorators = require('@boost/decorators'); | ||
var JSON = _interopDefault(require('json5')); | ||
var YAML = _interopDefault(require('yaml')); | ||
var prettyMs = _interopDefault(require('pretty-ms')); | ||
var JSON = require('json5'); | ||
var YAML = require('yaml'); | ||
var prettyMs = require('pretty-ms'); | ||
var module$1 = require('module'); | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var optimal__default = /*#__PURE__*/_interopDefaultLegacy(optimal); | ||
var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs); | ||
var path__default = /*#__PURE__*/_interopDefaultLegacy(path); | ||
var glob__default = /*#__PURE__*/_interopDefaultLegacy(glob); | ||
var JSON__default = /*#__PURE__*/_interopDefaultLegacy(JSON); | ||
var YAML__default = /*#__PURE__*/_interopDefaultLegacy(YAML); | ||
var prettyMs__default = /*#__PURE__*/_interopDefaultLegacy(prettyMs); | ||
const errors = { | ||
@@ -45,3 +52,3 @@ PARSE_INVALID_EXT: 'Unable to parse file "{0}". Unsupported file extension.', | ||
this.options = Object.freeze(optimal__default({ ...this.options, | ||
this.options = Object.freeze(optimal__default['default']({ ...this.options, | ||
...nextOptions | ||
@@ -75,3 +82,3 @@ }, this.blueprint(optimal.predicates), { | ||
// Always use forward slashes for better interop | ||
this.internalPath = path.normalize(path.join(...parts.map(String))).replace(/\\/gu, Path.SEP); | ||
this.internalPath = path__default['default'].normalize(path__default['default'].join(...parts.map(String))).replace(/\\/gu, Path.SEP); | ||
} | ||
@@ -118,3 +125,3 @@ /** | ||
ext(withoutPeriod = false) { | ||
const ext = path.extname(this.internalPath); | ||
const ext = path__default['default'].extname(this.internalPath); | ||
return withoutPeriod && ext.startsWith('.') ? ext.slice(1) : ext; | ||
@@ -128,3 +135,3 @@ } | ||
exists() { | ||
return fs.existsSync(this.internalPath); | ||
return fs__default['default'].existsSync(this.internalPath); | ||
} | ||
@@ -137,3 +144,3 @@ /** | ||
isAbsolute() { | ||
return path.isAbsolute(this.internalPath); | ||
return path__default['default'].isAbsolute(this.internalPath); | ||
} | ||
@@ -146,3 +153,3 @@ /** | ||
isDirectory() { | ||
return fs.statSync(this.internalPath).isDirectory(); | ||
return fs__default['default'].statSync(this.internalPath).isDirectory(); | ||
} | ||
@@ -155,3 +162,3 @@ /** | ||
isFile() { | ||
return fs.statSync(this.internalPath).isFile(); | ||
return fs__default['default'].statSync(this.internalPath).isFile(); | ||
} | ||
@@ -164,3 +171,3 @@ /** | ||
name(withoutExtension = false) { | ||
let name = path.basename(this.internalPath); | ||
let name = path__default['default'].basename(this.internalPath); | ||
@@ -179,3 +186,3 @@ if (withoutExtension) { | ||
parent() { | ||
return new Path(path.dirname(this.internalPath)); | ||
return new Path(path__default['default'].dirname(this.internalPath)); | ||
} | ||
@@ -206,3 +213,3 @@ /** | ||
realPath() { | ||
return fs.realpathSync.native(this.path()); | ||
return fs__default['default'].realpathSync.native(this.path()); | ||
} | ||
@@ -216,3 +223,3 @@ /** | ||
relativeTo(to) { | ||
return new Path(path.relative(this.path(), String(to))); | ||
return new Path(path__default['default'].relative(this.path(), String(to))); | ||
} | ||
@@ -226,3 +233,3 @@ /** | ||
resolve(cwd) { | ||
return new Path(path.resolve(String(cwd || process.cwd()), this.internalPath)); | ||
return new Path(path__default['default'].resolve(String(cwd || process.cwd()), this.internalPath)); | ||
} | ||
@@ -239,3 +246,3 @@ | ||
} | ||
Path.DELIMITER = path.delimiter; | ||
Path.DELIMITER = path__default['default'].delimiter; | ||
Path.SEP = '/'; | ||
@@ -377,2 +384,3 @@ | ||
let value = require(String(path)); // Support Babel compiled files | ||
// eslint-disable-next-line no-underscore-dangle | ||
@@ -388,6 +396,6 @@ | ||
function parse(content, reviver) { | ||
return JSON.parse(content, reviver); | ||
return JSON__default['default'].parse(content, reviver); | ||
} | ||
function stringify(content, options) { | ||
return JSON.stringify(content, options); | ||
return JSON__default['default'].stringify(content, options); | ||
} | ||
@@ -402,6 +410,6 @@ | ||
function parse$1(content, options) { | ||
return YAML.parse(content, options); | ||
return YAML__default['default'].parse(content, options); | ||
} | ||
function stringify$1(content, options) { | ||
return YAML.stringify(content, options); | ||
return YAML__default['default'].stringify(content, options); | ||
} | ||
@@ -429,7 +437,7 @@ | ||
case '.json5': | ||
return parse(fs.readFileSync(path.path(), 'utf8')); | ||
return parse(fs__default['default'].readFileSync(path.path(), 'utf8')); | ||
case '.yml': | ||
case '.yaml': | ||
return parse$1(fs.readFileSync(path.path(), 'utf8')); | ||
return parse$1(fs__default['default'].readFileSync(path.path(), 'utf8')); | ||
@@ -534,3 +542,3 @@ default: | ||
getWorkspacePackages() { | ||
return glob.sync(this.getWorkspaceGlobs({ | ||
return glob__default['default'].sync(this.getWorkspaceGlobs({ | ||
relative: true | ||
@@ -555,3 +563,3 @@ }), { | ||
getWorkspacePackagePaths(options = {}) { | ||
return glob.sync(this.getWorkspaceGlobs({ | ||
return glob__default['default'].sync(this.getWorkspaceGlobs({ | ||
relative: true | ||
@@ -603,3 +611,3 @@ }), { | ||
return prettyMs(ms, { | ||
return prettyMs__default['default'](ms, { | ||
keepDecimalsOnWholeSeconds: true, | ||
@@ -705,3 +713,8 @@ ...options | ||
}); | ||
exports.optimal = optimal__default; | ||
Object.defineProperty(exports, 'optimal', { | ||
enumerable: true, | ||
get: function () { | ||
return optimal__default['default']; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'predicates', { | ||
@@ -708,0 +721,0 @@ enumerable: true, |
{ | ||
"name": "@boost/common", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"release": "1594765247526", | ||
@@ -38,3 +38,3 @@ "description": "A collection of common utilities, classes, and helpers.", | ||
}, | ||
"gitHead": "7982950ce80d97d1815234ee0d66b5dc4ac3a843" | ||
"gitHead": "cb8ff01f674543255334eb8c3d9a85c1b6dbc790" | ||
} |
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
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
58423
940
0