New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@boost/common

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@boost/common - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

lib/Contract.d.ts.map

9

CHANGELOG.md

@@ -0,1 +1,10 @@

## 1.1.0 - 2019-06-21
#### 🚀 Updates
- Added `formatMs`, `instanceOf`, `isEmpty`, `isObject`, `parseFile`, `requireModule`, and `toArray`
helper functions.
- Added `Contract#configure` as a means to update the options object after instantiation.
- Updated the `Contract` options object to be frozen after each configure.
### 1.0.1 - 2019-05-09

@@ -2,0 +11,0 @@

@@ -6,3 +6,14 @@ import { Blueprint, Predicates } from 'optimal';

constructor(options?: T);
/**
* Set an options object by merging the new partial and existing options
* with the defined blueprint, while running all validation checks.
* Freeze and return the options object.
*/
configure(options?: Partial<T>): Required<T>;
/**
* Define an optimal blueprint in which to validate and build the
* options object passed to the constructor, or when manual setting.
*/
abstract blueprint(predicates: Predicates): Blueprint<T>;
}
//# sourceMappingURL=Contract.d.ts.map

35

lib/Contract.js
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __importStar = (this && this.__importStar) || function (mod) {

@@ -21,11 +10,21 @@ if (mod && mod.__esModule) return mod;

Object.defineProperty(exports, "__esModule", { value: true });
var optimal_1 = __importStar(require("optimal"));
var Contract = (function () {
function Contract(options) {
this.options = optimal_1.default(__assign({}, options), this.blueprint(optimal_1.predicates), {
const optimal_1 = __importStar(require("optimal"));
class Contract {
constructor(options) {
this.options = this.configure(options);
}
/**
* Set an options object by merging the new partial and existing options
* with the defined blueprint, while running all validation checks.
* Freeze and return the options object.
*/
configure(options) {
// We don't want the options property to be modified directly,
// so it's read only, but we still want to modify it with this function.
this.options = Object.freeze(optimal_1.default(Object.assign({}, this.options, options), this.blueprint(optimal_1.predicates), {
name: this.constructor.name,
});
}));
return this.options;
}
return Contract;
}());
}
exports.default = Contract;

@@ -0,4 +1,16 @@

/**
* @copyright 2017-2019, Miles Johnson
* @license https://opensource.org/licenses/MIT
*/
import { Blueprint, Predicates } from 'optimal';
import Contract from './Contract';
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';
export * from './types';
export { Contract, Blueprint, Predicates };
export { Contract, Blueprint, Predicates, formatMs, instanceOf, isEmpty, isObject, parseFile, requireModule, toArray, };
//# sourceMappingURL=index.d.ts.map
"use strict";
/**
* @copyright 2017-2019, Miles Johnson
* @license https://opensource.org/licenses/MIT
*/
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -6,3 +10,17 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

Object.defineProperty(exports, "__esModule", { value: true });
var Contract_1 = __importDefault(require("./Contract"));
const Contract_1 = __importDefault(require("./Contract"));
exports.Contract = Contract_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;
import { Blueprint, Predicates } from 'optimal';
export declare type Path = string;
export declare type AbstractConstructor<T> = Function & {
prototype: T;
};
export declare type ConcreteConstructor<T> = new (...args: any[]) => T;
export declare type Constructor<T> = AbstractConstructor<T> | ConcreteConstructor<T>;
export interface Optionable<T extends object = {}> {

@@ -6,1 +12,2 @@ readonly options: Required<T>;

}
//# sourceMappingURL=types.d.ts.map
{
"name": "@boost/common",
"version": "1.0.1",
"version": "1.1.0",
"description": "Common utilities for Boost applications.",

@@ -21,2 +21,7 @@ "keywords": [

},
"dependencies": {
"js-yaml": "^3.13.1",
"json5": "^2.1.0",
"pretty-ms": "^5.0.0"
},
"peerDependencies": {

@@ -26,5 +31,8 @@ "optimal": "^3.0.0"

"devDependencies": {
"@boost/test-utils": "^1.2.2",
"@types/js-yaml": "^3.12.1",
"@types/json5": "^0.0.30",
"optimal": "^3.2.1"
},
"gitHead": "b9c19d62d69b6f5f41b75cb79ea20dbca3989dfa"
"gitHead": "3ade9ca405d2449d4948b9e926cea7ad5b3d9c66"
}

@@ -17,2 +17,2 @@ # Boost Common

[https://milesj.gitbook.io/boost](https://milesj.gitbook.io/boost)
[https://milesj.gitbook.io/boost/common](https://milesj.gitbook.io/boost/common)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc