New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

caterpillar-filter

Package Overview
Dependencies
Maintainers
2
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

caterpillar-filter - npm Package Compare versions

Comparing version 4.5.0 to 5.0.0-next.1585174449.371df9074525afc87beff7556768dc6176bf9493

178

edition-browsers/index.js
// @ts-check
/* eslint class-methods-use-this:0 */
'use strict'; // Imports
'use strict' // Imports
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _typeof(obj) {
'@babel/helpers - typeof'
if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') {
_typeof = function _typeof(obj) {
return typeof obj
}
} else {
_typeof = function _typeof(obj) {
return obj &&
typeof Symbol === 'function' &&
obj.constructor === Symbol &&
obj !== Symbol.prototype
? 'symbol'
: typeof obj
}
}
return _typeof(obj)
}
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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 _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; }
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps)
if (staticProps) _defineProperties(Constructor, staticProps)
return Constructor
}
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
function _createSuper(Derived) {
return function () {
var Super = _getPrototypeOf(Derived),
result
if (_isNativeReflectConstruct()) {
var NewTarget = _getPrototypeOf(this).constructor
result = Reflect.construct(Super, arguments, NewTarget)
} else {
result = Super.apply(this, arguments)
}
return _possibleConstructorReturn(this, result)
}
}
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _possibleConstructorReturn(self, call) {
if (call && (_typeof(call) === 'object' || typeof call === 'function')) {
return call
}
return _assertThisInitialized(self)
}
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError(
"this hasn't been initialised - super() hasn't been called"
)
}
return self
}
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _isNativeReflectConstruct() {
if (typeof Reflect === 'undefined' || !Reflect.construct) return false
if (Reflect.construct.sham) return false
if (typeof Proxy === 'function') return true
try {
Date.prototype.toString.call(Reflect.construct(Date, [], function () {}))
return true
} catch (e) {
return false
}
}
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf
? Object.getPrototypeOf
: function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o)
}
return _getPrototypeOf(o)
}
function _inherits(subClass, superClass) {
if (typeof superClass !== 'function' && superClass !== null) {
throw new TypeError('Super expression must either be null or a function')
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: { value: subClass, writable: true, configurable: true },
})
if (superClass) _setPrototypeOf(subClass, superClass)
}
function _setPrototypeOf(o, p) {
_setPrototypeOf =
Object.setPrototypeOf ||
function _setPrototypeOf(o, p) {
o.__proto__ = p
return o
}
return _setPrototypeOf(o, p)
}
var _require = require('caterpillar'),
Transform = _require.Transform;
Transform = _require.Transform
/**

@@ -40,27 +134,27 @@ Filter the log entires by level.

var Filter = /*#__PURE__*/ (function (_Transform) {
_inherits(Filter, _Transform)
var Filter =
/*#__PURE__*/
function (_Transform) {
_inherits(Filter, _Transform);
var _super = _createSuper(Filter)
function Filter() {
_classCallCheck(this, Filter);
function Filter() {
_classCallCheck(this, Filter)
return _possibleConstructorReturn(this, _getPrototypeOf(Filter).apply(this, arguments));
}
return _super.apply(this, arguments)
}
_createClass(Filter, [{
key: "getInitialConfig",
_createClass(Filter, [
{
key: 'getInitialConfig',
/**
/**
Get the initial configuration.
@returns {Object}
*/
value: function getInitialConfig() {
return {
level: 6
};
}
/**
value: function getInitialConfig() {
return {
level: 6,
}
},
/**
Empty log entries that are not within our level range.

@@ -71,19 +165,19 @@ Convert the message from Logger into JSON, check its level, if it is above our level, discard it.

*/
},
{
key: 'format',
value: function format(message) {
var entry = JSON.parse(message)
}, {
key: "format",
value: function format(message) {
var entry = JSON.parse(message);
var _this$getConfig = this.getConfig(),
level = _this$getConfig.level
var _this$getConfig = this.getConfig(),
level = _this$getConfig.level;
return entry.levelNumber > level ? null : entry
},
},
])
return entry.levelNumber > level ? null : entry;
}
}]);
return Filter
})(Transform) // Export
return Filter;
}(Transform); // Export
module.exports = Filter;
module.exports = Filter
# History
## v5.0.0 2020 March 26
- Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation)
- Minimum required node version changed from `node: >=8` to `node: >=10` to keep up with mandatory ecosystem changes
## v4.5.0 2019 December 9

