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

@appliedblockchain/helpers

Package Overview
Dependencies
Maintainers
14
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@appliedblockchain/helpers - npm Package Compare versions

Comparing version 3.0.2 to 3.1.1

web-socket-ready-state.js

12

Changelog.md
# Changelog
## [v3.1.1](../../compare/v3.1.0...v3.1.1) (2019-11-06)
* Bumping flow.
* Adding web-socket-ready-state helper.
* Updating type for indexed-by-key as flow has problems with nulls.
* Updating changelog.
## [v3.1.0](../../compare/v3.0.2...v3.1.0) (2019-09-10)
* Switching from `JSON.stringify` to `inspect` on default logger...
* Updating changelog.
## [v3.0.2](../../compare/v3.0.1...v3.0.2) (2019-08-21)

@@ -4,0 +16,0 @@

4

indexed-by-key.js

@@ -5,4 +5,4 @@ // @flow

Non-existing keys will be indexed under `undefined` key. */
function indexedByKey/*:: <K: string, T: { [K]: string }> */(xs /*: T[] */, key /*: K */) /*: { [string]: T } */ {
return xs.reduce((r, _) => {
function indexedByKey/*:: <T: {}> */(values /*: T[] */, key /*: string */) /*: { [string]: T } */ {
return values.reduce((r, _) => {
r[_[key]] = _

@@ -9,0 +9,0 @@ return r

// @flow
const os = require('os')
const { inspect } = require('util')
const { keys } = Object
const isString = require('./is-string')
const os = require('os')

@@ -67,3 +68,3 @@ /*::

const modLevels = (process.env.LOG || 'off')
const modLevels /*: { [string]: number } */ = (process.env.LOG || 'off')
.split(',')

@@ -74,3 +75,3 @@ .map(entry => entry.includes('=') ?

)
.reduce((r, [ k, v ]) => ({ ...r, [k]: levels[v] || levels.off }), {})
.reduce((r /*: any */, [ k, v ]) => ({ ...r, [k]: levels[v] || levels.off }), {})

@@ -86,3 +87,3 @@ function noop() {}

return JSON.stringify(
args.reduce((r, e) => Object.assign(r, typeof e === 'string' ? { msg: e } : e), { pid, hostname, time, level, name, v: 0 })
args.reduce((r /*: any */, e) => Object.assign(r, typeof e === 'string' ? { msg: e } : e), { pid, hostname, time, level, name, v: 0 })
)

@@ -92,4 +93,4 @@ }

const targets = {
console: targetMethods.reduce((r, k) => ({ ...r, [k]: (time, level, mod, ...rest) => console[k](`[${time}]`, `${labelOfLevel[level].padStart(5, ' ')}:`, `${mod}/${pid}`, `on ${hostname}:`, ...rest.map(_ => isString(_) ? _ : JSON.stringify(_))) }), {}),
bunyan: targetMethods.reduce((r, k) => ({ ...r, [k]: (...args) => console[k](jsonOf(...args)) }), {})
console: targetMethods.reduce((r /*: any */, k /*: any */) => ({ ...r, [k]: (time, level, mod, ...rest) => console[k](`[${time}]`, `${labelOfLevel[level].padStart(5, ' ')}:`, `${mod}/${pid}`, `on ${hostname}:`, ...rest.map(_ => isString(_) ? _ : inspect(_))) }), {}),
bunyan: targetMethods.reduce((r /*: any */, k /*: any */) => ({ ...r, [k]: (...args) => console[k](jsonOf(...args)) }), {})
}

@@ -96,0 +97,0 @@

{
"name": "@appliedblockchain/helpers",
"version": "3.0.2",
"version": "3.1.1",
"description": "No dependency, single file helpers.",

@@ -25,4 +25,4 @@ "main": "index.js",

"@appliedblockchain/eslint-config": "2.6.0",
"eslint": "6.2.1",
"flow-bin": "0.105.2"
"eslint": "6.6.0",
"flow-bin": "0.111.3"
},

@@ -29,0 +29,0 @@ "eslintConfig": {

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