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

@nteract/commutable

Package Overview
Dependencies
Maintainers
17
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nteract/commutable - npm Package Compare versions

Comparing version 7.2.12 to 7.3.0

17

__tests__/primitive.spec.ts

@@ -86,5 +86,8 @@ import {

const expectedResult = {
"application/vnd.vega.v2+json": { test: "1, 2, 4" }
};
// Uncomment the reformated result when we turn on the reformatting
const expectedResult = mediaBundle;
// const expectedResult = {
// "application/vnd.vega.v2+json": { test: "1, 2, 4" }
// };
expect(createOnDiskMediaBundle(mediaBundle)).toStrictEqual(expectedResult);

@@ -97,5 +100,7 @@ });

const expectedResult = {
"text/html": ["test\n", "\n", "\n", "this\n", "\n", "out"]
};
// Uncomment the reformated result when we turn on the reformatting
const expectedResult = mediaBundle;
// const expectedResult = {
// "text/html": ["test\n", "\n", "\n", "this\n", "\n", "out"]
// };

@@ -102,0 +107,0 @@ expect(createOnDiskMediaBundle(mediaBundle)).toStrictEqual(expectedResult);

@@ -101,21 +101,23 @@ "use strict";

function createOnDiskMediaBundle(mediaBundle) {
// Technically we could return just the mediaBundle as is
// return mediaBundle;
// Return the bundle as is
return mediaBundle;
// The remultiline function in the code below is costly when the data payload is large
// TODO: figure out a configurable way to reformat the string when needed.
// However for the sake of on-disk readability we write out remultilined
// versions of the array and string ones
const freshBundle = {};
for (const key in mediaBundle) {
if (IS_VEGA.test(key)) {
freshBundle[key] = JSON.parse(mediaBundle[key]);
}
else if (!isJSONKey(key) &&
(typeof mediaBundle[key] === "string" || Array.isArray(mediaBundle[key]))) {
freshBundle[key] = remultiline(mediaBundle[key]);
}
else {
freshBundle[key] = mediaBundle[key];
}
}
return freshBundle;
// const freshBundle: OnDiskMediaBundle = {};
// for (const key in mediaBundle) {
// if (IS_VEGA.test(key)) {
// freshBundle[key] = JSON.parse(mediaBundle[key] as string);
// } else if (
// !isJSONKey(key) &&
// (typeof mediaBundle[key] === "string" || Array.isArray(mediaBundle[key]))
// ) {
// freshBundle[key] = remultiline(mediaBundle[key] as MultiLineString);
// } else {
// freshBundle[key] = mediaBundle[key];
// }
// }
// return freshBundle;
}
exports.createOnDiskMediaBundle = createOnDiskMediaBundle;
{
"name": "@nteract/commutable",
"version": "7.2.12",
"version": "7.3.0",
"description": "library for immutable notebook operations",

@@ -27,3 +27,3 @@ "main": "lib/index.js",

},
"gitHead": "48e287db3d8fe3d6b8c078dc06b6cd8dfcc9ea96"
"gitHead": "6effa2f8b46213616b5096b6a451947a3d8c054c"
}

@@ -212,21 +212,24 @@ import * as Immutable from "immutable";

): OnDiskMediaBundle {
// Technically we could return just the mediaBundle as is
// return mediaBundle;
// Return the bundle as is
return mediaBundle;
// The remultiline function in the code below is costly when the data payload is large
// TODO: figure out a configurable way to reformat the string when needed.
// However for the sake of on-disk readability we write out remultilined
// versions of the array and string ones
const freshBundle: OnDiskMediaBundle = {};
for (const key in mediaBundle) {
if (IS_VEGA.test(key)) {
freshBundle[key] = JSON.parse(mediaBundle[key] as string);
} else if (
!isJSONKey(key) &&
(typeof mediaBundle[key] === "string" || Array.isArray(mediaBundle[key]))
) {
freshBundle[key] = remultiline(mediaBundle[key] as MultiLineString);
} else {
freshBundle[key] = mediaBundle[key];
}
}
return freshBundle;
// const freshBundle: OnDiskMediaBundle = {};
// for (const key in mediaBundle) {
// if (IS_VEGA.test(key)) {
// freshBundle[key] = JSON.parse(mediaBundle[key] as string);
// } else if (
// !isJSONKey(key) &&
// (typeof mediaBundle[key] === "string" || Array.isArray(mediaBundle[key]))
// ) {
// freshBundle[key] = remultiline(mediaBundle[key] as MultiLineString);
// } else {
// freshBundle[key] = mediaBundle[key];
// }
// }
// return freshBundle;
}

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