Firebase Update
This commit is contained in:
		
							
								
								
									
										12
									
								
								express-server/node_modules/isomorphic-fetch/.editorconfig
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								express-server/node_modules/isomorphic-fetch/.editorconfig
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,12 @@
 | 
			
		||||
root=true
 | 
			
		||||
 | 
			
		||||
[*]
 | 
			
		||||
end_of_line = lf
 | 
			
		||||
insert_final_newline = true
 | 
			
		||||
 | 
			
		||||
[*.js]
 | 
			
		||||
indent_style = tab
 | 
			
		||||
 | 
			
		||||
[*.json]
 | 
			
		||||
indent_style = space
 | 
			
		||||
indent_size = 2
 | 
			
		||||
							
								
								
									
										5
									
								
								express-server/node_modules/isomorphic-fetch/.jshintrc
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								express-server/node_modules/isomorphic-fetch/.jshintrc
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
			
		||||
{
 | 
			
		||||
  "node": true,
 | 
			
		||||
  "browser": true,
 | 
			
		||||
  "predef": ["describe", "it", "before"]
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										2
									
								
								express-server/node_modules/isomorphic-fetch/.npmignore
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								express-server/node_modules/isomorphic-fetch/.npmignore
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
			
		||||
/node_modules/
 | 
			
		||||
/bower_components/
 | 
			
		||||
							
								
								
									
										15
									
								
								express-server/node_modules/isomorphic-fetch/.travis.yml
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								express-server/node_modules/isomorphic-fetch/.travis.yml
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,15 @@
 | 
			
		||||
sudo: false
 | 
			
		||||
language: node_js
 | 
			
		||||
node_js:
 | 
			
		||||
  - "0.10"
 | 
			
		||||
before_deploy:
 | 
			
		||||
  - npm-prepublish --verbose
 | 
			
		||||
deploy:
 | 
			
		||||
  provider: npm
 | 
			
		||||
  email: matt@mattandre.ws
 | 
			
		||||
  api_key:
 | 
			
		||||
    secure: eEeb1aG7phF4X5z+CQ3yzTdXtHf71Dk4ec6v5iAjRYNh/s6GLxfZS7c4qocZI8YXW3YmmsJR5zGZ2l88k2iqTtlBn0Mrp6ytwIa/jO00kDpR8V11eW9i47KRQq25eA1YW+SrLM5V/fh+s9u3VU7jhbax5eeViqVdwORI85kZrZE=
 | 
			
		||||
  on:
 | 
			
		||||
    all_branches: true
 | 
			
		||||
    tags: true
 | 
			
		||||
    repo: matthew-andrews/isomorphic-fetch
 | 
			
		||||
							
								
								
									
										21
									
								
								express-server/node_modules/isomorphic-fetch/LICENSE
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								express-server/node_modules/isomorphic-fetch/LICENSE
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,21 @@
 | 
			
		||||
The MIT License (MIT)
 | 
			
		||||
 | 
			
		||||
Copyright (c) 2015 Matt Andrews
 | 
			
		||||
 | 
			
		||||
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.
 | 
			
		||||
							
								
								
									
										45
									
								
								express-server/node_modules/isomorphic-fetch/README.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								express-server/node_modules/isomorphic-fetch/README.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,45 @@
 | 
			
		||||
isomorphic-fetch [](https://travis-ci.org/matthew-andrews/isomorphic-fetch)
 | 
			
		||||
================
 | 
			
		||||
 | 
			
		||||
Fetch for node and Browserify.  Built on top of [GitHub's WHATWG Fetch polyfill](https://github.com/github/fetch).
 | 
			
		||||
 | 
			
		||||
## Warnings
 | 
			
		||||
 | 
			
		||||
- This adds `fetch` as a global so that its API is consistent between client and server.
 | 
			
		||||
- You must bring your own ES6 Promise compatible polyfill, I suggest [es6-promise](https://github.com/jakearchibald/es6-promise).
 | 
			
		||||
 | 
			
		||||
## Installation
 | 
			
		||||
 | 
			
		||||
### NPM
 | 
			
		||||
 | 
			
		||||
```sh
 | 
			
		||||
npm install --save isomorphic-fetch es6-promise
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### Bower
 | 
			
		||||
 | 
			
		||||
```sh
 | 
			
		||||
bower install --save isomorphic-fetch es6-promise
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## Usage
 | 
			
		||||
 | 
			
		||||
```js
 | 
			
		||||
require('es6-promise').polyfill();
 | 
			
		||||
require('isomorphic-fetch');
 | 
			
		||||
 | 
			
		||||
fetch('//offline-news-api.herokuapp.com/stories')
 | 
			
		||||
	.then(function(response) {
 | 
			
		||||
		if (response.status >= 400) {
 | 
			
		||||
			throw new Error("Bad response from server");
 | 
			
		||||
		}
 | 
			
		||||
		return response.json();
 | 
			
		||||
	})
 | 
			
		||||
	.then(function(stories) {
 | 
			
		||||
		console.log(stories);
 | 
			
		||||
	});
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## License
 | 
			
		||||
 | 
			
		||||
All open source code released by FT Labs is licenced under the MIT licence.  Based on [the fine work by](https://github.com/github/fetch/pull/31) **[jxck](https://github.com/Jxck)**.
 | 
			
		||||
							
								
								
									
										7
									
								
								express-server/node_modules/isomorphic-fetch/bower.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								express-server/node_modules/isomorphic-fetch/bower.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,7 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "isomorphic-fetch",
 | 
			
		||||
  "main": ["fetch-bower.js"],
 | 
			
		||||
  "dependencies": {
 | 
			
		||||
    "fetch": "github/fetch#>=0.10.0"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										1
									
								
								express-server/node_modules/isomorphic-fetch/fetch-bower.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								express-server/node_modules/isomorphic-fetch/fetch-bower.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
module.exports = require('fetch');
 | 
			
		||||
							
								
								
									
										6
									
								
								express-server/node_modules/isomorphic-fetch/fetch-npm-browserify.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								express-server/node_modules/isomorphic-fetch/fetch-npm-browserify.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
			
		||||
// the whatwg-fetch polyfill installs the fetch() function
 | 
			
		||||
// on the global object (window or self)
 | 
			
		||||
//
 | 
			
		||||
// Return that as the export for use in Webpack, Browserify etc.
 | 
			
		||||
require('whatwg-fetch');
 | 
			
		||||
module.exports = self.fetch.bind(self);
 | 
			
		||||
							
								
								
									
										16
									
								
								express-server/node_modules/isomorphic-fetch/fetch-npm-node.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								express-server/node_modules/isomorphic-fetch/fetch-npm-node.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,16 @@
 | 
			
		||||
"use strict";
 | 
			
		||||
 | 
			
		||||
var realFetch = require('node-fetch');
 | 
			
		||||
module.exports = function(url, options) {
 | 
			
		||||
	if (/^\/\//.test(url)) {
 | 
			
		||||
		url = 'https:' + url;
 | 
			
		||||
	}
 | 
			
		||||
	return realFetch.call(this, url, options);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
if (!global.fetch) {
 | 
			
		||||
	global.fetch = module.exports;
 | 
			
		||||
	global.Response = realFetch.Response;
 | 
			
		||||
	global.Headers = realFetch.Headers;
 | 
			
		||||
	global.Request = realFetch.Request;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										62
									
								
								express-server/node_modules/isomorphic-fetch/package.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										62
									
								
								express-server/node_modules/isomorphic-fetch/package.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,62 @@
 | 
			
		||||
{
 | 
			
		||||
  "_from": "isomorphic-fetch@2.2.1",
 | 
			
		||||
  "_id": "isomorphic-fetch@2.2.1",
 | 
			
		||||
  "_inBundle": false,
 | 
			
		||||
  "_integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=",
 | 
			
		||||
  "_location": "/isomorphic-fetch",
 | 
			
		||||
  "_phantomChildren": {},
 | 
			
		||||
  "_requested": {
 | 
			
		||||
    "type": "version",
 | 
			
		||||
    "registry": true,
 | 
			
		||||
    "raw": "isomorphic-fetch@2.2.1",
 | 
			
		||||
    "name": "isomorphic-fetch",
 | 
			
		||||
    "escapedName": "isomorphic-fetch",
 | 
			
		||||
    "rawSpec": "2.2.1",
 | 
			
		||||
    "saveSpec": null,
 | 
			
		||||
    "fetchSpec": "2.2.1"
 | 
			
		||||
  },
 | 
			
		||||
  "_requiredBy": [
 | 
			
		||||
    "/@firebase/functions"
 | 
			
		||||
  ],
 | 
			
		||||
  "_resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz",
 | 
			
		||||
  "_shasum": "611ae1acf14f5e81f729507472819fe9733558a9",
 | 
			
		||||
  "_spec": "isomorphic-fetch@2.2.1",
 | 
			
		||||
  "_where": "D:\\Desktop\\smartshopperNodeReworkFirebase\\node_modules\\@firebase\\functions",
 | 
			
		||||
  "author": {
 | 
			
		||||
    "name": "Matt Andrews",
 | 
			
		||||
    "email": "matt@mattandre.ws"
 | 
			
		||||
  },
 | 
			
		||||
  "browser": "fetch-npm-browserify.js",
 | 
			
		||||
  "bugs": {
 | 
			
		||||
    "url": "https://github.com/matthew-andrews/isomorphic-fetch/issues"
 | 
			
		||||
  },
 | 
			
		||||
  "bundleDependencies": false,
 | 
			
		||||
  "dependencies": {
 | 
			
		||||
    "node-fetch": "^1.0.1",
 | 
			
		||||
    "whatwg-fetch": ">=0.10.0"
 | 
			
		||||
  },
 | 
			
		||||
  "deprecated": false,
 | 
			
		||||
  "description": "Isomorphic WHATWG Fetch API, for Node & Browserify",
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
    "chai": "^1.10.0",
 | 
			
		||||
    "es6-promise": "^2.0.1",
 | 
			
		||||
    "jshint": "^2.5.11",
 | 
			
		||||
    "lintspaces-cli": "0.0.4",
 | 
			
		||||
    "mocha": "^2.1.0",
 | 
			
		||||
    "nock": "^0.56.0",
 | 
			
		||||
    "npm-prepublish": "^1.0.2"
 | 
			
		||||
  },
 | 
			
		||||
  "homepage": "https://github.com/matthew-andrews/isomorphic-fetch/issues",
 | 
			
		||||
  "license": "MIT",
 | 
			
		||||
  "main": "fetch-npm-node.js",
 | 
			
		||||
  "name": "isomorphic-fetch",
 | 
			
		||||
  "repository": {
 | 
			
		||||
    "type": "git",
 | 
			
		||||
    "url": "git+https://github.com/matthew-andrews/isomorphic-fetch.git"
 | 
			
		||||
  },
 | 
			
		||||
  "scripts": {
 | 
			
		||||
    "files": "find . -name '*.js' ! -path './node_modules/*' ! -path './bower_components/*'",
 | 
			
		||||
    "test": "jshint `npm run -s files` && lintspaces -i js-comments -e .editorconfig `npm run -s files` && mocha"
 | 
			
		||||
  },
 | 
			
		||||
  "version": "2.2.1"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										51
									
								
								express-server/node_modules/isomorphic-fetch/test/api.test.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								express-server/node_modules/isomorphic-fetch/test/api.test.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,51 @@
 | 
			
		||||
/*global fetch*/
 | 
			
		||||
"use strict";
 | 
			
		||||
 | 
			
		||||
require('es6-promise').polyfill();
 | 
			
		||||
require('../fetch-npm-node');
 | 
			
		||||
var expect = require('chai').expect;
 | 
			
		||||
var nock = require('nock');
 | 
			
		||||
var good = 'hello world. 你好世界。';
 | 
			
		||||
var bad = 'good bye cruel world. 再见残酷的世界。';
 | 
			
		||||
 | 
			
		||||
function responseToText(response) {
 | 
			
		||||
	if (response.status >= 400) throw new Error("Bad server response");
 | 
			
		||||
	return response.text();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
describe('fetch', function() {
 | 
			
		||||
 | 
			
		||||
	before(function() {
 | 
			
		||||
		nock('https://mattandre.ws')
 | 
			
		||||
			.get('/succeed.txt')
 | 
			
		||||
			.reply(200, good);
 | 
			
		||||
		nock('https://mattandre.ws')
 | 
			
		||||
			.get('/fail.txt')
 | 
			
		||||
			.reply(404, bad);
 | 
			
		||||
	});
 | 
			
		||||
 | 
			
		||||
	it('should be defined', function() {
 | 
			
		||||
		expect(fetch).to.be.a('function');
 | 
			
		||||
	});
 | 
			
		||||
 | 
			
		||||
	it('should facilitate the making of requests', function(done) {
 | 
			
		||||
		fetch('//mattandre.ws/succeed.txt')
 | 
			
		||||
			.then(responseToText)
 | 
			
		||||
			.then(function(data) {
 | 
			
		||||
				expect(data).to.equal(good);
 | 
			
		||||
				done();
 | 
			
		||||
			})
 | 
			
		||||
			.catch(done);
 | 
			
		||||
	});
 | 
			
		||||
 | 
			
		||||
	it('should do the right thing with bad requests', function(done) {
 | 
			
		||||
		fetch('//mattandre.ws/fail.txt')
 | 
			
		||||
			.then(responseToText)
 | 
			
		||||
			.catch(function(err) {
 | 
			
		||||
				expect(err.toString()).to.equal("Error: Bad server response");
 | 
			
		||||
				done();
 | 
			
		||||
			})
 | 
			
		||||
			.catch(done);
 | 
			
		||||
	});
 | 
			
		||||
 | 
			
		||||
});
 | 
			
		||||
		Reference in New Issue
	
	Block a user