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

@platform/util.value

Package Overview
Dependencies
Maintainers
1
Versions
145
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@platform/util.value - npm Package Compare versions

Comparing version 0.1.7 to 0.2.0

4

lib/value/value.object.d.ts

@@ -20,1 +20,5 @@ export declare function walk(obj: any | any[], fn: (obj: any | any[]) => void): void;

};
export declare function toArray<T = any, K = keyof T>(obj: object): Array<{
key: K;
value: T[keyof T];
}>;

@@ -129,2 +129,6 @@ "use strict";

exports.prune = prune;
function toArray(obj) {
return Object.keys(obj).map(function (key) { return ({ key: key, value: obj[key] }); });
}
exports.toArray = toArray;
function prepareKeyPath(keyPath) {

@@ -131,0 +135,0 @@ keyPath = keyPath.trim();

@@ -170,1 +170,23 @@ "use strict";

});
describe('object.toArray', function () {
var foos = { one: { count: 1 }, two: { count: 2 } };
it('empty', function () {
chai_1.expect(object.toArray({})).to.eql([]);
});
it('converts to array (untyped)', function () {
var res = object.toArray(foos);
chai_1.expect(res.length).to.eql(2);
});
it('converts to array (typed object)', function () {
var res = object.toArray(foos);
chai_1.expect(res.length).to.eql(2);
chai_1.expect(res[0].key).to.eql('one');
chai_1.expect(res[1].key).to.eql('two');
chai_1.expect(res[0].value).to.eql({ count: 1 });
chai_1.expect(res[1].value).to.eql({ count: 2 });
});
it('converts to array (typed key)', function () {
var res = object.toArray(foos);
chai_1.expect(res.length).to.eql(2);
});
});

2

package.json
{
"name": "@platform/util.value",
"version": "0.1.7",
"version": "0.2.0",
"description": "Helpers for working with, transforming, and formatting values.",

@@ -5,0 +5,0 @@ "main": "lib/index",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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