Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

empower

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

empower - npm Package Compare versions

Comparing version 0.10.0 to 0.11.0

build/empower.js

9

CHANGELOG.md

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

## [0.11.0](https://github.com/twada/empower/releases/tag/v0.11.0) (2015-04-18)
#### Features
* **empower:**
* ship npm module with built bundle for browsers ([e9448d3b](https://github.com/twada/empower/commit/e9448d3bfd4b44e64810cb2d1e18d6a4e2c6ba4b))
## [0.10.0](https://github.com/twada/empower/releases/tag/v0.10.0) (2014-11-11)

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

5

gulpfile.js

@@ -11,2 +11,3 @@ var gulp = require('gulp'),

derequire = require('gulp-derequire'),
dereserve = require('gulp-dereserve'),
config = {

@@ -108,5 +109,7 @@ bundle: {

gulp.task('bundle', ['clean_bundle'], function() {
var bundleStream = browserify({entries: config.bundle.srcFile, standalone: config.bundle.standalone}).bundle();
var b = browserify({entries: config.bundle.srcFile, standalone: config.bundle.standalone});
var bundleStream = b.bundle();
return bundleStream
.pipe(source(config.bundle.destName))
.pipe(dereserve())
.pipe(derequire())

@@ -113,0 +116,0 @@ .pipe(gulp.dest(config.bundle.destDir));

2

index.js

@@ -6,3 +6,3 @@ /**

*
* Copyright (c) 2013-2014 Takuto Wada
* Copyright (c) 2013-2015 Takuto Wada
* Licensed under the MIT license.

@@ -9,0 +9,0 @@ * https://github.com/twada/empower/blob/master/MIT-LICENSE.txt

@@ -1,2 +0,2 @@

Copyright (c) 2013-2014 Takuto Wada, https://github.com/twada/empower
Copyright (c) 2013-2015 Takuto Wada, https://github.com/twada/empower

@@ -3,0 +3,0 @@ Permission is hereby granted, free of charge, to any person obtaining

{
"name": "empower",
"description": "Power Assert feature enhancer for assert function/object",
"version": "0.10.0",
"version": "0.11.0",
"author": {

@@ -14,21 +14,24 @@ "name": "Takuto Wada",

"dependencies": {
"escallmatch": "~1.0.0",
"xtend": "~4.0.0"
"escallmatch": "^1.3.1",
"xtend": "^4.0.0"
},
"devDependencies": {
"blanket": "~1.1.6",
"browserify": "~6.2.0",
"buster-assertions": "~0.10.4",
"del": "~0.1.3",
"espower-source": "~0.10.0",
"gulp": "~3.8.10",
"gulp-derequire": "~2.0.0",
"gulp-mocha": "~1.1.1",
"gulp-mocha-phantomjs": "~0.5.1",
"gulp-util": "~3.0.1",
"gulp-webserver": "~0.8.3",
"mocha": "~2.0.1",
"mocha-lcov-reporter": "~0.0.1",
"through2": "~1.1.1",
"vinyl-source-stream": "~1.0.0"
"acorn": "^1.0.3",
"blanket": "^1.1.6",
"browserify": "^9.0.8",
"buster-assertions": "^0.10.4",
"del": "^1.1.1",
"escodegen": "^1.6.1",
"espower": "^0.11.0",
"gulp": "^3.8.11",
"gulp-derequire": "^2.0.0",
"gulp-dereserve": "^0.2.0",
"gulp-mocha": "^2.0.1",
"gulp-mocha-phantomjs": "^0.6.1",
"gulp-util": "^3.0.4",
"gulp-webserver": "^0.9.0",
"mocha": "^2.2.4",
"mocha-lcov-reporter": "^0.0.2",
"through2": "^1.1.1",
"vinyl-source-stream": "^1.1.0"
},

@@ -45,2 +48,3 @@ "directories": {

"lib",
"build/empower.js",
"package.json",

@@ -69,4 +73,5 @@ "test"

"test": "gulp test",
"unit": "gulp unit",
"coveralls": "gulp coverage && cat ./coverage.lcov | coveralls"
}
}
empower
================================
[![Build Status](https://travis-ci.org/twada/empower.svg?branch=master)](https://travis-ci.org/twada/empower)
[![NPM version](https://badge.fury.io/js/empower.svg)](http://badge.fury.io/js/empower)
[![Dependency Status](https://gemnasium.com/twada/empower.svg)](https://gemnasium.com/twada/empower)
[![Coverage Status](https://coveralls.io/repos/twada/empower/badge.png?branch=master)](https://coveralls.io/r/twada/empower?branch=master)
[![Code Climate](https://codeclimate.com/github/twada/empower/badges/gpa.svg)](https://codeclimate.com/github/twada/empower)
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg)](https://github.com/twada/empower/blob/master/MIT-LICENSE.txt)
[![Built with Gulp](http://img.shields.io/badge/built_with-gulp-brightgreen.svg)](http://gulpjs.com/)
[![Build Status][travis-image]][travis-url]
[![NPM package][npm-image]][npm-url]
[![Bower package][bower-image]][bower-url]
[![Dependency Status][depstat-image]][depstat-url]
[![Coverage Status][coverage-image]][coverage-url]
[![Code Climate][codeclimate-image]][codeclimate-url]
[![License][license-image]][license-url]
[![Built with Gulp][gulp-image]][gulp-url]

@@ -181,2 +182,9 @@

#### use empower npm module on browser
`empower` function is exported
<script type="text/javascript" src="./path/to/node_modules/empower/build/empower.js"></script>
### via bower

@@ -201,1 +209,26 @@

Licensed under the [MIT](https://github.com/twada/empower/blob/master/MIT-LICENSE.txt) license.
[npm-url]: https://npmjs.org/package/empower
[npm-image]: https://badge.fury.io/js/empower.svg
[bower-url]: http://badge.fury.io/bo/empower
[bower-image]: https://badge.fury.io/bo/empower.svg
[travis-url]: http://travis-ci.org/twada/empower
[travis-image]: https://secure.travis-ci.org/twada/empower.svg?branch=master
[depstat-url]: https://gemnasium.com/twada/empower
[depstat-image]: https://gemnasium.com/twada/empower.svg
[license-url]: https://github.com/twada/empower/blob/master/MIT-LICENSE.txt
[license-image]: http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat
[codeclimate-url]: https://codeclimate.com/github/twada/empower
[codeclimate-image]: https://codeclimate.com/github/twada/empower/badges/gpa.svg
[coverage-url]: https://coveralls.io/r/twada/empower?branch=master
[coverage-image]: https://coveralls.io/repos/twada/empower/badge.svg?branch=master
[gulp-url]: http://gulpjs.com/
[gulp-image]: http://img.shields.io/badge/built_with-gulp-brightgreen.svg
(function (root, factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
define(['empower', 'espower-source', 'assert', 'buster-assertions'], factory);
define(['empower', 'espower', 'acorn', 'escodegen', 'assert', 'buster-assertions'], factory);
} else if (typeof exports === 'object') {
factory(require('..'), require('espower-source'), require('assert'), require('buster-assertions'));
factory(require('..'), require('espower'), require('acorn'), require('escodegen'), require('assert'), require('buster-assertions'));
} else {
factory(root.empower, root.espowerSource, root.assert, root.buster);
factory(root.empower, root.espower, root.acorn, root.escodegen, root.assert, root.buster);
}
}(this, function (
empower,
espowerSource,
espower,
acorn,
escodegen,
baseAssert,
busterAssertions
) {
// see: https://github.com/Constellation/escodegen/issues/115
if (typeof define === 'function' && define.amd) {
escodegen = window.escodegen;
}
var weave = function (line) {
var options = {
destructive: false,
path: '/path/to/some_test.js',
var filepath = '/path/to/some_test.js';
var espowerOptions = {
source: line,
path: filepath,
destructive: true,
patterns: [

@@ -27,3 +37,5 @@ 'assert(actual, [message])',

};
return espowerSource(line, '/path/to/some_test.js', options);
var jsAST = acorn.parse(line, {ecmaVersion: 6, locations: true, sourceType: 'module', sourceFile: filepath});
var espoweredAST = espower(jsAST, espowerOptions);
return escodegen.generate(espoweredAST, {format: {compact: true}});
},

@@ -57,3 +69,2 @@ fakeFormatter = function (context) {

} catch (e) {
baseAssert.equal(e.name, 'AssertionError');
baseAssert.equal(e.message, [

@@ -64,2 +75,3 @@ '/path/to/some_test.js',

].join('\n'));
baseAssert.equal(e.name, 'AssertionError');
}

@@ -76,3 +88,2 @@ });

} catch (e) {
baseAssert.equal(e.name, 'AssertionError');
baseAssert.equal(e.message, [

@@ -83,2 +94,3 @@ '[assert.isNull] /path/to/some_test.js',

].join('\n'));
baseAssert.equal(e.name, 'AssertionError');
}

@@ -96,3 +108,2 @@ });

} catch (e) {
baseAssert.equal(e.name, 'AssertionError');
baseAssert.equal(e.message, [

@@ -103,2 +114,3 @@ '[assert.same] /path/to/some_test.js',

].join('\n'));
baseAssert.equal(e.name, 'AssertionError');
}

@@ -113,3 +125,2 @@ });

} catch (e) {
baseAssert.equal(e.name, 'AssertionError');
baseAssert.equal(e.message, [

@@ -120,2 +131,3 @@ '[assert.same] /path/to/some_test.js',

].join('\n'));
baseAssert.equal(e.name, 'AssertionError');
}

@@ -130,3 +142,2 @@ });

} catch (e) {
baseAssert.equal(e.name, 'AssertionError');
baseAssert.equal(e.message, [

@@ -137,2 +148,3 @@ '[assert.same] /path/to/some_test.js',

].join('\n'));
baseAssert.equal(e.name, 'AssertionError');
}

@@ -150,3 +162,2 @@ });

} catch (e) {
baseAssert.equal(e.name, 'AssertionError');
baseAssert.equal(e.message, [

@@ -157,2 +168,3 @@ '[assert.near] /path/to/some_test.js',

].join('\n'));
baseAssert.equal(e.name, 'AssertionError');
}

@@ -167,3 +179,2 @@ });

} catch (e) {
baseAssert.equal(e.name, 'AssertionError');
baseAssert.equal(e.message, [

@@ -174,2 +185,3 @@ '[assert.near] not in delta /path/to/some_test.js',

].join('\n'));
baseAssert.equal(e.name, 'AssertionError');
}

@@ -176,0 +188,0 @@ });

(function (root, factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
define(['empower', 'espower-source', 'assert'], factory);
define(['empower', 'espower', 'acorn', 'escodegen', 'assert'], factory);
} else if (typeof exports === 'object') {
factory(require('..'), require('espower-source'), require('assert'));
factory(require('..'), require('espower'), require('acorn'), require('escodegen'), require('assert'));
} else {
factory(root.empower, root.espowerSource, root.assert);
factory(root.empower, root.espower, root.acorn, root.escodegen, root.assert);
}
}(this, function (
empower,
espowerSource,
espower,
acorn,
escodegen,
baseAssert
) {
var weave = function (line) {
return espowerSource(line, '/path/to/some_test.js');
// see: https://github.com/Constellation/escodegen/issues/115
if (typeof define === 'function' && define.amd) {
escodegen = window.escodegen;
}
var weave = function (line, patterns) {
var filepath = '/path/to/some_test.js';
var espowerOptions = {
source: line,
path: filepath,
destructive: true
};
if (patterns) {
espowerOptions.patterns = patterns;
}
var jsAST = acorn.parse(line, {ecmaVersion: 6, locations: true, sourceType: 'module', sourceFile: filepath});
var espoweredAST = espower(jsAST, espowerOptions);
return escodegen.generate(espoweredAST, {format: {compact: true}});
},

@@ -31,5 +50,2 @@ fakeFormatter = function (context) {

test('default options behavior', function () {
var weave = function (line) {
return espowerSource(line, '/path/to/some_test.js');
};
var assert = empower(baseAssert, fakeFormatter);

@@ -42,3 +58,2 @@

} catch (e) {
baseAssert.equal(e.name, 'AssertionError');
baseAssert.equal(e.message, [

@@ -49,2 +64,3 @@ '/path/to/some_test.js',

].join('\n'));
baseAssert.equal(e.name, 'AssertionError');
}

@@ -64,3 +80,2 @@ });

} catch (e) {
baseAssert.equal(e.name, 'AssertionError');
if (option.modifyMessageOnRethrow) {

@@ -88,2 +103,3 @@ baseAssert.equal(e.message, [

}
baseAssert.equal(e.name, 'AssertionError');
}

@@ -99,3 +115,2 @@ });

} catch (e) {
baseAssert.equal(e.name, 'AssertionError');
if (option.modifyMessageOnRethrow) {

@@ -125,2 +140,3 @@ baseAssert.equal(e.message, [

}
baseAssert.equal(e.name, 'AssertionError');
}

@@ -136,3 +152,2 @@ });

} catch (e) {
baseAssert.equal(e.name, 'AssertionError');
if (option.modifyMessageOnRethrow) {

@@ -162,2 +177,3 @@ baseAssert.equal(e.message, [

}
baseAssert.equal(e.name, 'AssertionError');
}

@@ -174,3 +190,2 @@ });

} catch (e) {
baseAssert.equal(e.name, 'AssertionError');
if (option.modifyMessageOnRethrow) {

@@ -200,2 +215,3 @@ baseAssert.equal(e.message, [

}
baseAssert.equal(e.name, 'AssertionError');
}

@@ -213,3 +229,2 @@ });

} catch (e) {
baseAssert.equal(e.name, 'AssertionError');
if (option.modifyMessageOnRethrow) {

@@ -241,2 +256,3 @@ baseAssert.equal(e.message, [

}
baseAssert.equal(e.name, 'AssertionError');
}

@@ -251,3 +267,2 @@ });

} catch (e) {
baseAssert.equal(e.name, 'AssertionError');
if (option.modifyMessageOnRethrow) {

@@ -275,2 +290,3 @@ baseAssert.equal(e.message, [

}
baseAssert.equal(e.name, 'AssertionError');
}

@@ -285,3 +301,2 @@ });

} catch (e) {
baseAssert.equal(e.name, 'AssertionError');
if (option.modifyMessageOnRethrow) {

@@ -309,2 +324,3 @@ baseAssert.equal(e.message, [

}
baseAssert.equal(e.name, 'AssertionError');
}

@@ -348,5 +364,2 @@ });

];
var weave = function (line) {
return espowerSource(line, '/path/to/some_test.js', { patterns: patterns });
};
var assert = empower(baseAssert, fakeFormatter, { patterns: patterns });

@@ -356,7 +369,7 @@

try {
eval(weave('assert(falsy);'));
eval(weave('assert(falsy);', patterns));
baseAssert.ok(false, 'AssertionError should be thrown');
} catch (e) {
baseAssert.equal(e.message, '0 == true', 'should not be empowered');
baseAssert.equal(e.name, 'AssertionError');
baseAssert.equal(e.message, '0 == true', 'should not be empowered');
}

@@ -363,0 +376,0 @@ });

@@ -31,3 +31,3 @@ (function (root, factory) {

baseAssert.equal(e.name, 'AssertionError');
baseAssert.equal(e.message, '"foo" == null');
baseAssert((e.message === '\'foo\' == null' || e.message === '\"foo\" == null'));
baseAssert(e.powerAssertContext === undefined);

@@ -74,3 +74,3 @@ }

baseAssert.equal(e.name, 'AssertionError');
baseAssert.equal(e.message, '"foo" == "bar"');
baseAssert((e.message === '\'foo\' == \'bar\'' || e.message === '\"foo\" == \"bar\"'));
baseAssert(e.powerAssertContext === undefined);

@@ -87,3 +87,3 @@ }

baseAssert.equal(e.name, 'AssertionError');
baseAssert.equal(e.message, '"foo" == "bar"');
baseAssert((e.message === '\'foo\' == \'bar\'' || e.message === '\"foo\" == \"bar\"'));
baseAssert(e.powerAssertContext === undefined);

@@ -100,3 +100,3 @@ }

baseAssert.equal(e.name, 'AssertionError');
baseAssert.equal(e.message, '"foo" == "bar"');
baseAssert((e.message === '\'foo\' == \'bar\'' || e.message === '\"foo\" == \"bar\"'));
baseAssert(e.powerAssertContext === undefined);

@@ -103,0 +103,0 @@ }

var require = {
paths: {
empower: "../build/empower",
"espower-source": "../bower_components/espower-source/build/espower-source",
acorn: '../node_modules/acorn/dist/acorn',
escodegen: '../bower_components/escodegen/escodegen.browser',
espower: "../node_modules/espower/build/espower",
assert: "../bower_components/assert/assert",

@@ -6,0 +8,0 @@ mocha: "../bower_components/mocha/mocha",

Sorry, the diff of this file is not supported yet

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