github.com/jbendotnet/noms@v0.0.0-20190904222105-c43e4293ea92/cmd/noms/splore/src/assert.js (about) 1 // Copyright 2017 Attic Labs, Inc. All rights reserved. 2 // Licensed under the Apache License, version 2.0: 3 // http://www.apache.org/licenses/LICENSE-2.0 4 5 // @flow 6 7 export function notNull<T>(v: ?T): T { 8 if (v !== null && v !== undefined) { 9 return v; 10 } 11 throw new Error('Non-null assertion failed'); 12 }