@bemedev/types
Version:
Type definitions for Bemedev projects
23 lines (20 loc) • 628 B
JavaScript
import { DIGITS } from '../constants/numbers.js';
import { castFn } from '../utils.js';
import { commons } from './commons.js';
import { eq } from './utils.js';
const numbers = castFn()({
is: (arg) => typeof arg === 'number',
getString: (arg) => `${arg}`,
digit: castFn()({
is: (value) => eq(value, ...DIGITS),
}),
type: Number,
ZERO: commons.identity(0),
ONE: commons.identity(1),
MINUS_1: commons.identity(-1),
bigint: castFn()({
is: commons.function.checker.dynamic(value => typeof value === 'bigint'),
}),
});
export { numbers };
//# sourceMappingURL=numbers.js.map