@boost/common
Advanced tools
Comparing version 1.5.0 to 1.6.0
@@ -6,2 +6,23 @@ # Change Log | ||
## 1.6.0 - 2019-12-07 | ||
#### 🚀 Updates | ||
- **[PathResolver]** Add a mechanism for finding and resolving a path amongst a list of file paths or node modules. (#71) ([465e535](https://github.com/milesj/boost/commit/465e535)), closes [#71](https://github.com/milesj/boost/issues/71) | ||
- Add `deepFreeze` helper function. ([03472fa](https://github.com/milesj/boost/commit/03472fa)) | ||
#### ⚙️ Types | ||
- Add `ModuleName` and `Toolable` types. ([80d739f](https://github.com/milesj/boost/commit/80d739f)) | ||
#### 📦 Dependencies | ||
- **[optimal]** Update to v3.3. ([968d36b](https://github.com/milesj/boost/commit/968d36b)) | ||
**Note:** Version bump only for package @boost/common | ||
## 1.5.0 - 2019-11-28 | ||
@@ -8,0 +29,0 @@ |
@@ -9,4 +9,8 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const optimal_1 = __importStar(require("optimal")); | ||
const deepFreeze_1 = __importDefault(require("./helpers/deepFreeze")); | ||
class Contract { | ||
@@ -31,3 +35,3 @@ constructor(options) { | ||
// @ts-ignore | ||
this.options = Object.freeze(optimal_1.default({ ...this.options, ...options }, this.blueprint(optimal_1.predicates), { | ||
this.options = deepFreeze_1.default(optimal_1.default({ ...this.options, ...options }, this.blueprint(optimal_1.predicates), { | ||
name: this.constructor.name, | ||
@@ -34,0 +38,0 @@ })); |
@@ -1,2 +0,2 @@ | ||
export default function isObject<T>(value: unknown): value is T; | ||
export default function isObject<T = object>(value: unknown): value is T; | ||
//# sourceMappingURL=isObject.d.ts.map |
@@ -8,11 +8,6 @@ /** | ||
import Path from './Path'; | ||
import formatMs from './helpers/formatMs'; | ||
import instanceOf from './helpers/instanceOf'; | ||
import isEmpty from './helpers/isEmpty'; | ||
import isObject from './helpers/isObject'; | ||
import parseFile from './helpers/parseFile'; | ||
import requireModule from './helpers/requireModule'; | ||
import toArray from './helpers/toArray'; | ||
import PathResolver from './PathResolver'; | ||
export * from './helpers'; | ||
export * from './types'; | ||
export { Contract, Blueprint, Path, Predicates, formatMs, instanceOf, isEmpty, isObject, optimal, parseFile, requireModule, toArray, }; | ||
export { Contract, Blueprint, Path, PathResolver, Predicates, optimal }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -6,2 +6,5 @@ "use strict"; | ||
*/ | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -17,15 +20,5 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
exports.Path = Path_1.default; | ||
const formatMs_1 = __importDefault(require("./helpers/formatMs")); | ||
exports.formatMs = formatMs_1.default; | ||
const instanceOf_1 = __importDefault(require("./helpers/instanceOf")); | ||
exports.instanceOf = instanceOf_1.default; | ||
const isEmpty_1 = __importDefault(require("./helpers/isEmpty")); | ||
exports.isEmpty = isEmpty_1.default; | ||
const isObject_1 = __importDefault(require("./helpers/isObject")); | ||
exports.isObject = isObject_1.default; | ||
const parseFile_1 = __importDefault(require("./helpers/parseFile")); | ||
exports.parseFile = parseFile_1.default; | ||
const requireModule_1 = __importDefault(require("./helpers/requireModule")); | ||
exports.requireModule = requireModule_1.default; | ||
const toArray_1 = __importDefault(require("./helpers/toArray")); | ||
exports.toArray = toArray_1.default; | ||
const PathResolver_1 = __importDefault(require("./PathResolver")); | ||
exports.PathResolver = PathResolver_1.default; | ||
__export(require("./helpers")); | ||
__export(require("./types")); |
@@ -49,3 +49,3 @@ "use strict"; | ||
equals(filePath) { | ||
return this.path() === String(filePath); | ||
return this.path() === Path.create(filePath).path(); | ||
} | ||
@@ -52,0 +52,0 @@ /** |
import { Blueprint, Predicates } from 'optimal'; | ||
import Path from './Path'; | ||
export declare type ModuleName = string; | ||
export declare type FilePath = string; | ||
export declare type PortablePath = FilePath | Path; | ||
export declare enum LookupType { | ||
FILE_SYSTEM = "FILE_SYSTEM", | ||
NODE_MODULE = "NODE_MODULE" | ||
} | ||
export interface Lookup { | ||
path: Path; | ||
raw: Path; | ||
type: LookupType; | ||
} | ||
export declare type AbstractConstructor<T> = Function & { | ||
@@ -14,2 +24,5 @@ prototype: T; | ||
} | ||
export interface Toolable { | ||
name: string; | ||
} | ||
//# sourceMappingURL=types.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var LookupType; | ||
(function (LookupType) { | ||
LookupType["FILE_SYSTEM"] = "FILE_SYSTEM"; | ||
LookupType["NODE_MODULE"] = "NODE_MODULE"; | ||
})(LookupType = exports.LookupType || (exports.LookupType = {})); |
{ | ||
"name": "@boost/common", | ||
"version": "1.5.0", | ||
"version": "1.6.0", | ||
"description": "Common utilities for Boost applications.", | ||
@@ -25,7 +25,7 @@ "keywords": [ | ||
"json5": "^2.1.1", | ||
"optimal": "^3.2.1", | ||
"optimal": "^3.3.0", | ||
"pretty-ms": "^5.1.0" | ||
}, | ||
"devDependencies": { | ||
"@boost/test-utils": "^1.3.0" | ||
"@boost/test-utils": "^1.4.0" | ||
}, | ||
@@ -36,3 +36,3 @@ "funding": { | ||
}, | ||
"gitHead": "90eedb6c2a97f55d027bc34f406f2292e343d455" | ||
"gitHead": "a7fac69582efb763b9d5caa525a2f602245506b7" | ||
} |
{ | ||
"CM_PARSE_INVALID_EXT": "Unable to parse file \"%s\". Unsupported file extension.", | ||
"CM_PATH_RESOLVE_LOOKUPS": "Failed to resolve a path using the following lookups (in order):\n%s", | ||
"CM_REQ_ABS_PATH": "An absolute file path is required." | ||
} |
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
37775
47
694
5
Updatedoptimal@^3.3.0