immutable-js
Version:
Immutable types in JavaScript
25 lines (21 loc) • 703 B
JavaScript
/**
* Copyright (c) 2015, Jan Biasi.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
import invariant from './invariant'
export function assertNotInfinite(size) {
invariant(
size !== Infinity,
'Can\'t perform this action with an infinite size.'
);
}
export function assertNotZeroLength(seq) {
invariant(
!!(seq.length ? seq.length > 0 : (seq.size ? seq.size > 0 : false)),
'Sequence must contain any items to perform this action.'
)
}