@@ -4,0 +9,0 @@

{
"title": "Filter Transform for [Caterpillar](https://github.com/bevry/caterpillar)",
"name": "caterpillar-filter",
"version": "4.5.0",
"version": "5.0.0-next.1585174449.371df9074525afc87beff7556768dc6176bf9493",
"description": "Filter out undesired log levels from your Caterpillar logger stream",

@@ -9,13 +9,16 @@ "homepage": "https://github.com/bevry/caterpillar-filter",

"keywords": [
"browser",
"caterpillar",
"caterpillar-transform",
"console",
"debug",
"human",
"log",
"logger",
"logging",
"debug",
"readable",
"stream",
"transform",
"human",
"readable"
"typed",
"types"
],

@@ -59,4 +62,3 @@ "badges": {

"contributors": [
"Benjamin Lupton <b@lupton.cc> (http://balupton.com)",
"dependabot-preview[bot] (http://github.com/apps/dependabot-preview)"
"Benjamin Lupton <b@lupton.cc> (http://balupton.com)"
],

@@ -71,7 +73,7 @@ "bugs": {

"engines": {
"node": ">=8"
"node": ">=10"
},
"editions": [
{
"description": "esnext source code with require for modules",
"description": "ESNext source code for Node.js with Require for modules",
"directory": "source",

@@ -85,3 +87,3 @@ "entry": "index.js",

"engines": {
"node": "8 || 10 || 12",
"node": "10 || 12",
"browsers": false

@@ -91,3 +93,3 @@ }

{
"description": "esnext compiled for browsers with require for modules",
"description": "ESNext compiled for web browsers with Require for modules",
"directory": "edition-browsers",

@@ -109,20 +111,20 @@ "entry": "index.js",

"devDependencies": {
"@babel/cli": "^7.7.5",
"@babel/core": "^7.7.5",
"@babel/plugin-proposal-object-rest-spread": "^7.7.4",
"@babel/preset-env": "^7.7.6",
"assert-helpers": "^5.8.0",
"@babel/cli": "^7.8.4",
"@babel/core": "^7.9.0",
"@babel/plugin-proposal-object-rest-spread": "^7.9.0",
"@babel/preset-env": "^7.9.0",
"assert-helpers": "^6.0.0",
"caterpillar": "^4.0.0",
"eslint": "^6.7.2",
"eslint-config-bevry": "^2.2.0",
"eslint-config-prettier": "^6.7.0",
"eslint": "^6.8.0",
"eslint-config-bevry": "^2.3.0",
"eslint-config-prettier": "^6.10.1",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-prettier": "^3.1.2",
"jsdoc": "^3.6.3",
"kava": "^4.3.0",
"kava": "^4.4.0",
"minami": "^1.2.3",
"prettier": "^1.19.1",
"projectz": "^1.15.0",
"prettier": "^2.0.2",
"projectz": "^1.19.0",
"surge": "^0.21.3",
"valid-directory": "^1.5.0"
"valid-directory": "^1.6.0"
},

@@ -151,5 +153,5 @@ "peerDependencies": {

"our:verify": "npm run our:verify:directory && npm run our:verify:eslint && npm run our:verify:prettier",
"our:verify:directory": "npx valid-directory",
"our:verify:directory": "valid-directory",
"our:verify:eslint": "eslint --fix --ignore-pattern '**/*.d.ts' --ignore-pattern '**/vendor/' --ignore-pattern '**/node_modules/' --ext .mjs,.js,.jsx,.ts,.tsx ./source",
"our:verify:prettier": "prettier --write ./source/**",
"our:verify:prettier": "prettier --write .",
"test": "node ./source/test.js"

@@ -174,3 +176,6 @@ },

{
"targets": "defaults",
"targets": {
"esmodules": false,
"browsers": "defaults"
},
"modules": false

@@ -177,0 +182,0 @@ }

@@ -36,2 +36,8 @@ <!-- TITLE/ -->

## Usage
[Complete API Documentation.](http://master.caterpillar-filter.bevry.surge.sh/docs/)
[Example.](https://github.com/bevry/caterpillar-examples/blob/master/filter.js)
<!-- INSTALL/ -->

@@ -44,3 +50,4 @@

<li>Install: <code>npm install --save caterpillar-filter</code></li>
<li>Require: <code>require('caterpillar-filter')</code></li>
<li>Import: <code>import * as pkg from ('caterpillar-filter')</code></li>
<li>Require: <code>const pkg = require('caterpillar-filter')</code></li>
</ul>

@@ -52,3 +59,3 @@

<script type="module">
import * as pkg from '//dev.jspm.io/caterpillar-filter'
import * as pkg from '//dev.jspm.io/caterpillar-filter@5.0.0'
</script>

@@ -62,4 +69,4 @@ ```

<ul><li><code>caterpillar-filter</code> aliases <code>caterpillar-filter/source/index.js</code></li>
<li><code>caterpillar-filter/source/index.js</code> is esnext source code with require for modules</li>
<li><code>caterpillar-filter/edition-browsers/index.js</code> is esnext compiled for browsers with require for modules</li></ul>
<li><code>caterpillar-filter/source/index.js</code> is <a href="https://en.wikipedia.org/wiki/ECMAScript#ES.Next" title="ECMAScript Next">ESNext</a> source code for <a href="https://nodejs.org" title="Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine">Node.js</a> with <a href="https://nodejs.org/dist/latest-v5.x/docs/api/modules.html" title="Node/CJS Modules">Require</a> for modules</li>
<li><code>caterpillar-filter/edition-browsers/index.js</code> is <a href="https://en.wikipedia.org/wiki/ECMAScript#ES.Next" title="ECMAScript Next">ESNext</a> compiled for web browsers with <a href="https://nodejs.org/dist/latest-v5.x/docs/api/modules.html" title="Node/CJS Modules">Require</a> for modules</li></ul>

@@ -81,8 +88,2 @@ <h3><a href="https://www.typescriptlang.org/" title="TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. ">TypeScript</a></h3>

## Usage
[API Documentation.](http://master.caterpillar-filter.bevry.surge.sh/docs/)
[Example.](https://github.com/bevry/caterpillar-examples/blob/master/filter.js)
<!-- HISTORY/ -->

@@ -105,3 +106,3 @@

<ul><li><a href="http://balupton.com">Benjamin Lupton</a> — <a href="https://github.com/bevry/caterpillar-filter/commits?author=balupton" title="View the GitHub contributions of Benjamin Lupton on repository bevry/caterpillar-filter">view contributions</a></li></ul>
<ul><li><a href="http://balupton.com">Benjamin Lupton</a></li></ul>

@@ -126,4 +127,3 @@ <h3>Sponsors</h3>

<ul><li><a href="http://balupton.com">Benjamin Lupton</a> — <a href="https://github.com/bevry/caterpillar-filter/commits?author=balupton" title="View the GitHub contributions of Benjamin Lupton on repository bevry/caterpillar-filter">view contributions</a></li>
<li><a href="http://github.com/apps/dependabot-preview">dependabot-preview[bot]</a> — <a href="https://github.com/bevry/caterpillar-filter/commits?author=dependabot-preview[bot]" title="View the GitHub contributions of dependabot-preview[bot] on repository bevry/caterpillar-filter">view contributions</a></li></ul>
<ul><li><a href="http://balupton.com">Benjamin Lupton</a></li></ul>

@@ -130,0 +130,0 @@ <a href="https://github.com/bevry/caterpillar-filter/blob/master/CONTRIBUTING.md#files">Discover how you can contribute by heading on over to the <code>CONTRIBUTING.md</code> file.</a>

@@ -28,3 +28,3 @@ // @ts-check

return {
level: 6
level: 6,
}

@@ -31,0 +31,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