UNPKG

7.22 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.AnyPredicate = exports.DataViewPredicate = exports.ArrayBufferPredicate = exports.TypedArrayPredicate = exports.WeakSetPredicate = exports.SetPredicate = exports.WeakMapPredicate = exports.MapPredicate = exports.ErrorPredicate = exports.DatePredicate = exports.ObjectPredicate = exports.ArrayPredicate = exports.BooleanPredicate = exports.BigIntPredicate = exports.NumberPredicate = exports.StringPredicate = void 0;
4const string_1 = require("./predicates/string");
5Object.defineProperty(exports, "StringPredicate", { enumerable: true, get: function () { return string_1.StringPredicate; } });
6const number_1 = require("./predicates/number");
7Object.defineProperty(exports, "NumberPredicate", { enumerable: true, get: function () { return number_1.NumberPredicate; } });
8const bigint_1 = require("./predicates/bigint");
9Object.defineProperty(exports, "BigIntPredicate", { enumerable: true, get: function () { return bigint_1.BigIntPredicate; } });
10const boolean_1 = require("./predicates/boolean");
11Object.defineProperty(exports, "BooleanPredicate", { enumerable: true, get: function () { return boolean_1.BooleanPredicate; } });
12const predicate_1 = require("./predicates/predicate");
13const array_1 = require("./predicates/array");
14Object.defineProperty(exports, "ArrayPredicate", { enumerable: true, get: function () { return array_1.ArrayPredicate; } });
15const object_1 = require("./predicates/object");
16Object.defineProperty(exports, "ObjectPredicate", { enumerable: true, get: function () { return object_1.ObjectPredicate; } });
17const date_1 = require("./predicates/date");
18Object.defineProperty(exports, "DatePredicate", { enumerable: true, get: function () { return date_1.DatePredicate; } });
19const error_1 = require("./predicates/error");
20Object.defineProperty(exports, "ErrorPredicate", { enumerable: true, get: function () { return error_1.ErrorPredicate; } });
21const map_1 = require("./predicates/map");
22Object.defineProperty(exports, "MapPredicate", { enumerable: true, get: function () { return map_1.MapPredicate; } });
23const weak_map_1 = require("./predicates/weak-map");
24Object.defineProperty(exports, "WeakMapPredicate", { enumerable: true, get: function () { return weak_map_1.WeakMapPredicate; } });
25const set_1 = require("./predicates/set");
26Object.defineProperty(exports, "SetPredicate", { enumerable: true, get: function () { return set_1.SetPredicate; } });
27const weak_set_1 = require("./predicates/weak-set");
28Object.defineProperty(exports, "WeakSetPredicate", { enumerable: true, get: function () { return weak_set_1.WeakSetPredicate; } });
29const typed_array_1 = require("./predicates/typed-array");
30Object.defineProperty(exports, "TypedArrayPredicate", { enumerable: true, get: function () { return typed_array_1.TypedArrayPredicate; } });
31const array_buffer_1 = require("./predicates/array-buffer");
32Object.defineProperty(exports, "ArrayBufferPredicate", { enumerable: true, get: function () { return array_buffer_1.ArrayBufferPredicate; } });
33const data_view_1 = require("./predicates/data-view");
34Object.defineProperty(exports, "DataViewPredicate", { enumerable: true, get: function () { return data_view_1.DataViewPredicate; } });
35const any_1 = require("./predicates/any");
36Object.defineProperty(exports, "AnyPredicate", { enumerable: true, get: function () { return any_1.AnyPredicate; } });
37exports.default = (object, options) => {
38 Object.defineProperties(object, {
39 string: {
40 get: () => new string_1.StringPredicate(options)
41 },
42 number: {
43 get: () => new number_1.NumberPredicate(options)
44 },
45 bigint: {
46 get: () => new bigint_1.BigIntPredicate(options)
47 },
48 boolean: {
49 get: () => new boolean_1.BooleanPredicate(options)
50 },
51 undefined: {
52 get: () => new predicate_1.Predicate('undefined', options)
53 },
54 null: {
55 get: () => new predicate_1.Predicate('null', options)
56 },
57 nullOrUndefined: {
58 get: () => new predicate_1.Predicate('nullOrUndefined', options)
59 },
60 nan: {
61 get: () => new predicate_1.Predicate('nan', options)
62 },
63 symbol: {
64 get: () => new predicate_1.Predicate('symbol', options)
65 },
66 array: {
67 get: () => new array_1.ArrayPredicate(options)
68 },
69 object: {
70 get: () => new object_1.ObjectPredicate(options)
71 },
72 date: {
73 get: () => new date_1.DatePredicate(options)
74 },
75 error: {
76 get: () => new error_1.ErrorPredicate(options)
77 },
78 map: {
79 get: () => new map_1.MapPredicate(options)
80 },
81 weakMap: {
82 get: () => new weak_map_1.WeakMapPredicate(options)
83 },
84 set: {
85 get: () => new set_1.SetPredicate(options)
86 },
87 weakSet: {
88 get: () => new weak_set_1.WeakSetPredicate(options)
89 },
90 function: {
91 get: () => new predicate_1.Predicate('Function', options)
92 },
93 buffer: {
94 get: () => new predicate_1.Predicate('Buffer', options)
95 },
96 regExp: {
97 get: () => new predicate_1.Predicate('RegExp', options)
98 },
99 promise: {
100 get: () => new predicate_1.Predicate('Promise', options)
101 },
102 typedArray: {
103 get: () => new typed_array_1.TypedArrayPredicate('TypedArray', options)
104 },
105 int8Array: {
106 get: () => new typed_array_1.TypedArrayPredicate('Int8Array', options)
107 },
108 uint8Array: {
109 get: () => new typed_array_1.TypedArrayPredicate('Uint8Array', options)
110 },
111 uint8ClampedArray: {
112 get: () => new typed_array_1.TypedArrayPredicate('Uint8ClampedArray', options)
113 },
114 int16Array: {
115 get: () => new typed_array_1.TypedArrayPredicate('Int16Array', options)
116 },
117 uint16Array: {
118 get: () => new typed_array_1.TypedArrayPredicate('Uint16Array', options)
119 },
120 int32Array: {
121 get: () => new typed_array_1.TypedArrayPredicate('Int32Array', options)
122 },
123 uint32Array: {
124 get: () => new typed_array_1.TypedArrayPredicate('Uint32Array', options)
125 },
126 float32Array: {
127 get: () => new typed_array_1.TypedArrayPredicate('Float32Array', options)
128 },
129 float64Array: {
130 get: () => new typed_array_1.TypedArrayPredicate('Float64Array', options)
131 },
132 arrayBuffer: {
133 get: () => new array_buffer_1.ArrayBufferPredicate('ArrayBuffer', options)
134 },
135 sharedArrayBuffer: {
136 get: () => new array_buffer_1.ArrayBufferPredicate('SharedArrayBuffer', options)
137 },
138 dataView: {
139 get: () => new data_view_1.DataViewPredicate(options)
140 },
141 iterable: {
142 get: () => new predicate_1.Predicate('Iterable', options)
143 },
144 any: {
145 value: (...predicates) => new any_1.AnyPredicate(predicates, options)
146 }
147 });
148 return object;
149};