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

Allow Rich Content Object #50

Merged
merged 3 commits into from
Oct 31, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jupyter-js-services",
"version": "0.0.1",
"version": "0.1.0",
"description": "Client APIs for the Jupyter services REST APIs",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down
8 changes: 4 additions & 4 deletions src/contents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ interface IContentsOpts {
format?: string;

/**
* The file contents, or whether to include the file contents.
* The file content, or whether to include the file contents.
*
* #### Notes
* Can either contain the contents of a file for upload, or a boolean
* Can either contain the content of a file for upload, or a boolean
* indicating whether to include contents in the response.
*/
content?: string | boolean;
content?: any;

/**
* The file extension, including a leading `.`.
Expand Down Expand Up @@ -118,7 +118,7 @@ interface IContentsModel {
/**
* The file content.
*/
content?: string;
content?: any;

/**
* The format of the file `content`.
Expand Down
3 changes: 0 additions & 3 deletions src/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,12 @@ export
function validateCommMessage(msg: IKernelMessage): boolean {
for (var i = 0; i < COMM_FIELDS.length; i++) {
if (!msg.content.hasOwnProperty(COMM_FIELDS[i])) {
console.log('*****invalid', COMM_FIELDS[i]);
return false;
}
}
if (msg.header.msg_type === 'comm_open') {
if (!msg.content.hasOwnProperty('target_name') ||
typeof msg.content.target_name !== 'string') {
console.log('***TARGET NAME');
return false;
}
if (msg.content.hasOwnProperty('target_module') &&
Expand All @@ -53,7 +51,6 @@ function validateCommMessage(msg: IKernelMessage): boolean {
}
}
if (typeof msg.content.comm_id !== 'string') {
console.log("COMM_ID")
return false;
}
return true;
Expand Down