Skip to content

Commit

Permalink
Remove type-fest dependency (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
szmarczak authored Oct 3, 2022
1 parent b499156 commit 4b926e8
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
"callsites": "^4.0.0",
"dot-prop": "^7.2.0",
"lodash.isequal": "^4.5.0",
"type-fest": "^2.13.0",
"vali-date": "^1.0.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion source/predicates.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {Buffer} from 'node:buffer';
import {TypedArray} from 'type-fest';
import {TypedArray} from './typed-array.js';
import {StringPredicate} from './predicates/string.js';
import {NumberPredicate} from './predicates/number.js';
import {BigIntPredicate} from './predicates/bigint.js';
Expand Down
2 changes: 1 addition & 1 deletion source/predicates/typed-array.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {TypedArray} from 'type-fest';
import {TypedArray} from '../typed-array.js';
import {Predicate} from './predicate.js';

export class TypedArrayPredicate<T extends TypedArray> extends Predicate<T> {
Expand Down
13 changes: 13 additions & 0 deletions source/typed-array.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// https://github.com/sindresorhus/type-fest/blob/main/source/typed-array.d.ts
export type TypedArray =
| Int8Array
| Uint8Array
| Uint8ClampedArray
| Int16Array
| Uint16Array
| Int32Array
| Uint32Array
| Float32Array
| Float64Array
| BigInt64Array
| BigUint64Array;
2 changes: 1 addition & 1 deletion test/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {Buffer} from 'node:buffer';
import test from 'ava';
import {ExpectTypeOf, expectTypeOf} from 'expect-type';
import {TypedArray} from 'type-fest';
import {TypedArray} from '../source/typed-array.js';
import ow, {BasePredicate, Infer} from '../source/index.js';

test('type-level tests', t => {
Expand Down

0 comments on commit 4b926e8

Please sign in to comment.