Skip to content

Commit

Permalink
feature(package) rm checkup
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed Jun 8, 2015
1 parent e0b1644 commit 3936281
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 12 deletions.
5 changes: 3 additions & 2 deletions lib/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
(function(){
'use strict';

var check = require('checkup'),
var assert = require('assert'),
tryCatch = require('try-catch'),
Clean = require('clean-css'),

Expand All @@ -20,7 +20,8 @@
module.exports = function(data, callback){
var error, errorParse, dataOptimized;

check(arguments, ['data', 'callback']);
assert(data);
assert(callback);

if (!Clean)
error = ErrorMsg;
Expand Down
5 changes: 3 additions & 2 deletions lib/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
(function(){
'use strict';

var check = require('checkup'),
var assert = require('assert'),
tryCatch = require('try-catch'),
Minifier = require('html-minifier'),

Expand Down Expand Up @@ -44,7 +44,8 @@
module.exports = function(data, callback) {
var error;

check(arguments, ['data', 'callback']);
assert(data);
assert(callback);

if (!Minifier)
error = ErrorMsg;
Expand Down
6 changes: 4 additions & 2 deletions lib/img.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

var path = require('path'),

check = require('checkup'),
assert = require('assert'),
B64img = require('css-b64-images'),

ONE_KB = Math.pow(2, 10),
Expand All @@ -29,7 +29,9 @@
var dir = path.dirname(name),
dirRelative = dir + '/../';

check(arguments, ['name', 'data', 'callback']);
assert(name);
assert(data);
assert(callback);

if (!B64img)
callback(ErrorMsg);
Expand Down
5 changes: 3 additions & 2 deletions lib/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

var uglify = require('uglify-js'),

check = require('checkup'),
assert = require('assert'),
tryCatch = require('try-catch'),

ErrorMsg = Error([
Expand All @@ -21,7 +21,8 @@
module.exports = function (data, callback) {
var error, dataOptimized;

check(arguments, ['data', 'callback']);
assert(data);
assert(callback);

if (!uglify)
error = ErrorMsg;
Expand Down
14 changes: 11 additions & 3 deletions lib/minify.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

fs = require('fs'),
path = require('path'),
check = require('checkup'),
assert = require('assert'),
exec = require('execon'),
tomas = require('tomas'),
rendy = require('rendy'),
Expand All @@ -22,6 +22,14 @@

module.exports = minify;

function check() {
var i,
n = arguments.length;

for (i = 0; i < n; i++)
assert(arguments[i]);
}

function optimizeData(params, callback) {
var p = params,
ext = p.ext.slice(1);
Expand All @@ -37,7 +45,7 @@
if (!callback)
callback = options;

check(arguments, ['name', 'callback']);
check(name, callback);

if (isObject) {
optimizeData(name, callback);
Expand Down Expand Up @@ -76,7 +84,7 @@
function optimize(file, callback) {
var name, isObj;

check(arguments, ['file', 'callback']);
check(file, callback);

isObj = typeof file === 'object';

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
},
"preferGlobal": false,
"dependencies": {
"checkup": "~1.0.2",
"clean-css": "~3.3.0",
"css-b64-images": "~0.2.5",
"debug": "~2.2.0",
Expand Down

0 comments on commit 3936281

Please sign in to comment.