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

apollo-link-logger

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apollo-link-logger - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

es/__tests__/logging.test.js

4

es/__tests__/formatMessage.test.js

@@ -15,2 +15,6 @@ 'use strict';

});
it('does not include performance information for subscriptions', function () {
expect((0, _formatMessage2.default)('subscription', { operationName: 'MessagesSubscription' }, 500)).toMatchSnapshot();
});
});

5

es/formatMessage.js

@@ -16,4 +16,7 @@ 'use strict';

parts.push('%c' + operation.operationName);
parts.push('%c(in ' + ellapsed + ' ms)');
if (operationType !== 'subscription') {
parts.push('%c(in ' + ellapsed + ' ms)');
}
return [parts.join(' ')].concat(headerCss);

@@ -20,0 +23,0 @@ };

@@ -19,4 +19,5 @@ 'use strict';

function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } /* eslint-disable import/no-unresolved,import/extensions */
var loggerLink = new _apolloLink.ApolloLink(function (operation, forward) {

@@ -23,0 +24,0 @@ var startTime = new Date().getTime();

@@ -6,2 +6,7 @@ 'use strict';

});
/* eslint-disable no-console */
var bindToConsole = function bindToConsole(consoleMethod, polyfill) {
return consoleMethod ? consoleMethod.bind(console) : polyfill;
};
var logging = function () {

@@ -42,5 +47,5 @@ var prefix = '';

error: consoleError,
group: console.group || consoleGroup,
groupCollapsed: console.groupCollapsed || consoleGroup,
groupEnd: console.groupEnd || consoleGroupEnd
group: bindToConsole(console.group, consoleGroup),
groupCollapsed: bindToConsole(console.groupCollapsed, consoleGroup),
groupEnd: bindToConsole(console.groupEnd, consoleGroupEnd)
};

@@ -47,0 +52,0 @@ }();

@@ -15,2 +15,6 @@ 'use strict';

});
it('does not include performance information for subscriptions', function () {
expect((0, _formatMessage2.default)('subscription', { operationName: 'MessagesSubscription' }, 500)).toMatchSnapshot();
});
});

@@ -14,4 +14,7 @@ 'use strict';

parts.push('%c' + operation.operationName);
parts.push('%c(in ' + ellapsed + ' ms)');
if (operationType !== 'subscription') {
parts.push('%c(in ' + ellapsed + ' ms)');
}
return [parts.join(' ')].concat(headerCss);

@@ -18,0 +21,0 @@ };

@@ -17,4 +17,5 @@ 'use strict';

