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

@bayou/see-all

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bayou/see-all - npm Package Compare versions

Comparing version 1.0.6 to 1.2.4

README.md

2

AllSinks.js

@@ -1,2 +0,2 @@

// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia).
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia).
// Licensed AS IS and WITHOUT WARRANTY under the Apache License,

@@ -3,0 +3,0 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0>

@@ -1,2 +0,2 @@

// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia).
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia).
// Licensed AS IS and WITHOUT WARRANTY under the Apache License,

@@ -3,0 +3,0 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0>

@@ -1,2 +0,2 @@

// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia).
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia).
// Licensed AS IS and WITHOUT WARRANTY under the Apache License,

@@ -3,0 +3,0 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0>

@@ -1,2 +0,2 @@

// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia).
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia).
// Licensed AS IS and WITHOUT WARRANTY under the Apache License,

@@ -3,0 +3,0 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0>

@@ -1,2 +0,2 @@

// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia).
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia).
// Licensed AS IS and WITHOUT WARRANTY under the Apache License,

@@ -3,0 +3,0 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0>

@@ -1,2 +0,2 @@

// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia).
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia).
// Licensed AS IS and WITHOUT WARRANTY under the Apache License,

@@ -3,0 +3,0 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0>

@@ -1,2 +0,2 @@

// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia).
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia).
// Licensed AS IS and WITHOUT WARRANTY under the Apache License,

@@ -375,3 +375,3 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0>

// Append the stack if available and appropriate. See the header doc for
// Append the stack if available and appropriate. See the header comment for
// more info.

@@ -501,2 +501,23 @@ if ( this.isMessage()

/**
* Constructs an instance just like this one, except with `payload` replaced
* with the indicated contents. It is only valid to call this method on
* instances for which {@link #isEvent} returns `true`; other cases will
* throw an error.
*
* @param {payload} payload New payload.
* @returns {LogRecord} An appropriately-constructed instance.
*/
withEvent(payload) {
const { timeMsec, stack, tag } = this;
if (!this.isEvent()) {
throw Errors.badUse('Requires an event instance.');
} else if (!DataUtil.isDeepFrozen(payload.args)) {
throw Errors.badValue(payload, 'deep-frozen data');
}
return new LogRecord(timeMsec, stack, tag, payload);
}
/**
* Constructs an instance just like this one, except with `message` replaced

@@ -523,2 +544,15 @@ * with the indicated contents. It is only valid to call this method on

/**
* Constructs an instance just like this one, except with `tag` replaced as
* indicated contents.
*
* @param {LogTag} tag New tag.
* @returns {LogRecord} An appropriately-constructed instance.
*/
withTag(tag) {
const { timeMsec, stack, payload } = this;
return new LogRecord(timeMsec, stack, tag, payload);
}
/**
* Calls `util.inspect()` on the given value, with standardized options.

@@ -525,0 +559,0 @@ *

@@ -1,2 +0,2 @@

// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia).
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia).
// Licensed AS IS and WITHOUT WARRANTY under the Apache License,

@@ -3,0 +3,0 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0>

@@ -1,2 +0,2 @@

// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia).
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia).
// Licensed AS IS and WITHOUT WARRANTY under the Apache License,

@@ -3,0 +3,0 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0>

@@ -1,2 +0,2 @@

// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia).
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia).
// Licensed AS IS and WITHOUT WARRANTY under the Apache License,

@@ -3,0 +3,0 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0>

@@ -1,2 +0,2 @@

// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia).
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia).
// Licensed AS IS and WITHOUT WARRANTY under the Apache License,

@@ -3,0 +3,0 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0>

@@ -7,6 +7,6 @@ {

"dependencies": {
"@bayou/util-common": "1.0.6"
"@bayou/util-common": "1.2.4"
},
"name": "@bayou/see-all",
"version": "1.0.6"
"version": "1.2.4"
}

@@ -1,2 +0,2 @@

// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia).
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia).
// Licensed AS IS and WITHOUT WARRANTY under the Apache License,

@@ -3,0 +3,0 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0>

@@ -1,2 +0,2 @@

// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia).
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia).
// Licensed AS IS and WITHOUT WARRANTY under the Apache License,

@@ -3,0 +3,0 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0>

@@ -1,2 +0,2 @@

// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia).
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia).
// Licensed AS IS and WITHOUT WARRANTY under the Apache License,

@@ -9,2 +9,3 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0>

import { LogRecord, LogTag } from '@bayou/see-all';
import { Functor } from '@bayou/util-common';

@@ -89,2 +90,62 @@ describe('@bayou/see-all/LogRecord', () => {

});
describe('withEvent()', () => {
it('is an error to call on a message log', () => {
const lr = LogRecord.forMessage(123, 'trace', new LogTag('taggaroo'), 'info', 'boop');
const f = new Functor('x', 1, 2);
assert.throws(() => { lr.withEvent(f); });
});
it('is an error to pass a payload that is not frozen data', () => {
const lr = LogRecord.forMessage(123, 'trace', new LogTag('taggaroo'), 'info', 'boop');
const f = new Functor('x', ['this', 'array', 'is', 'not', 'frozen']);
assert.throws(() => { lr.withEvent(f); });
});
it('operates as expected on an event log, given a valid value', () => {
const LOG_TAG = new LogTag('taggaroo');
const lr = LogRecord.forEvent(123321, 'zorch', LOG_TAG, new Functor('x', 1, 2));
const f = new Functor('y', 'z');
const newLr = lr.withEvent(f);
assert.strictEqual(newLr.payload, f);
assert.strictEqual(newLr.timeMsec, lr.timeMsec);
assert.strictEqual(newLr.stack, lr.stack);
assert.strictEqual(newLr.tag, LOG_TAG);
});
});
describe('withTag()', () => {
it('operates as expected on a message log', () => {
const LOG_TAG_1 = new LogTag('one');
const LOG_TAG_2 = new LogTag('two', 'three');
const lr = LogRecord.forMessage(123, 'trace', LOG_TAG_1, 'info', 'x', 'y', 'z');
const newLr = lr.withTag(LOG_TAG_2);
assert.strictEqual(newLr.tag, LOG_TAG_2);
assert.strictEqual(newLr.timeMsec, lr.timeMsec);
assert.strictEqual(newLr.stack, lr.stack);
assert.strictEqual(newLr.messageString, lr.messageString);
});
it('operates as expected on an event log', () => {
const LOG_TAG_1 = new LogTag('uno');
const LOG_TAG_2 = new LogTag('dos', 'tres');
const lr = LogRecord.forEvent(123321, 'zorch', LOG_TAG_1, new Functor('x', 1, 2));
const newLr = lr.withTag(LOG_TAG_2);
assert.strictEqual(newLr.tag, LOG_TAG_2);
assert.strictEqual(newLr.timeMsec, lr.timeMsec);
assert.strictEqual(newLr.stack, lr.stack);
assert.strictEqual(newLr.payload, lr.payload);
});
});
});

@@ -1,2 +0,2 @@

// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia).
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia).
// Licensed AS IS and WITHOUT WARRANTY under the Apache License,

@@ -3,0 +3,0 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.0>

@@ -1,2 +0,2 @@

// Copyright 2016-2018 the Bayou Authors (Dan Bornstein et alia).
// Copyright 2016-2019 the Bayou Authors (Dan Bornstein et alia).
// Licensed AS IS and WITHOUT WARRANTY under the Apache License,

@@ -3,0 +3,0 @@ // Version 2.0. Details: <http://www.apache.org/licenses/LICENSE-2.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