Added logging, changed some directory structure

This commit is contained in:
2018-01-13 21:33:40 -05:00
parent f079a5f067
commit 8e72ffb917
73656 changed files with 35284 additions and 53718 deletions

View File

@@ -0,0 +1,16 @@
{
"env": {
"cjs": {
"presets": [
["es2015"],
"stage-2"
]
},
"module": {
"presets": [
["es2015", {"modules": false}],
"stage-2"
]
}
}
}

View File

@@ -0,0 +1,10 @@
{
"parser": "babel-eslint",
"extends": "eslint:recommended",
"env": {
"node": true
},
"rules": {
"strict": 0
}
}

View File

@@ -0,0 +1,3 @@
node_modules
npm-debug.log
yarn.lock

View File

@@ -0,0 +1,2 @@
declare const isInBrowser: boolean;
export default isInBrowser;

View File

@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var isBrowser = exports.isBrowser = (typeof window === "undefined" ? "undefined" : _typeof(window)) === "object" && (typeof document === "undefined" ? "undefined" : _typeof(document)) === 'object' && document.nodeType === 9;
exports.default = isBrowser;

View File

@@ -0,0 +1,5 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
export var isBrowser = (typeof window === "undefined" ? "undefined" : _typeof(window)) === "object" && (typeof document === "undefined" ? "undefined" : _typeof(document)) === 'object' && document.nodeType === 9;
export default isBrowser;

View File

@@ -0,0 +1,72 @@
{
"_args": [
[
"is-in-browser@1.1.3",
"C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\torrent-project"
]
],
"_from": "is-in-browser@1.1.3",
"_id": "is-in-browser@1.1.3",
"_inBundle": false,
"_integrity": "sha1-Vv9NtoOgeMYILrldrX3GLh0E+DU=",
"_location": "/material-ui/is-in-browser",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "is-in-browser@1.1.3",
"name": "is-in-browser",
"escapedName": "is-in-browser",
"rawSpec": "1.1.3",
"saveSpec": null,
"fetchSpec": "1.1.3"
},
"_requiredBy": [
"/material-ui/css-vendor",
"/material-ui/jss"
],
"_resolved": "https://registry.npmjs.org/is-in-browser/-/is-in-browser-1.1.3.tgz",
"_spec": "1.1.3",
"_where": "C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\torrent-project",
"author": {
"name": "Jared Anderson"
},
"bugs": {
"url": "https://github.com/tuxsudo/is-in-browser/issues"
},
"dependencies": {},
"description": "Simple check to see if current app is running in browser",
"devDependencies": {
"babel": "^6.3.26",
"babel-cli": "^6.4.5",
"babel-eslint": "^4.1.6",
"babel-preset-es2015": "^6.3.13",
"babel-preset-stage-2": "^6.3.13",
"babel-tape-runner": "^2.0.1",
"cpy-cli": "^1.0.1",
"eslint": "^1.10.3",
"eslint-config-airbnb": "^4.0.0",
"tap-spec": "^4.1.1",
"tape": "^4.4.0"
},
"directories": {
"test": "test"
},
"homepage": "https://github.com/tuxsudo/is-in-browser#readme",
"keywords": [],
"license": "MIT",
"main": "dist/index.js",
"module": "dist/module.js",
"name": "is-in-browser",
"repository": {
"type": "git",
"url": "git+https://github.com/tuxsudo/is-in-browser.git"
},
"scripts": {
"build": "BABEL_ENV=cjs babel src -d dist && BABEL_ENV=module babel src/index.js -o dist/module.js && cpy src/index.d.ts dist",
"prepublish": "npm run build",
"test": "babel-tape-runner test/*.js | tap-spec"
},
"types": "dist/index.d.ts",
"version": "1.1.3"
}

View File

@@ -0,0 +1,19 @@
# Is In Browser?
```
import isBrowser from 'is-in-browser';
if(isBrowser) {
//...
}
```
## CommonJS
For those not using Babel / ES6 Modules
```
var isBrowser = require('is-in-browser').default;
if(isBrowser) { //... }
```

View File

@@ -0,0 +1,2 @@
declare const isInBrowser: boolean;
export default isInBrowser;

View File

@@ -0,0 +1,5 @@
export const isBrowser = typeof window === "object"
&& typeof document === 'object'
&& document.nodeType === 9;
export default isBrowser;

View File

@@ -0,0 +1,8 @@
import test from 'tape';
import isBrowser from '../src/index';
test('isInBrowser', t => {
t.equal(false, isBrowser, 'works as expected in Node');
t.end();
});