Skip to content
This repository was archived by the owner on Aug 30, 2022. It is now read-only.

Commit fd1c020

Browse files
committed
Merge pull request #50 from blink1073/contents-object
Allow Rich Content Object
2 parents ce300a3 + acb560d commit fd1c020

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jupyter-js-services",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"description": "Client APIs for the Jupyter services REST APIs",
55
"main": "lib/index.js",
66
"typings": "lib/index.d.ts",

src/contents.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ interface IContentsOpts {
3838
format?: string;
3939

4040
/**
41-
* The file contents, or whether to include the file contents.
41+
* The file content, or whether to include the file contents.
4242
*
4343
* #### Notes
44-
* Can either contain the contents of a file for upload, or a boolean
44+
* Can either contain the content of a file for upload, or a boolean
4545
* indicating whether to include contents in the response.
4646
*/
47-
content?: string | boolean;
47+
content?: any;
4848

4949
/**
5050
* The file extension, including a leading `.`.
@@ -118,7 +118,7 @@ interface IContentsModel {
118118
/**
119119
* The file content.
120120
*/
121-
content?: string;
121+
content?: any;
122122

123123
/**
124124
* The format of the file `content`.

src/validate.ts

-3
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,12 @@ export
3636
function validateCommMessage(msg: IKernelMessage): boolean {
3737
for (var i = 0; i < COMM_FIELDS.length; i++) {
3838
if (!msg.content.hasOwnProperty(COMM_FIELDS[i])) {
39-
console.log('*****invalid', COMM_FIELDS[i]);
4039
return false;
4140
}
4241
}
4342
if (msg.header.msg_type === 'comm_open') {
4443
if (!msg.content.hasOwnProperty('target_name') ||
4544
typeof msg.content.target_name !== 'string') {
46-
console.log('***TARGET NAME');
4745
return false;
4846
}
4947
if (msg.content.hasOwnProperty('target_module') &&
@@ -53,7 +51,6 @@ function validateCommMessage(msg: IKernelMessage): boolean {
5351
}
5452
}
5553
if (typeof msg.content.comm_id !== 'string') {
56-
console.log("COMM_ID")
5754
return false;
5855
}
5956
return true;

0 commit comments

Comments
 (0)