diff --git a/lib/checks.js b/lib/checks.js index 6f5123d..338c4f6 100644 --- a/lib/checks.js +++ b/lib/checks.js @@ -3,13 +3,13 @@ * Licensed under the MIT license. */ -var util = require('util'); +var format = require('format-util'); var errors = module.exports = require('./errors'); function failCheck(ExceptionConstructor, callee, messageFormat, formatArgs) { messageFormat = messageFormat || ''; - var message = util.format.apply(this, [messageFormat].concat(formatArgs)); + var message = format.apply(this, [messageFormat].concat(formatArgs)); var error = new ExceptionConstructor(message); Error.captureStackTrace(error, callee); throw error; diff --git a/lib/errors.js b/lib/errors.js index dee7e7c..bded5d0 100644 --- a/lib/errors.js +++ b/lib/errors.js @@ -3,7 +3,7 @@ * Licensed under the MIT license. */ -var util = require('util'); +var inherits = require('inherits'); function IllegalArgumentError(message) { Error.call(this, message); @@ -17,7 +17,7 @@ function IllegalStateError(message) { Error.call(this, message); this.message = message; } -util.inherits(IllegalStateError, Error); +inherits(IllegalStateError, Error); IllegalStateError.prototype.name = 'IllegalStateError'; diff --git a/package.json b/package.json index 083b723..f38d72f 100644 --- a/package.json +++ b/package.json @@ -1,27 +1,37 @@ { - "name": "precond", - "description": "Precondition checking utilities.", - "version": "0.2.3", - "author": "Mathieu Turcotte ", - "keywords": ["precondition", "assert", "invariant", "contract", "condition"], - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/MathieuTurcotte/node-precond.git" - }, - "devDependencies": { - "nodeunit": "0.9", - "jshint": "2.5" - }, - "scripts": { - "pretest": "node_modules/.bin/jshint lib/ examples/ index.js", - "test": "node_modules/.bin/nodeunit tests/" - }, - "engines": { - "node": ">= 0.6" - }, - "files": [ - "index.js", - "lib" - ] + "name": "precond", + "description": "Precondition checking utilities.", + "version": "0.2.3", + "author": "Mathieu Turcotte ", + "keywords": [ + "precondition", + "assert", + "invariant", + "contract", + "condition" + ], + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/MathieuTurcotte/node-precond.git" + }, + "devDependencies": { + "nodeunit": "0.9", + "jshint": "2.5" + }, + "scripts": { + "pretest": "node_modules/.bin/jshint lib/ examples/ index.js", + "test": "node_modules/.bin/nodeunit tests/" + }, + "engines": { + "node": ">= 0.6" + }, + "files": [ + "index.js", + "lib" + ], + "dependencies": { + "format-util": "^1.0.3", + "inherits": "^2.0.3" + } }