Remove unnecessary invariants (#2966)

Remove unnecessary invariants
This commit is contained in:
Rafael Weinstein
2016-12-20 15:52:26 -08:00
committed by GitHub
parent 262f10a14b
commit cb3390924f
3 changed files with 2 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
{
"name": "@attic/noms",
"license": "Apache-2.0",
"version": "65.4.0",
"version": "65.4.1",
"description": "Noms JS SDK",
"repository": "https://github.com/attic-labs/noms/tree/master/js/noms",
"main": "dist/commonjs/noms.js",

View File

@@ -8,7 +8,7 @@ import Ref from './ref.js';
import type {NomsKind} from './noms-kind.js';
import type Hash from './hash.js';
import {invariant, notNull} from './assert.js';
import {isPrimitiveKind, Kind} from './noms-kind.js';
import {Kind} from './noms-kind.js';
import {ValueBase} from './value.js';
import type Value from './value.js';
import {describeType} from './encode-human-readable.js';
@@ -250,7 +250,6 @@ export function makeCycleType(level: number): Type<any> {
* Gives the existing primitive Type value for a NomsKind.
*/
export function getPrimitiveType(k: NomsKind): Type<any> {
invariant(isPrimitiveKind(k));
switch (k) {
case Kind.Bool:
return boolType;

View File

@@ -73,7 +73,6 @@ export default class ValueDecoder {
}
}
invariant(isPrimitiveKind(k));
return getPrimitiveType(k);
}