UNPKG

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