'use strict'; var Promise = require('bluebird') , shimmer = require('shimmer'); // functionName: The Promise function that should be shimmed // fnArgs: The arguments index that should be CLS enabled (typically all callbacks). Offset from last if negative function shimCLS(object, functionName, fnArgs){ shimmer.wrap(object, functionName, function(fn) { return function () { if (Promise.Sequelize && Promise.Sequelize.cls) { var ns = Promise.Sequelize.cls; for(var x=0; x