Socket
Socket
Sign inDemoInstall

blueflag-record

Package Overview
Dependencies
5
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.4.0 to 0.4.1

13

lib/__tests__/Record-test.js

@@ -183,2 +183,7 @@ "use strict";

});
it('allows falsey values to be got', function () {
expect(new FooRecord({
baz: false
}).baz).toBe(false);
});
it('applies getter to the value', function () {

@@ -304,2 +309,10 @@ var date = new DateRecord({

});
});
describe('printing to console', function () {
it('it will return a string of record contents when inspect() is called', function () {
var foo = new FooRecord({
foo: 1
});
expect(foo.inspect()).toBe('Record {\n "foo": 1\n}');
});
});

12

lib/Record.js

@@ -18,2 +18,4 @@ "use strict";

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));

@@ -75,2 +77,5 @@

(0, _classCallCheck2.default)(this, Record);
(0, _defineProperty2.default)(this, "inspect", function () {
return "Record ".concat(JSON.stringify(_this.toObject(), null, 2));
});

@@ -104,3 +109,5 @@ var setter = function setter(key, value) {

get: nonEnumerable(function (key, notFoundValue) {
return getter(key, _this._data[key] || notFoundValue || _this._notSetValues[key]);
notFoundValue = notFoundValue !== undefined ? notFoundValue : _this._notSetValues[key];
var value = (0, _get.default)(key, notFoundValue)(_this._data);
return getter(key, value);
}),

@@ -174,3 +181,4 @@ getIn: nonEnumerable(function (path, notFoundValue) {

});
}
} // for printing records with console.log() in node
}]);

@@ -177,0 +185,0 @@ return Record;

2

package.json
{
"main": "lib/index.js",
"name": "blueflag-record",
"version": "0.4.0",
"version": "0.4.1",
"description": "An Unmutable compatible record",

@@ -6,0 +6,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc