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

zipkin-context-cls

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zipkin-context-cls - npm Package Compare versions

Comparing version 0.14.2 to 0.15.0

.babelrc

28

lib/CLSContext.js

@@ -1,7 +0,9 @@

'use strict';
"use strict";
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
var _require = require('continuation-local-storage'),

@@ -11,3 +13,5 @@ createNamespace = _require.createNamespace,

module.exports = function () {
module.exports =
/*#__PURE__*/
function () {
function CLSContext() {

@@ -19,3 +23,5 @@ var namespace = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'zipkin';

this._session = getNamespace(namespace) || createNamespace(namespace);
var defaultContext = this._session.createContext();
this._session.enter(defaultContext);

@@ -25,3 +31,3 @@ }

_createClass(CLSContext, [{
key: 'setContext',
key: "setContext",
value: function setContext(ctx) {

@@ -31,5 +37,6 @@ this._session.set('zipkin', ctx);

}, {
key: 'getContext',
key: "getContext",
value: function getContext() {
var currentCtx = this._session.get('zipkin');
if (currentCtx != null) {

@@ -42,12 +49,14 @@ return currentCtx;

}, {
key: 'scoped',
key: "scoped",
value: function scoped(callable) {
var result = void 0;
var result;
this._session.run(function () {
result = callable();
});
return result;
}
}, {
key: 'letContext',
key: "letContext",
value: function letContext(ctx, callable) {

@@ -58,2 +67,3 @@ var _this = this;

_this.setContext(ctx);
return callable();

@@ -60,0 +70,0 @@ });

{
"name": "zipkin-context-cls",
"version": "0.14.2",
"version": "0.15.0",
"description": "A Context API implementation that uses continuation-local-storage under the hood",

@@ -8,3 +8,3 @@ "main": "lib/CLSContext.js",

"build": "babel src -d lib",
"test": "mocha --require ../../test/helper.js",
"test": "mocha --exit --require ../../test/helper.js",
"prepublish": "npm run build"

@@ -19,5 +19,7 @@ },

"devDependencies": {
"babel-cli": "^6.23.0",
"mocha": "^3.2.0"
}
"@babel/cli": "7.1.5",
"@babel/core": "7.1.5",
"mocha": "^5.2.0"
},
"gitHead": "efd22b807a6d6056a319d9468231480e7a58a402"
}
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