aboutsummaryrefslogtreecommitdiff
path: root/node_modules/deprecated
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2016-10-10 03:43:44 +0200
committerFlorian Dold <florian.dold@gmail.com>2016-10-10 03:43:44 +0200
commitabd94a7f5a50f43c797a11b53549ae48fff667c3 (patch)
treeab8ed457f65cdd72e13e0571d2975729428f1551 /node_modules/deprecated
parenta0247c6a3fd6a09a41a7e35a3441324c4dcb58be (diff)
downloadwallet-core-abd94a7f5a50f43c797a11b53549ae48fff667c3.tar.xz
add node_modules to address #4364
Diffstat (limited to 'node_modules/deprecated')
-rw-r--r--node_modules/deprecated/.npmignore6
-rw-r--r--node_modules/deprecated/.travis.yml6
-rwxr-xr-xnode_modules/deprecated/LICENSE20
-rw-r--r--node_modules/deprecated/README.md51
-rw-r--r--node_modules/deprecated/index.js39
-rw-r--r--node_modules/deprecated/package.json96
-rw-r--r--node_modules/deprecated/test/field.js44
-rw-r--r--node_modules/deprecated/test/method.js32
8 files changed, 294 insertions, 0 deletions
diff --git a/node_modules/deprecated/.npmignore b/node_modules/deprecated/.npmignore
new file mode 100644
index 000000000..b5ef13a3c
--- /dev/null
+++ b/node_modules/deprecated/.npmignore
@@ -0,0 +1,6 @@
+.DS_Store
+*.log
+node_modules
+build
+*.node
+components \ No newline at end of file
diff --git a/node_modules/deprecated/.travis.yml b/node_modules/deprecated/.travis.yml
new file mode 100644
index 000000000..33ad9f8c8
--- /dev/null
+++ b/node_modules/deprecated/.travis.yml
@@ -0,0 +1,6 @@
+language: node_js
+node_js:
+ - "0.9"
+ - "0.10"
+after_script:
+ - npm run coveralls \ No newline at end of file
diff --git a/node_modules/deprecated/LICENSE b/node_modules/deprecated/LICENSE
new file mode 100755
index 000000000..7cbe012c6
--- /dev/null
+++ b/node_modules/deprecated/LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2014 Fractal <contact@wearefractal.com>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/deprecated/README.md b/node_modules/deprecated/README.md
new file mode 100644
index 000000000..493e6ea5f
--- /dev/null
+++ b/node_modules/deprecated/README.md
@@ -0,0 +1,51 @@
+# deprecated [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Dependency Status][david-image]][david-url]
+
+
+## Information
+
+<table>
+<tr>
+<td>Package</td><td>deprecated</td>
+</tr>
+<tr>
+<td>Description</td>
+<td>Tool for deprecating things</td>
+</tr>
+<tr>
+<td>Node Version</td>
+<td>>= 0.9</td>
+</tr>
+</table>
+
+## Usage
+
+```javascript
+var oldfn = function(a,b) {
+ return a+b;
+};
+
+// returns a new wrapper function that logs the deprecated function once
+var somefn = deprecated('dont use this anymore', console.log, oldfn);
+
+var someobj = {};
+
+// set up a getter/set for field that logs deprecated message once
+deprecated('dont use this anymore', console.log, someobj, 'a', 123);
+
+console.log(someobj.a); // 123
+```
+
+[npm-url]: https://npmjs.org/package/deprecated
+[npm-image]: https://badge.fury.io/js/deprecated.png
+
+[travis-url]: https://travis-ci.org/wearefractal/deprecated
+[travis-image]: https://travis-ci.org/wearefractal/deprecated.png?branch=master
+
+[coveralls-url]: https://coveralls.io/r/wearefractal/deprecated
+[coveralls-image]: https://coveralls.io/repos/wearefractal/deprecated/badge.png
+
+[depstat-url]: https://david-dm.org/wearefractal/deprecated
+[depstat-image]: https://david-dm.org/wearefractal/deprecated.png
+
+[david-url]: https://david-dm.org/wearefractal/deprecated
+[david-image]: https://david-dm.org/wearefractal/deprecated.png?theme=shields.io \ No newline at end of file
diff --git a/node_modules/deprecated/index.js b/node_modules/deprecated/index.js
new file mode 100644
index 000000000..f689e9cd1
--- /dev/null
+++ b/node_modules/deprecated/index.js
@@ -0,0 +1,39 @@
+var deprecated = {
+ method: function(msg, log, fn) {
+ var called = false;
+ return function(){
+ if (!called) {
+ called = true;
+ log(msg);
+ }
+ return fn.apply(this, arguments);
+ };
+ },
+
+ field: function(msg, log, parent, field, val) {
+ var called = false;
+ var getter = function(){
+ if (!called) {
+ called = true;
+ log(msg);
+ }
+ return val;
+ };
+ var setter = function(v) {
+ if (!called) {
+ called = true;
+ log(msg);
+ }
+ val = v;
+ return v;
+ };
+ Object.defineProperty(parent, field, {
+ get: getter,
+ set: setter,
+ enumerable: true
+ });
+ return;
+ }
+};
+
+module.exports = deprecated; \ No newline at end of file
diff --git a/node_modules/deprecated/package.json b/node_modules/deprecated/package.json
new file mode 100644
index 000000000..a226d5ece
--- /dev/null
+++ b/node_modules/deprecated/package.json
@@ -0,0 +1,96 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "deprecated@^0.0.1",
+ "scope": null,
+ "escapedName": "deprecated",
+ "name": "deprecated",
+ "rawSpec": "^0.0.1",
+ "spec": ">=0.0.1 <0.0.2",
+ "type": "range"
+ },
+ "/home/dold/repos/taler/wallet-webex/node_modules/gulp"
+ ]
+ ],
+ "_from": "deprecated@>=0.0.1 <0.0.2",
+ "_id": "deprecated@0.0.1",
+ "_inCache": true,
+ "_location": "/deprecated",
+ "_npmUser": {
+ "name": "fractal",
+ "email": "contact@wearefractal.com"
+ },
+ "_npmVersion": "1.3.24",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "deprecated@^0.0.1",
+ "scope": null,
+ "escapedName": "deprecated",
+ "name": "deprecated",
+ "rawSpec": "^0.0.1",
+ "spec": ">=0.0.1 <0.0.2",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/gulp"
+ ],
+ "_resolved": "https://registry.npmjs.org/deprecated/-/deprecated-0.0.1.tgz",
+ "_shasum": "f9c9af5464afa1e7a971458a8bdef2aa94d5bb19",
+ "_shrinkwrap": null,
+ "_spec": "deprecated@^0.0.1",
+ "_where": "/home/dold/repos/taler/wallet-webex/node_modules/gulp",
+ "author": {
+ "name": "Fractal",
+ "email": "contact@wearefractal.com",
+ "url": "http://wearefractal.com/"
+ },
+ "bugs": {
+ "url": "https://github.com/wearefractal/deprecated/issues"
+ },
+ "dependencies": {},
+ "description": "Tool for deprecating things",
+ "devDependencies": {
+ "coveralls": "~2.6.1",
+ "istanbul": "~0.2.3",
+ "jshint": "~2.4.1",
+ "mocha": "~1.17.0",
+ "mocha-lcov-reporter": "~0.0.1",
+ "rimraf": "~2.2.5",
+ "should": "~3.1.0"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "f9c9af5464afa1e7a971458a8bdef2aa94d5bb19",
+ "tarball": "https://registry.npmjs.org/deprecated/-/deprecated-0.0.1.tgz"
+ },
+ "engines": {
+ "node": ">= 0.9"
+ },
+ "homepage": "http://github.com/wearefractal/deprecated",
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "http://github.com/wearefractal/deprecated/raw/master/LICENSE"
+ }
+ ],
+ "main": "./index.js",
+ "maintainers": [
+ {
+ "name": "fractal",
+ "email": "contact@wearefractal.com"
+ }
+ ],
+ "name": "deprecated",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/wearefractal/deprecated.git"
+ },
+ "scripts": {
+ "coveralls": "istanbul cover _mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage",
+ "test": "mocha --reporter spec && jshint"
+ },
+ "version": "0.0.1"
+}
diff --git a/node_modules/deprecated/test/field.js b/node_modules/deprecated/test/field.js
new file mode 100644
index 000000000..91a7029c7
--- /dev/null
+++ b/node_modules/deprecated/test/field.js
@@ -0,0 +1,44 @@
+var deprecated = require('../');
+var should = require('should');
+require('mocha');
+
+describe('field()', function() {
+ it('should return a wrapped function that logs once on get', function(done) {
+ var message = 'testing';
+ var scope = {
+ a: 1
+ };
+ var obj = {};
+ var logged = false;
+ var log = function(msg){
+ msg.should.equal(message);
+ logged.should.equal(false);
+ logged = true;
+ };
+ deprecated.field(message, log, obj, 'a', 123);
+
+ obj.a.should.equal(123);
+ obj.a = 1234;
+ obj.a.should.equal(1234);
+ logged.should.equal(true);
+ done();
+ });
+ it('should return a wrapped function that logs once on set', function(done) {
+ var message = 'testing';
+ var scope = {
+ a: 1
+ };
+ var obj = {};
+ var logged = false;
+ var log = function(msg){
+ msg.should.equal(message);
+ logged.should.equal(false);
+ logged = true;
+ };
+ deprecated.field(message, log, obj, 'a', 123);
+
+ obj.a = 1234;
+ logged.should.equal(true);
+ done();
+ });
+}); \ No newline at end of file
diff --git a/node_modules/deprecated/test/method.js b/node_modules/deprecated/test/method.js
new file mode 100644
index 000000000..615ba9454
--- /dev/null
+++ b/node_modules/deprecated/test/method.js
@@ -0,0 +1,32 @@
+var deprecated = require('../');
+var should = require('should');
+require('mocha');
+
+describe('method()', function() {
+ it('should return a wrapped function that logs once', function(done) {
+ var message = 'testing';
+ var scope = {
+ a: 1
+ };
+ var logged = false;
+ var log = function(msg){
+ msg.should.equal(message);
+ logged.should.equal(false);
+ logged = true;
+ };
+ var fn = deprecated.method(message, log, function(one, two){
+ this.should.equal(scope);
+ one.should.equal(1);
+ two.should.equal(2);
+ return one+two;
+ });
+
+ fn.bind(scope)(1,2).should.equal(3);
+ fn.bind(scope)(1,2).should.equal(3);
+ fn.bind(scope)(1,2).should.equal(3);
+ fn.bind(scope)(1,2).should.equal(3);
+
+ logged.should.equal(true);
+ done();
+ });
+}); \ No newline at end of file