function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } /* eslint-disable import/no-unresolved,import/extensions */
var loggerLink = new _apolloLink.ApolloLink(function (operation, forward) {

@@ -21,0 +22,0 @@ var startTime = new Date().getTime();

'use strict';
exports.__esModule = true;
/* eslint-disable no-console */
var bindToConsole = function bindToConsole(consoleMethod, polyfill) {
return consoleMethod ? consoleMethod.bind(console) : polyfill;
};
var logging = function () {

@@ -39,5 +44,5 @@ var prefix = '';

error: consoleError,
group: console.group || consoleGroup,
groupCollapsed: console.groupCollapsed || consoleGroup,
groupEnd: console.groupEnd || consoleGroupEnd
group: bindToConsole(console.group, consoleGroup),
groupCollapsed: bindToConsole(console.groupCollapsed, consoleGroup),
groupEnd: bindToConsole(console.groupEnd, consoleGroupEnd)
};

@@ -44,0 +49,0 @@ }();

@@ -1,1 +0,97 @@

{"name":"apollo-link-logger","version":"1.2.0","description":"Logger for Apollo Link that uses a similar format to redux-logger. Includes performance information.","author":"Adrian Perez adrian@adrianperez.org","license":"MIT","module":"es/index.js","main":"lib/index.js","engines":{"node":"> 4","npm":"> 3"},"files":["es","dist","lib"],"scripts":{"start":"webpack","commit":"commit","precommit":"lint-staged","commitmsg":"commitlint -e $GIT_PARAMS","clean":"rimraf es/* src/* dist/* coverage/*","flow":"flow","lint":"eslint","add-contributor":"all-contributors add","generate-contributors":"all-contributors generate","build:es":"cross-env BABEL_ENV=es babel src -q -d es","build:cjs":"cross-env BABEL_ENV=cjs babel src -q -d lib","build":"npm run build:es && npm run build:cjs","test":"jest","prettier:js":"prettier --write --trailing-comma all --tab-width 2 --single-quote --parser flow --print-width 80 \"src/**/*.js\" \"!**/dist/**\"","prepare":"npm run build","semantic-release":"semantic-release pre && npm publish && semantic-release post"},"lint-staged":{"*.js":["prettier --write --trailing-comma all --tab-width 2 --single-quote --parser flow --print-width 80","git add","jest --bail --findRelatedTests"]},"config":{"commitzen":{"path":"@commitlint/prompt"}},"jest":{"testMatch":["<rootDir>/src/**/*.test.js"],"collectCoverageFrom":["src/**/*.js","!**/node_modules/**","!**/vendor/**"]},"quokka":{"babel":true},"devDependencies":{"@commitlint/cli":"^5.2.5","@commitlint/config-conventional":"^5.2.3","all-contributors-cli":"^4.6.0","babel-cli":"^6.0.0","babel-core":"^6.0.0","babel-eslint":"^7.2.3","babel-preset-env":"^1.6.0","babel-jest":"21.0.0","commitizen":"^2.9.6","cross-env":"^2.0.1","rimraf":"~2.3.2","eslint":"^4.6.1","eslint-config-airbnb-base":"^12.1.0","eslint-config-prettier":"^2.4.0","eslint-plugin-flowtype":"^2.35.1","eslint-plugin-fp":"^2.3.0","eslint-plugin-import":"^2.7.0","eslint-plugin-jest":"^21.0.0","eslint-plugin-prettier":"^2.2.0","flow-bin":"^0.58.0","husky":"^0.14.3","jest":"^21.2.1","lint-staged":"^4.1.3","prettier":"^1.8.1","semantic-release":"^8.2.0"},"peerDependencies":{"apollo-link":"^1.0.0"},"repository":{"type":"git","url":"https://github.com/blackxored/apollo-link-logger.git"}}
{
"name": "apollo-link-logger",
"version": "1.2.1",
"description": "Logger for Apollo Link that uses a similar format to redux-logger. Includes performance information.",
"author": "Adrian Perez adrian@adrianperez.org",
"license": "MIT",
"module": "es/index.js",
"main": "lib/index.js",
"engines": {
"node": "> 4",
"npm": "> 3"
},
"files": [
"es",
"dist",
"lib"
],
"scripts": {
"start": "webpack",
"commit": "commit",
"precommit": "lint-staged",
"commitmsg": "commitlint -e $GIT_PARAMS",
"clean": "rimraf es/* src/* dist/* coverage/*",
"flow": "flow",
"lint": "eslint src",
"add-contributor": "all-contributors add",
"generate-contributors": "all-contributors generate",
"build:es": "cross-env BABEL_ENV=es babel src -q -d es",
"build:cjs": "cross-env BABEL_ENV=cjs babel src -q -d lib",
"build": "npm run build:es && npm run build:cjs",
"test": "jest",
"prettier:js": "prettier --write --trailing-comma all --tab-width 2 --single-quote --parser flow --print-width 80 \"src/**/*.js\" \"!**/dist/**\"",
"prepare": "npm run build",
"semantic-release": "semantic-release",
"travis-deploy-once": "travis-deploy-once"
},
"lint-staged": {
"*.js": [
"prettier --write --trailing-comma all --tab-width 2 --single-quote --parser flow --print-width 80",
"git add",
"jest --bail --findRelatedTests"
]
},
"config": {
"commitzen": {
"path": "@commitlint/prompt"
}
},
"jest": {
"testMatch": [
"<rootDir>/src/**/*.test.js"
],
"collectCoverageFrom": [
"src/**/*.js",
"!**/node_modules/**",
"!**/vendor/**"
]
},
"quokka": {
"babel": true
},
"devDependencies": {
"@commitlint/cli": "^6.1.3",
"@commitlint/config-conventional": "^6.1.3",
"all-contributors-cli": "^4.6.0",
"babel-cli": "^6.0.0",
"babel-core": "^6.0.0",
"babel-eslint": "^8.2.3",
"babel-preset-env": "^1.6.0",
"babel-jest": "22.4.3",
"commitizen": "^2.9.6",
"cross-env": "^5.1.4",
"rimraf": "~2.6.2",
"eslint": "^4.6.1",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-config-prettier": "^2.4.0",
"eslint-plugin-flowtype": "^2.35.1",
"eslint-plugin-fp": "^2.3.0",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-jest": "^21.0.0",
"eslint-plugin-prettier": "^2.2.0",
"flow-bin": "^0.70.0",
"husky": "^0.14.3",
"jest": "^22.4.3",
"lint-staged": "^7.0.4",
"prettier": "^1.8.1",
"semantic-release": "^15.1.7",
"travis-deploy-once": "^4.4.1"
},
"peerDependencies": {
"apollo-link": "^1.0.0"
},
"repository": {
"type": "git",
"url": "https://github.com/blackxored/apollo-link-logger.git"
}
}

@@ -14,3 +14,3 @@ # apollo-link-logger

[![MIT License][license-badge]][LICENSE]
[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors)
[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors)
[![PRs Welcome][prs-badge]][prs]

@@ -118,4 +118,4 @@ [![Commitizen friendly][commitizen-badge]][commitizen]

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
| [<img src="https://avatars3.githubusercontent.com/u/133308?v=4" width="100px;"/><br /><sub><b>Adrian Perez</b></sub>](https://adrianperez.codes)<br />[💻](https://github.com/blackxored/apollo-link-logger/commits?author=blackxored "Code") [📖](https://github.com/blackxored/apollo-link-logger/commits?author=blackxored "Documentation") [🚇](#infra-blackxored "Infrastructure (Hosting, Build-Tools, etc)") [⚠️](https://github.com/blackxored/apollo-link-logger/commits?author=blackxored "Tests") | [<img src="https://avatars3.githubusercontent.com/u/294597?s=460&v=4" width="100px;"/><br /><sub><b>Adam Savitzky</b></sub>](https://github.com/adambom)<br />[💻](https://github.com/blackxored/apollo-link-logger/commits?author=adambom "Code") |
| :---: | :---: |
| [<img src="https://avatars3.githubusercontent.com/u/133308?v=4" width="100px;"/><br /><sub><b>Adrian Perez</b></sub>](https://adrianperez.codes)<br />[💻](https://github.com/blackxored/apollo-link-logger/commits?author=blackxored "Code") [📖](https://github.com/blackxored/apollo-link-logger/commits?author=blackxored "Documentation") [🚇](#infra-blackxored "Infrastructure (Hosting, Build-Tools, etc)") [⚠️](https://github.com/blackxored/apollo-link-logger/commits?author=blackxored "Tests") | [<img src="https://avatars3.githubusercontent.com/u/294597?s=460&v=4" width="100px;"/><br /><sub><b>Adam Savitzky</b></sub>](https://github.com/adambom)<br />[💻](https://github.com/blackxored/apollo-link-logger/commits?author=adambom "Code") | [<img src="https://avatars3.githubusercontent.com/u/3065138?v=4" width="100px;"/><br /><sub><b>Ifeanyi Oraelosi</b></sub>](https://github.com/gnerkus)<br />[💻](https://github.com/blackxored/apollo-link-logger/commits?author=gnerkus "Code") |
| :---: | :---: | :---: |
<!-- ALL-CONTRIBUTORS-LIST:END -->

@@ -122,0 +122,0 @@

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