Browse Source

Merge pull request #3048 from ian-r-rose/expose_validate

Expose validate functions in Contents namespace.
Steven Silvester 7 years ago
parent
commit
1a66a34289
1 changed files with 16 additions and 0 deletions
  1. 16 0
      packages/services/src/contents/index.ts

+ 16 - 0
packages/services/src/contents/index.ts

@@ -108,6 +108,14 @@ namespace Contents {
     readonly format: FileFormat;
   }
 
+  /**
+   * Validates an IModel, thowing an error if it does not pass.
+   */
+  export
+  function validateContentsModel(contents: IModel): void {
+    validate.validateContentsModel(contents);
+  }
+
   /**
    * A contents file type.
    */
@@ -184,6 +192,14 @@ namespace Contents {
     readonly last_modified: string;
   }
 
+  /**
+   * Validates an ICheckpointModel, thowing an error if it does not pass.
+   */
+  export
+  function validateCheckpointModel(checkpoint: ICheckpointModel): void {
+    validate.validateCheckpointModel(checkpoint);
+  }
+
   /**
    * The change args for a file change.
    */