@aglyn/shared-util-tools 1.0.0-beta.143
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +7 -0
- package/package.json +39 -0
- package/src/index.d.ts +72 -0
- package/src/index.js +87 -0
- package/src/index.js.map +1 -0
- package/src/lib/apply-mixins.d.ts +24 -0
- package/src/lib/apply-mixins.js +31 -0
- package/src/lib/apply-mixins.js.map +1 -0
- package/src/lib/array/array-copy-deep.d.ts +6 -0
- package/src/lib/array/array-copy-deep.js +25 -0
- package/src/lib/array/array-copy-deep.js.map +1 -0
- package/src/lib/array/array-copy-shallow.d.ts +19 -0
- package/src/lib/array/array-copy-shallow.js +20 -0
- package/src/lib/array/array-copy-shallow.js.map +1 -0
- package/src/lib/array/array-from-length.d.ts +18 -0
- package/src/lib/array/array-from-length.js +23 -0
- package/src/lib/array/array-from-length.js.map +1 -0
- package/src/lib/array/array-from.d.ts +24 -0
- package/src/lib/array/array-from.js +26 -0
- package/src/lib/array/array-from.js.map +1 -0
- package/src/lib/array/array-move-at-index.d.ts +24 -0
- package/src/lib/array/array-move-at-index.js +32 -0
- package/src/lib/array/array-move-at-index.js.map +1 -0
- package/src/lib/array/array-of-entries-to-object.d.ts +23 -0
- package/src/lib/array/array-of-entries-to-object.js +26 -0
- package/src/lib/array/array-of-entries-to-object.js.map +1 -0
- package/src/lib/array/array-overrides.d.ts +29 -0
- package/src/lib/array/array-overrides.js +71 -0
- package/src/lib/array/array-overrides.js.map +1 -0
- package/src/lib/array/array-push-at-index.d.ts +28 -0
- package/src/lib/array/array-push-at-index.js +32 -0
- package/src/lib/array/array-push-at-index.js.map +1 -0
- package/src/lib/array/array-remove-at-index.d.ts +23 -0
- package/src/lib/array/array-remove-at-index.js +26 -0
- package/src/lib/array/array-remove-at-index.js.map +1 -0
- package/src/lib/array/array-remove-item.d.ts +23 -0
- package/src/lib/array/array-remove-item.js +27 -0
- package/src/lib/array/array-remove-item.js.map +1 -0
- package/src/lib/array/array-safe.d.ts +21 -0
- package/src/lib/array/array-safe.js +29 -0
- package/src/lib/array/array-safe.js.map +1 -0
- package/src/lib/array/array-sort-by-deep-property.d.ts +26 -0
- package/src/lib/array/array-sort-by-deep-property.js +39 -0
- package/src/lib/array/array-sort-by-deep-property.js.map +1 -0
- package/src/lib/array/array-sort-by.d.ts +26 -0
- package/src/lib/array/array-sort-by.js +36 -0
- package/src/lib/array/array-sort-by.js.map +1 -0
- package/src/lib/array/array-update-at-index.d.ts +18 -0
- package/src/lib/array/array-update-at-index.js +22 -0
- package/src/lib/array/array-update-at-index.js.map +1 -0
- package/src/lib/array/array-update.d.ts +23 -0
- package/src/lib/array/array-update.js +25 -0
- package/src/lib/array/array-update.js.map +1 -0
- package/src/lib/bitwise/bitwise-has-all-attributes.d.ts +18 -0
- package/src/lib/bitwise/bitwise-has-all-attributes.js +21 -0
- package/src/lib/bitwise/bitwise-has-all-attributes.js.map +1 -0
- package/src/lib/bitwise/bitwise-has-attribute.d.ts +18 -0
- package/src/lib/bitwise/bitwise-has-attribute.js +21 -0
- package/src/lib/bitwise/bitwise-has-attribute.js.map +1 -0
- package/src/lib/bitwise/bitwise-has-only-attributes.d.ts +18 -0
- package/src/lib/bitwise/bitwise-has-only-attributes.js +21 -0
- package/src/lib/bitwise/bitwise-has-only-attributes.js.map +1 -0
- package/src/lib/contrast.d.ts +65 -0
- package/src/lib/contrast.js +78 -0
- package/src/lib/contrast.js.map +1 -0
- package/src/lib/copy-shallow.d.ts +19 -0
- package/src/lib/copy-shallow.js +20 -0
- package/src/lib/copy-shallow.js.map +1 -0
- package/src/lib/copy.d.ts +19 -0
- package/src/lib/copy.js +20 -0
- package/src/lib/copy.js.map +1 -0
- package/src/lib/create-chained-function.d.ts +38 -0
- package/src/lib/create-chained-function.js +46 -0
- package/src/lib/create-chained-function.js.map +1 -0
- package/src/lib/crud.d.ts +46 -0
- package/src/lib/crud.js +55 -0
- package/src/lib/crud.js.map +1 -0
- package/src/lib/css.d.ts +41 -0
- package/src/lib/css.js +54 -0
- package/src/lib/css.js.map +1 -0
- package/src/lib/escape-html.d.ts +38 -0
- package/src/lib/escape-html.js +47 -0
- package/src/lib/escape-html.js.map +1 -0
- package/src/lib/falsy.d.ts +23 -0
- package/src/lib/falsy.js +25 -0
- package/src/lib/falsy.js.map +1 -0
- package/src/lib/get-display-name.d.ts +46 -0
- package/src/lib/get-display-name.js +64 -0
- package/src/lib/get-display-name.js.map +1 -0
- package/src/lib/get-property.d.ts +30 -0
- package/src/lib/get-property.js +36 -0
- package/src/lib/get-property.js.map +1 -0
- package/src/lib/get-static-field.d.ts +23 -0
- package/src/lib/get-static-field.js +25 -0
- package/src/lib/get-static-field.js.map +1 -0
- package/src/lib/guards/index.d.ts +46 -0
- package/src/lib/guards/index.js +47 -0
- package/src/lib/guards/index.js.map +1 -0
- package/src/lib/guards/lib/_has-own-property.d.ts +24 -0
- package/src/lib/guards/lib/_has-own-property.js +27 -0
- package/src/lib/guards/lib/_has-own-property.js.map +1 -0
- package/src/lib/guards/lib/_is-arr-empty.d.ts +23 -0
- package/src/lib/guards/lib/_is-arr-empty.js +25 -0
- package/src/lib/guards/lib/_is-arr-empty.js.map +1 -0
- package/src/lib/guards/lib/_is-arr-of-arr.d.ts +25 -0
- package/src/lib/guards/lib/_is-arr-of-arr.js +31 -0
- package/src/lib/guards/lib/_is-arr-of-arr.js.map +1 -0
- package/src/lib/guards/lib/_is-arr.d.ts +21 -0
- package/src/lib/guards/lib/_is-arr.js +23 -0
- package/src/lib/guards/lib/_is-arr.js.map +1 -0
- package/src/lib/guards/lib/_is-big.d.ts +25 -0
- package/src/lib/guards/lib/_is-big.js +27 -0
- package/src/lib/guards/lib/_is-big.js.map +1 -0
- package/src/lib/guards/lib/_is-bool.d.ts +25 -0
- package/src/lib/guards/lib/_is-bool.js +27 -0
- package/src/lib/guards/lib/_is-bool.js.map +1 -0
- package/src/lib/guards/lib/_is-buff.d.ts +25 -0
- package/src/lib/guards/lib/_is-buff.js +29 -0
- package/src/lib/guards/lib/_is-buff.js.map +1 -0
- package/src/lib/guards/lib/_is-ctor.d.ts +25 -0
- package/src/lib/guards/lib/_is-ctor.js +30 -0
- package/src/lib/guards/lib/_is-ctor.js.map +1 -0
- package/src/lib/guards/lib/_is-empty-str-or-arr.d.ts +25 -0
- package/src/lib/guards/lib/_is-empty-str-or-arr.js +29 -0
- package/src/lib/guards/lib/_is-empty-str-or-arr.js.map +1 -0
- package/src/lib/guards/lib/_is-equality-same-type.d.ts +25 -0
- package/src/lib/guards/lib/_is-equality-same-type.js +33 -0
- package/src/lib/guards/lib/_is-equality-same-type.js.map +1 -0
- package/src/lib/guards/lib/_is-fn-t.d.ts +25 -0
- package/src/lib/guards/lib/_is-fn-t.js +27 -0
- package/src/lib/guards/lib/_is-fn-t.js.map +1 -0
- package/src/lib/guards/lib/_is-length-of.d.ts +47 -0
- package/src/lib/guards/lib/_is-length-of.js +49 -0
- package/src/lib/guards/lib/_is-length-of.js.map +1 -0
- package/src/lib/guards/lib/_is-length.d.ts +25 -0
- package/src/lib/guards/lib/_is-length.js +34 -0
- package/src/lib/guards/lib/_is-length.js.map +1 -0
- package/src/lib/guards/lib/_is-null.d.ts +25 -0
- package/src/lib/guards/lib/_is-null.js +27 -0
- package/src/lib/guards/lib/_is-null.js.map +1 -0
- package/src/lib/guards/lib/_is-num-neg.d.ts +25 -0
- package/src/lib/guards/lib/_is-num-neg.js +28 -0
- package/src/lib/guards/lib/_is-num-neg.js.map +1 -0
- package/src/lib/guards/lib/_is-num-pos.d.ts +25 -0
- package/src/lib/guards/lib/_is-num-pos.js +28 -0
- package/src/lib/guards/lib/_is-num-pos.js.map +1 -0
- package/src/lib/guards/lib/_is-num-t.d.ts +25 -0
- package/src/lib/guards/lib/_is-num-t.js +27 -0
- package/src/lib/guards/lib/_is-num-t.js.map +1 -0
- package/src/lib/guards/lib/_is-num-zero.d.ts +25 -0
- package/src/lib/guards/lib/_is-num-zero.js +28 -0
- package/src/lib/guards/lib/_is-num-zero.js.map +1 -0
- package/src/lib/guards/lib/_is-num.d.ts +26 -0
- package/src/lib/guards/lib/_is-num.js +29 -0
- package/src/lib/guards/lib/_is-num.js.map +1 -0
- package/src/lib/guards/lib/_is-obj-t.d.ts +26 -0
- package/src/lib/guards/lib/_is-obj-t.js +28 -0
- package/src/lib/guards/lib/_is-obj-t.js.map +1 -0
- package/src/lib/guards/lib/_is-obj.d.ts +27 -0
- package/src/lib/guards/lib/_is-obj.js +32 -0
- package/src/lib/guards/lib/_is-obj.js.map +1 -0
- package/src/lib/guards/lib/_is-prim.d.ts +27 -0
- package/src/lib/guards/lib/_is-prim.js +35 -0
- package/src/lib/guards/lib/_is-prim.js.map +1 -0
- package/src/lib/guards/lib/_is-promise-like.d.ts +24 -0
- package/src/lib/guards/lib/_is-promise-like.js +28 -0
- package/src/lib/guards/lib/_is-promise-like.js.map +1 -0
- package/src/lib/guards/lib/_is-str-empty.d.ts +25 -0
- package/src/lib/guards/lib/_is-str-empty.js +28 -0
- package/src/lib/guards/lib/_is-str-empty.js.map +1 -0
- package/src/lib/guards/lib/_is-str-t.d.ts +26 -0
- package/src/lib/guards/lib/_is-str-t.js +28 -0
- package/src/lib/guards/lib/_is-str-t.js.map +1 -0
- package/src/lib/guards/lib/_is-sym-t.d.ts +25 -0
- package/src/lib/guards/lib/_is-sym-t.js +27 -0
- package/src/lib/guards/lib/_is-sym-t.js.map +1 -0
- package/src/lib/guards/lib/_is-und-or-null.d.ts +25 -0
- package/src/lib/guards/lib/_is-und-or-null.js +29 -0
- package/src/lib/guards/lib/_is-und-or-null.js.map +1 -0
- package/src/lib/guards/lib/_is-und-t.d.ts +25 -0
- package/src/lib/guards/lib/_is-und-t.js +27 -0
- package/src/lib/guards/lib/_is-und-t.js.map +1 -0
- package/src/lib/interop-default.d.ts +18 -0
- package/src/lib/interop-default.js +21 -0
- package/src/lib/interop-default.js.map +1 -0
- package/src/lib/length.d.ts +22 -0
- package/src/lib/length.js +28 -0
- package/src/lib/length.js.map +1 -0
- package/src/lib/linear-regex.d.ts +136 -0
- package/src/lib/linear-regex.js +1140 -0
- package/src/lib/linear-regex.js.map +1 -0
- package/src/lib/no-side-effects.d.ts +29 -0
- package/src/lib/no-side-effects.js +33 -0
- package/src/lib/no-side-effects.js.map +1 -0
- package/src/lib/noop.d.ts +21 -0
- package/src/lib/noop.js +22 -0
- package/src/lib/noop.js.map +1 -0
- package/src/lib/normalized.d.ts +164 -0
- package/src/lib/normalized.js +232 -0
- package/src/lib/normalized.js.map +1 -0
- package/src/lib/number/number-from-hexadecimal.d.ts +24 -0
- package/src/lib/number/number-from-hexadecimal.js +29 -0
- package/src/lib/number/number-from-hexadecimal.js.map +1 -0
- package/src/lib/number/number-to-hexadecimal.d.ts +22 -0
- package/src/lib/number/number-to-hexadecimal.js +24 -0
- package/src/lib/number/number-to-hexadecimal.js.map +1 -0
- package/src/lib/number/to-num.d.ts +41 -0
- package/src/lib/number/to-num.js +41 -0
- package/src/lib/number/to-num.js.map +1 -0
- package/src/lib/numeronym.d.ts +41 -0
- package/src/lib/numeronym.js +54 -0
- package/src/lib/numeronym.js.map +1 -0
- package/src/lib/object/object-clone-deep.d.ts +21 -0
- package/src/lib/object/object-clone-deep.js +24 -0
- package/src/lib/object/object-clone-deep.js.map +1 -0
- package/src/lib/object/object-clone.d.ts +21 -0
- package/src/lib/object/object-clone.js +24 -0
- package/src/lib/object/object-clone.js.map +1 -0
- package/src/lib/object/object-delete-property.d.ts +28 -0
- package/src/lib/object/object-delete-property.js +32 -0
- package/src/lib/object/object-delete-property.js.map +1 -0
- package/src/lib/object/object-get-deep-property.d.ts +35 -0
- package/src/lib/object/object-get-deep-property.js +40 -0
- package/src/lib/object/object-get-deep-property.js.map +1 -0
- package/src/lib/object/object-get-keys-and-symbol-properties.d.ts +23 -0
- package/src/lib/object/object-get-keys-and-symbol-properties.js +30 -0
- package/src/lib/object/object-get-keys-and-symbol-properties.js.map +1 -0
- package/src/lib/object/object-remap.d.ts +33 -0
- package/src/lib/object/object-remap.js +36 -0
- package/src/lib/object/object-remap.js.map +1 -0
- package/src/lib/object/object-safe.d.ts +27 -0
- package/src/lib/object/object-safe.js +30 -0
- package/src/lib/object/object-safe.js.map +1 -0
- package/src/lib/object/object-set-deep-property.d.ts +35 -0
- package/src/lib/object/object-set-deep-property.js +44 -0
- package/src/lib/object/object-set-deep-property.js.map +1 -0
- package/src/lib/object/object-update.d.ts +28 -0
- package/src/lib/object/object-update.js +32 -0
- package/src/lib/object/object-update.js.map +1 -0
- package/src/lib/operator/compare.d.ts +26 -0
- package/src/lib/operator/compare.js +42 -0
- package/src/lib/operator/compare.js.map +1 -0
- package/src/lib/operator/definitions.d.ts +184 -0
- package/src/lib/operator/definitions.js +110 -0
- package/src/lib/operator/definitions.js.map +1 -0
- package/src/lib/operator/index.d.ts +19 -0
- package/src/lib/operator/index.js +20 -0
- package/src/lib/operator/index.js.map +1 -0
- package/src/lib/operator/inference.d.ts +66 -0
- package/src/lib/operator/inference.js +60 -0
- package/src/lib/operator/inference.js.map +1 -0
- package/src/lib/secret-box.d.ts +152 -0
- package/src/lib/secret-box.js +263 -0
- package/src/lib/secret-box.js.map +1 -0
- package/src/lib/serialize/base64-isomorphic-decode.d.ts +23 -0
- package/src/lib/serialize/base64-isomorphic-decode.js +28 -0
- package/src/lib/serialize/base64-isomorphic-decode.js.map +1 -0
- package/src/lib/serialize/base64-isomorphic-encode.d.ts +23 -0
- package/src/lib/serialize/base64-isomorphic-encode.js +28 -0
- package/src/lib/serialize/base64-isomorphic-encode.js.map +1 -0
- package/src/lib/serialize/json-deserialize.d.ts +25 -0
- package/src/lib/serialize/json-deserialize.js +27 -0
- package/src/lib/serialize/json-deserialize.js.map +1 -0
- package/src/lib/serialize/json-serialize.d.ts +25 -0
- package/src/lib/serialize/json-serialize.js +27 -0
- package/src/lib/serialize/json-serialize.js.map +1 -0
- package/src/lib/serialize/php-serial-deserialize-from-byte-stream.d.ts +77 -0
- package/src/lib/serialize/php-serial-deserialize-from-byte-stream.js +77 -0
- package/src/lib/serialize/php-serial-deserialize-from-byte-stream.js.map +1 -0
- package/src/lib/serialize/php-serial-is-serialized-byte-stream.d.ts +77 -0
- package/src/lib/serialize/php-serial-is-serialized-byte-stream.js +77 -0
- package/src/lib/serialize/php-serial-is-serialized-byte-stream.js.map +1 -0
- package/src/lib/serialize/php-serial-serialize-to-byte-stream.d.ts +77 -0
- package/src/lib/serialize/php-serial-serialize-to-byte-stream.js +77 -0
- package/src/lib/serialize/php-serial-serialize-to-byte-stream.js.map +1 -0
- package/src/lib/split-display-name.d.ts +36 -0
- package/src/lib/split-display-name.js +47 -0
- package/src/lib/split-display-name.js.map +1 -0
- package/src/lib/str.d.ts +21 -0
- package/src/lib/str.js +23 -0
- package/src/lib/str.js.map +1 -0
- package/src/lib/trim.d.ts +25 -0
- package/src/lib/trim.js +28 -0
- package/src/lib/trim.js.map +1 -0
- package/src/lib/truthy.d.ts +23 -0
- package/src/lib/truthy.js +30 -0
- package/src/lib/truthy.js.map +1 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* | Name | Shorthand operator | Meaning |
|
|
19
|
+
* | --- | --- | --- |
|
|
20
|
+
* | Assignment |`x = y ` |`x = y ` |
|
|
21
|
+
* | Addition assignment | `x += y` | `x = x + y ` |
|
|
22
|
+
* | Subtraction assignment | ` x -= y` | `x = x - y` |
|
|
23
|
+
* | Multiplication assignment |` x *= y` |` x = x * y ` |
|
|
24
|
+
* | Division assignment | `x /= y` | `x = x / y` |
|
|
25
|
+
* | Remainder assignment | `x %= y` | `x = x % y ` |
|
|
26
|
+
* | Exponentiation assignment | `x **= y` | `x = x ** y ` |
|
|
27
|
+
* | Left shift assignment | `x <<= y` | `x = x << y` |
|
|
28
|
+
* | Right shift assignment | `x >>= y` | `x = x >> y ` |
|
|
29
|
+
* | Unsigned right shift assignment | `x >>>= y` | `x = x >>> y ` |
|
|
30
|
+
* | Bitwise AND assignment | `x &= y` | `x = x & y` |
|
|
31
|
+
* | Bitwise XOR assignment | ` x ^= y` | `x = x ^ y `
|
|
32
|
+
* | Bitwise OR assignment | x |== y | x = x |= y |
|
|
33
|
+
* | Logical AND assignment | `x &&= y` | `x && (x = y) ` |
|
|
34
|
+
* | Logical OR assignment | x |=|== y | x |=|= (x = y) |
|
|
35
|
+
* | Logical nullish assignment | `x ??= y` | `x ?? (x = y)` |
|
|
36
|
+
*
|
|
37
|
+
* [MDN assignment operator documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators#assignment_operators)
|
|
38
|
+
*/
|
|
39
|
+
export type Assignment = '=';
|
|
40
|
+
export type AssignmentArithmeticAddition = '+=';
|
|
41
|
+
export type AssignmentArithmeticSubtraction = '-=';
|
|
42
|
+
export type AssignmentArithmeticMultiplication = '*=';
|
|
43
|
+
export type AssignmentArithmeticDivide = '/=';
|
|
44
|
+
export type AssignmentArithmeticRemainder = '%=';
|
|
45
|
+
export type AssignmentArithmeticExponentiation = '**=';
|
|
46
|
+
export type AssignmentBitwiseLeftShift = '<<=';
|
|
47
|
+
export type AssignmentBitwiseRightShift = '>>=';
|
|
48
|
+
export type AssignmentBitwiseUnsignedRightShift = '>>>=';
|
|
49
|
+
export type AssignmentBitwiseAND = '&=';
|
|
50
|
+
export type AssignmentBitwiseXOR = '^=';
|
|
51
|
+
export type AssignmentBitwiseOR = '|=';
|
|
52
|
+
export type AssignmentLogicalAND = '&&=';
|
|
53
|
+
export type AssignmentLogicalOR = '||=';
|
|
54
|
+
export type AssignmentLogicalNullish = '??=';
|
|
55
|
+
export type AssignmentOperatorArithmetic = AssignmentArithmeticAddition | AssignmentArithmeticSubtraction | AssignmentArithmeticMultiplication | AssignmentArithmeticDivide | AssignmentArithmeticRemainder | AssignmentArithmeticExponentiation;
|
|
56
|
+
export type AssignmentOperatorBitwise = AssignmentBitwiseLeftShift | AssignmentBitwiseRightShift | AssignmentBitwiseUnsignedRightShift | AssignmentBitwiseAND | AssignmentBitwiseXOR | AssignmentBitwiseOR;
|
|
57
|
+
export type AssignmentOperatorLogical = AssignmentLogicalAND | AssignmentLogicalOR | AssignmentLogicalNullish;
|
|
58
|
+
export type AssignmentOperatorAny = Assignment | AssignmentOperatorArithmetic | AssignmentOperatorBitwise | AssignmentOperatorLogical;
|
|
59
|
+
export declare enum AssigmentOperators {
|
|
60
|
+
Assignment = "=",
|
|
61
|
+
ArithmeticAddition = "+=",
|
|
62
|
+
ArithmeticSubtraction = "-=",
|
|
63
|
+
ArithmeticMultiplication = "*=",
|
|
64
|
+
ArithmeticDivide = "/=",
|
|
65
|
+
ArithmeticRemainder = "%=",
|
|
66
|
+
ArithmeticExponentiation = "**=",
|
|
67
|
+
BitwiseLeftShift = "<<=",
|
|
68
|
+
BitwiseRightShift = ">>=",
|
|
69
|
+
BitwiseUnsignedRightShift = ">>>=",
|
|
70
|
+
BitwiseAND = "&=",
|
|
71
|
+
BitwiseXOR = "^=",
|
|
72
|
+
BitwiseOR = "|=",
|
|
73
|
+
LogicalAND = "&&=",
|
|
74
|
+
LogicalOR = "||=",
|
|
75
|
+
LogicalNullish = "??="
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* | Operator | Description | Examples returning true |
|
|
79
|
+
* | --- | --- | --- |
|
|
80
|
+
* | Equal (==)| Returns true if the operands are equal. | `3 == var1`, `"3" == var1`, `3 == '3'` |
|
|
81
|
+
* | Not equal (!=)| Returns true if the operands are not equal.| `var1 != 4`, `var2 != "3"` |
|
|
82
|
+
* | Strict equal (===)| Returns true if the operands are equal and of the same type. See also Object.is and sameness in JS. | `3 === var1` |
|
|
83
|
+
* | Strict not equal (!==)| Returns true if the operands are of the same type but not equal, or are of different type.| `var1 !== "3"`, `3 !== '3'` |
|
|
84
|
+
* | Greater than (>)| Returns true if the left operand is greater than the right operand.| `var2 > var1`, `"12" > 2` |
|
|
85
|
+
* | Greater than or equal (>=) | Returns true if the left operand is greater than or equal to the right operand.| `var2 >= var1`, `var1 >= 3` |
|
|
86
|
+
* | Less than (<)| Returns true if the left operand is less than the right operand.| `var1 < var2`, `"2" < 12` |
|
|
87
|
+
* | Less than or equal (<=)| Returns true if the left operand is less than or equal to the right operand.| `var1 <= var2`, `var2 <= 5` |
|
|
88
|
+
*
|
|
89
|
+
* [MDN comparison operator documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators#comparison_operators)
|
|
90
|
+
*/
|
|
91
|
+
export type ComparisonEqual = '==';
|
|
92
|
+
export type ComparisonNotEqual = '!=';
|
|
93
|
+
export type ComparisonStrictEqual = '===';
|
|
94
|
+
export type ComparisonStrictNotEqual = '!==';
|
|
95
|
+
export type ComparisonGreaterThan = '>';
|
|
96
|
+
export type ComparisonGreaterThanOrEqual = '>=';
|
|
97
|
+
export type ComparisonLessThan = '<';
|
|
98
|
+
export type ComparisonLessThanOrEqual = '<=';
|
|
99
|
+
export type ComparisonOperatorLoose = ComparisonEqual | ComparisonNotEqual;
|
|
100
|
+
export type ComparisonOperatorStrict = ComparisonStrictEqual | ComparisonStrictNotEqual;
|
|
101
|
+
export type ComparisonOperator = ComparisonOperatorLoose | ComparisonOperatorStrict | ComparisonGreaterThan | ComparisonGreaterThanOrEqual | ComparisonLessThan | ComparisonLessThanOrEqual;
|
|
102
|
+
export declare enum ComparisonOperators {
|
|
103
|
+
Equal = "==",
|
|
104
|
+
NotEqual = "!=",
|
|
105
|
+
StrictEqual = "===",
|
|
106
|
+
StrictNotEqual = "!==",
|
|
107
|
+
GreaterThan = ">",
|
|
108
|
+
GreaterThanOrEqual = ">=",
|
|
109
|
+
LessThan = "<",
|
|
110
|
+
LessThanOrEqual = "<="
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* | Operator | Description | Example |
|
|
114
|
+
* | --- | --- | --- |
|
|
115
|
+
* | Remainder (%) | Binary operator. Returns the integer remainder of dividing the two operands. | 12 % 5 returns 2. |
|
|
116
|
+
* | Increment (++) | Unary operator. Adds one to its operand. If used as a prefix operator (++x), returns the value of its operand after adding one; if used as a postfix operator (x++), returns the value of its operand before adding one. | If x is 3, then ++x sets x to 4 and returns 4, whereas x++ returns 3 and, only then, sets x to 4. |
|
|
117
|
+
* | Decrement (--) | Unary operator. Subtracts one from its operand. The return value is analogous to that for the increment operator. | If x is 3, then --x sets x to 2 and returns 2, whereas x-- returns 3 and, only then, sets x to 2. |
|
|
118
|
+
* | Unary negation (-) | Unary operator. Returns the negation of its operand. | If x is 3, then -x returns -3. |
|
|
119
|
+
* | Unary plus (+) | Unary operator. Attempts to convert the operand to a number, if it is not already. | `+"3" returns 3.`, `+true returns 1.` |
|
|
120
|
+
* | Exponentiation operator (**) | Calculates the base to the exponent power, that is, base^exponent | `2 ** 3 returns 8.`, `10 ** -1 returns 0.1.` |
|
|
121
|
+
*
|
|
122
|
+
* [MDN arithmetic operator documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators#arithmetic_operators)
|
|
123
|
+
*/
|
|
124
|
+
export type Remainder = '%';
|
|
125
|
+
export type Increment = '++';
|
|
126
|
+
export type Decrement = '--';
|
|
127
|
+
export type UnaryPlus = '+';
|
|
128
|
+
export type UnaryNegation = '-';
|
|
129
|
+
export type Exponentiation = '**';
|
|
130
|
+
export type ArithmeticOperator = Remainder | Increment | Decrement | UnaryPlus | UnaryNegation | Exponentiation;
|
|
131
|
+
export declare enum ArithmeticOperators {
|
|
132
|
+
Remainder = "%",
|
|
133
|
+
Increment = "++",
|
|
134
|
+
Decrement = "--",
|
|
135
|
+
UnaryPlus = "+",
|
|
136
|
+
UnaryNegation = "-",
|
|
137
|
+
Exponentiation = "**"
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* | Operator | Usage | Example |
|
|
141
|
+
* | --- | --- | --- |
|
|
142
|
+
* | Bitwise AND | `a & b` | Returns a one in each bit position for which the corresponding bits of both operands are ones. |
|
|
143
|
+
* | Bitwise OR | a | b | Returns a zero in each bit position for which the corresponding bits of both operands are zeros. |
|
|
144
|
+
* | Bitwise XOR | `a ^ b` | Returns a zero in each bit position for which the corresponding bits are the same. [Returns a one in each bit position for which the corresponding bits are different.] |
|
|
145
|
+
* | Bitwise NOT | `~ a` | Inverts the bits of its operand. |
|
|
146
|
+
* | Left shift | `a << b` | Shifts a in binary representation b bits to the left, shifting in zeros from the right. |
|
|
147
|
+
* | Sign-propagating right shift | `a >> b` | Shifts a in binary representation b bits to the right, discarding bits shifted off. |
|
|
148
|
+
* | Zero-fill right shift | `a >>> b` | Shifts a in binary representation b bits to the right, discarding bits shifted off, and shifting in zeros from the left. |
|
|
149
|
+
*
|
|
150
|
+
* [MDN bitwise operator documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators#bitwise_operators)
|
|
151
|
+
*/
|
|
152
|
+
export type BitwiseAND = '&';
|
|
153
|
+
export type BitwiseOR = '|';
|
|
154
|
+
export type BitwiseXOR = '~';
|
|
155
|
+
export type BitwiseLeftShift = '<<';
|
|
156
|
+
export type BitwiseSignPropgratingRightShift = '>>';
|
|
157
|
+
export type BitwiseZeroFillRightShift = '>>>';
|
|
158
|
+
export type BitwiseOperator = BitwiseAND | BitwiseOR | BitwiseXOR | BitwiseLeftShift | BitwiseSignPropgratingRightShift | BitwiseZeroFillRightShift;
|
|
159
|
+
export declare enum BitwiseOperators {
|
|
160
|
+
AND = "&",
|
|
161
|
+
OR = "|",
|
|
162
|
+
XOR = "~",
|
|
163
|
+
LeftShift = "<<",
|
|
164
|
+
SignPropgratingRightShift = ">>",
|
|
165
|
+
ZeroFillRightShift = ">>>"
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* | Operator | Usage | Description |
|
|
169
|
+
* | --- | --- | --- |
|
|
170
|
+
* | Logical AND (&&) | expr1 && expr2 | Returns expr1 if it can be converted to false; otherwise, returns expr2. Thus, when used with Boolean values, && returns true if both operands are true; otherwise, returns false. |
|
|
171
|
+
* | Logical OR (||) | expr1 || expr2 | Returns expr1 if it can be converted to true; otherwise, returns expr2. Thus, when used with Boolean values, || returns true if either operand is true; if both are false, returns false. |
|
|
172
|
+
* | Logical NOT (!) | !expr | Returns false if its single operand that can be converted to true; otherwise, returns true. |
|
|
173
|
+
*
|
|
174
|
+
* [MDN logical operator documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators#logical_operators)
|
|
175
|
+
*/
|
|
176
|
+
export type LogicalAND = '&&';
|
|
177
|
+
export type LogicalOR = '||';
|
|
178
|
+
export type LogicalNOT = '!';
|
|
179
|
+
export type LogicalOperator = LogicalAND | LogicalOR | LogicalNOT;
|
|
180
|
+
export declare enum LogicalOperators {
|
|
181
|
+
AND = "&&",
|
|
182
|
+
OR = "||",
|
|
183
|
+
NOT = "!"
|
|
184
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ // d8888 d8b 888
|
|
17
|
+
// d88888 Y8P 888
|
|
18
|
+
// d88P888 888
|
|
19
|
+
// d88P 888 .d8888b .d8888b 888 .d88b. 88888b. 88888b.d88b. .d88b. 88888b. 888888
|
|
20
|
+
// d88P 888 88K 88K 888 d88P"88b 888 "88b 888 "888 "88b d8P Y8b 888 "88b 888
|
|
21
|
+
// d88P 888 "Y8888b. "Y8888b. 888 888 888 888 888 888 888 888 88888888 888 888 888
|
|
22
|
+
// d8888888888 X88 X88 888 Y88b 888 888 888 888 888 888 Y8b. 888 888 Y88b.
|
|
23
|
+
// d.d88888b.88 88888P' 88888P' 888 "Y88888 88888888 888 888 888 "Y8888 888 888 "Y888
|
|
24
|
+
// d88P" "Y88b 888 888
|
|
25
|
+
// 888 888 Y8b d88P 888
|
|
26
|
+
// 888 888 88888b. .d88b. 888d888Y88888b. 888888 .d88b. 888d888 .d8888b
|
|
27
|
+
// 888 888 888 "88b d8P Y8b 888P" "88b 888 d88""88b 888P" 88K
|
|
28
|
+
// 888 888 888 888 88888888 888 .d888888 888 888 888 888 "Y8888b.
|
|
29
|
+
// Y88b. .d88P 888 d88P Y8b. 888 888 888 Y88b. Y88..88P 888 X88
|
|
30
|
+
// "Y88888P" 88888P" "Y8888 888 "Y888888 "Y888 "Y88P" 888 88888P'
|
|
31
|
+
// 888
|
|
32
|
+
// 888
|
|
33
|
+
// 888
|
|
34
|
+
/**
|
|
35
|
+
* | Name | Shorthand operator | Meaning |
|
|
36
|
+
* | --- | --- | --- |
|
|
37
|
+
* | Assignment |`x = y ` |`x = y ` |
|
|
38
|
+
* | Addition assignment | `x += y` | `x = x + y ` |
|
|
39
|
+
* | Subtraction assignment | ` x -= y` | `x = x - y` |
|
|
40
|
+
* | Multiplication assignment |` x *= y` |` x = x * y ` |
|
|
41
|
+
* | Division assignment | `x /= y` | `x = x / y` |
|
|
42
|
+
* | Remainder assignment | `x %= y` | `x = x % y ` |
|
|
43
|
+
* | Exponentiation assignment | `x **= y` | `x = x ** y ` |
|
|
44
|
+
* | Left shift assignment | `x <<= y` | `x = x << y` |
|
|
45
|
+
* | Right shift assignment | `x >>= y` | `x = x >> y ` |
|
|
46
|
+
* | Unsigned right shift assignment | `x >>>= y` | `x = x >>> y ` |
|
|
47
|
+
* | Bitwise AND assignment | `x &= y` | `x = x & y` |
|
|
48
|
+
* | Bitwise XOR assignment | ` x ^= y` | `x = x ^ y `
|
|
49
|
+
* | Bitwise OR assignment | x |== y | x = x |= y |
|
|
50
|
+
* | Logical AND assignment | `x &&= y` | `x && (x = y) ` |
|
|
51
|
+
* | Logical OR assignment | x |=|== y | x |=|= (x = y) |
|
|
52
|
+
* | Logical nullish assignment | `x ??= y` | `x ?? (x = y)` |
|
|
53
|
+
*
|
|
54
|
+
* [MDN assignment operator documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators#assignment_operators)
|
|
55
|
+
*/ export var AssigmentOperators = /*#__PURE__*/ function(AssigmentOperators) {
|
|
56
|
+
AssigmentOperators["Assignment"] = "=";
|
|
57
|
+
AssigmentOperators["ArithmeticAddition"] = "+=";
|
|
58
|
+
AssigmentOperators["ArithmeticSubtraction"] = "-=";
|
|
59
|
+
AssigmentOperators["ArithmeticMultiplication"] = "*=";
|
|
60
|
+
AssigmentOperators["ArithmeticDivide"] = "/=";
|
|
61
|
+
AssigmentOperators["ArithmeticRemainder"] = "%=";
|
|
62
|
+
AssigmentOperators["ArithmeticExponentiation"] = "**=";
|
|
63
|
+
AssigmentOperators["BitwiseLeftShift"] = "<<=";
|
|
64
|
+
AssigmentOperators["BitwiseRightShift"] = ">>=";
|
|
65
|
+
AssigmentOperators["BitwiseUnsignedRightShift"] = ">>>=";
|
|
66
|
+
AssigmentOperators["BitwiseAND"] = "&=";
|
|
67
|
+
AssigmentOperators["BitwiseXOR"] = "^=";
|
|
68
|
+
AssigmentOperators["BitwiseOR"] = "|=";
|
|
69
|
+
AssigmentOperators["LogicalAND"] = "&&=";
|
|
70
|
+
AssigmentOperators["LogicalOR"] = "||=";
|
|
71
|
+
AssigmentOperators["LogicalNullish"] = "??=";
|
|
72
|
+
return AssigmentOperators;
|
|
73
|
+
}({});
|
|
74
|
+
export var ComparisonOperators = /*#__PURE__*/ function(ComparisonOperators) {
|
|
75
|
+
ComparisonOperators["Equal"] = "==";
|
|
76
|
+
ComparisonOperators["NotEqual"] = "!=";
|
|
77
|
+
ComparisonOperators["StrictEqual"] = "===";
|
|
78
|
+
ComparisonOperators["StrictNotEqual"] = "!==";
|
|
79
|
+
ComparisonOperators["GreaterThan"] = ">";
|
|
80
|
+
ComparisonOperators["GreaterThanOrEqual"] = ">=";
|
|
81
|
+
ComparisonOperators["LessThan"] = "<";
|
|
82
|
+
ComparisonOperators["LessThanOrEqual"] = "<=";
|
|
83
|
+
return ComparisonOperators;
|
|
84
|
+
}({});
|
|
85
|
+
export var ArithmeticOperators = /*#__PURE__*/ function(ArithmeticOperators) {
|
|
86
|
+
ArithmeticOperators["Remainder"] = "%";
|
|
87
|
+
ArithmeticOperators["Increment"] = "++";
|
|
88
|
+
ArithmeticOperators["Decrement"] = "--";
|
|
89
|
+
ArithmeticOperators["UnaryPlus"] = "+";
|
|
90
|
+
ArithmeticOperators["UnaryNegation"] = "-";
|
|
91
|
+
ArithmeticOperators["Exponentiation"] = "**";
|
|
92
|
+
return ArithmeticOperators;
|
|
93
|
+
}({});
|
|
94
|
+
export var BitwiseOperators = /*#__PURE__*/ function(BitwiseOperators) {
|
|
95
|
+
BitwiseOperators["AND"] = "&";
|
|
96
|
+
BitwiseOperators["OR"] = "|";
|
|
97
|
+
BitwiseOperators["XOR"] = "~";
|
|
98
|
+
BitwiseOperators["LeftShift"] = "<<";
|
|
99
|
+
BitwiseOperators["SignPropgratingRightShift"] = ">>";
|
|
100
|
+
BitwiseOperators["ZeroFillRightShift"] = ">>>";
|
|
101
|
+
return BitwiseOperators;
|
|
102
|
+
}({});
|
|
103
|
+
export var LogicalOperators = /*#__PURE__*/ function(LogicalOperators) {
|
|
104
|
+
LogicalOperators["AND"] = "&&";
|
|
105
|
+
LogicalOperators["OR"] = "||";
|
|
106
|
+
LogicalOperators["NOT"] = "!";
|
|
107
|
+
return LogicalOperators;
|
|
108
|
+
}({});
|
|
109
|
+
|
|
110
|
+
//# sourceMappingURL=definitions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/shared/util/tools/src/lib/operator/definitions.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// d8888 d8b 888\n// d88888 Y8P 888\n// d88P888 888\n// d88P 888 .d8888b .d8888b 888 .d88b. 88888b. 88888b.d88b. .d88b. 88888b. 888888\n// d88P 888 88K 88K 888 d88P\"88b 888 \"88b 888 \"888 \"88b d8P Y8b 888 \"88b 888\n// d88P 888 \"Y8888b. \"Y8888b. 888 888 888 888 888 888 888 888 88888888 888 888 888\n// d8888888888 X88 X88 888 Y88b 888 888 888 888 888 888 Y8b. 888 888 Y88b.\n// d.d88888b.88 88888P' 88888P' 888 \"Y88888 88888888 888 888 888 \"Y8888 888 888 \"Y888\n// d88P\" \"Y88b 888 888\n// 888 888 Y8b d88P 888\n// 888 888 88888b. .d88b. 888d888Y88888b. 888888 .d88b. 888d888 .d8888b\n// 888 888 888 \"88b d8P Y8b 888P\" \"88b 888 d88\"\"88b 888P\" 88K\n// 888 888 888 888 88888888 888 .d888888 888 888 888 888 \"Y8888b.\n// Y88b. .d88P 888 d88P Y8b. 888 888 888 Y88b. Y88..88P 888 X88\n// \"Y88888P\" 88888P\" \"Y8888 888 \"Y888888 \"Y888 \"Y88P\" 888 88888P'\n// 888\n// 888\n// 888\n/**\n * | Name | Shorthand operator | Meaning |\n * | --- | --- | --- |\n * | Assignment |`x = y ` |`x = y ` |\n * | Addition assignment | `x += y` | `x = x + y ` |\n * | Subtraction assignment | ` x -= y` | `x = x - y` |\n * | Multiplication assignment |` x *= y` |` x = x * y ` |\n * | Division assignment | `x /= y` | `x = x / y` |\n * | Remainder assignment | `x %= y` | `x = x % y ` |\n * | Exponentiation assignment | `x **= y` | `x = x ** y ` |\n * | Left shift assignment | `x <<= y` | `x = x << y` |\n * | Right shift assignment | `x >>= y` | `x = x >> y ` |\n * | Unsigned right shift assignment | `x >>>= y` | `x = x >>> y ` |\n * | Bitwise AND assignment | `x &= y` | `x = x & y` |\n * | Bitwise XOR assignment | ` x ^= y` | `x = x ^ y `\n * | Bitwise OR assignment | x |== y | x = x |= y |\n * | Logical AND assignment | `x &&= y` | `x && (x = y) ` |\n * | Logical OR assignment | x |=|== y | x |=|= (x = y) |\n * | Logical nullish assignment | `x ??= y` | `x ?? (x = y)` |\n *\n * [MDN assignment operator documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators#assignment_operators)\n */\n\nexport type Assignment = '='\nexport type AssignmentArithmeticAddition = '+='\nexport type AssignmentArithmeticSubtraction = '-='\nexport type AssignmentArithmeticMultiplication = '*='\nexport type AssignmentArithmeticDivide = '/='\nexport type AssignmentArithmeticRemainder = '%='\nexport type AssignmentArithmeticExponentiation = '**='\nexport type AssignmentBitwiseLeftShift = '<<='\nexport type AssignmentBitwiseRightShift = '>>='\nexport type AssignmentBitwiseUnsignedRightShift = '>>>='\nexport type AssignmentBitwiseAND = '&='\nexport type AssignmentBitwiseXOR = '^='\nexport type AssignmentBitwiseOR = '|='\nexport type AssignmentLogicalAND = '&&='\nexport type AssignmentLogicalOR = '||='\nexport type AssignmentLogicalNullish = '??='\nexport type AssignmentOperatorArithmetic =\n | AssignmentArithmeticAddition\n | AssignmentArithmeticSubtraction\n | AssignmentArithmeticMultiplication\n | AssignmentArithmeticDivide\n | AssignmentArithmeticRemainder\n | AssignmentArithmeticExponentiation\nexport type AssignmentOperatorBitwise =\n | AssignmentBitwiseLeftShift\n | AssignmentBitwiseRightShift\n | AssignmentBitwiseUnsignedRightShift\n | AssignmentBitwiseAND\n | AssignmentBitwiseXOR\n | AssignmentBitwiseOR\nexport type AssignmentOperatorLogical =\n | AssignmentLogicalAND\n | AssignmentLogicalOR\n | AssignmentLogicalNullish\nexport type AssignmentOperatorAny =\n | Assignment\n | AssignmentOperatorArithmetic\n | AssignmentOperatorBitwise\n | AssignmentOperatorLogical\n\nexport enum AssigmentOperators {\n Assignment = '=',\n ArithmeticAddition = '+=',\n ArithmeticSubtraction = '-=',\n ArithmeticMultiplication = '*=',\n ArithmeticDivide = '/=',\n ArithmeticRemainder = '%=',\n ArithmeticExponentiation = '**=',\n BitwiseLeftShift = '<<=',\n BitwiseRightShift = '>>=',\n BitwiseUnsignedRightShift = '>>>=',\n BitwiseAND = '&=',\n BitwiseXOR = '^=',\n BitwiseOR = '|=',\n LogicalAND = '&&=',\n LogicalOR = '||=',\n LogicalNullish = '??=',\n}\n\n// .d8888b. d8b\n// d88P Y88b Y8P\n// 888 888\n// 888 .d88b. 88888b.d88b. 88888b. 8888b. 888d888 888 .d8888b .d88b. 88888b.\n// 888 d88\"\"88b 888 \"888 \"88b 888 \"88b \"88b 888P\" 888 88K d88\"\"88b 888 \"88b\n// 888 888 888 888 888 888 888 888 888 .d888888 888 888 \"Y8888b. 888 888 888 888\n// Y88b d88P Y88..88P 888 888 888 888 d88P 888 888 888 888 X88 Y88..88P 888 888\n// .d88888b. \"Y88P\" 888 888 888 88888P\" \"Y888888 888 888 88888P' \"Y88P\" 888 888\n// d88P\" \"Y88b 888 888\n// 888 888 888 888\n// 888 888 88888b. .d88b. 888d888 8888b. 888888 .d88b. 888d888 .d8888b\n// 888 888 888 \"88b d8P Y8b 888P\" \"88b 888 d88\"\"88b 888P\" 88K\n// 888 888 888 888 88888888 888 .d888888 888 888 888 888 \"Y8888b.\n// Y88b. .d88P 888 d88P Y8b. 888 888 888 Y88b. Y88..88P 888 X88\n// \"Y88888P\" 88888P\" \"Y8888 888 \"Y888888 \"Y888 \"Y88P\" 888 88888P'\n// 888\n// 888\n// 888\n/**\n * | Operator | Description | Examples returning true |\n * | --- | --- | --- |\n * | Equal (==)| Returns true if the operands are equal. | `3 == var1`, `\"3\" == var1`, `3 == '3'` |\n * | Not equal (!=)| Returns true if the operands are not equal.| `var1 != 4`, `var2 != \"3\"` |\n * | Strict equal (===)| Returns true if the operands are equal and of the same type. See also Object.is and sameness in JS. | `3 === var1` |\n * | Strict not equal (!==)| Returns true if the operands are of the same type but not equal, or are of different type.| `var1 !== \"3\"`, `3 !== '3'` |\n * | Greater than (>)| Returns true if the left operand is greater than the right operand.| `var2 > var1`, `\"12\" > 2` |\n * | Greater than or equal (>=) | Returns true if the left operand is greater than or equal to the right operand.| `var2 >= var1`, `var1 >= 3` |\n * | Less than (<)| Returns true if the left operand is less than the right operand.| `var1 < var2`, `\"2\" < 12` |\n * | Less than or equal (<=)| Returns true if the left operand is less than or equal to the right operand.| `var1 <= var2`, `var2 <= 5` |\n *\n * [MDN comparison operator documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators#comparison_operators)\n */\n\nexport type ComparisonEqual = '=='\nexport type ComparisonNotEqual = '!='\nexport type ComparisonStrictEqual = '==='\nexport type ComparisonStrictNotEqual = '!=='\nexport type ComparisonGreaterThan = '>'\nexport type ComparisonGreaterThanOrEqual = '>='\nexport type ComparisonLessThan = '<'\nexport type ComparisonLessThanOrEqual = '<='\nexport type ComparisonOperatorLoose = ComparisonEqual | ComparisonNotEqual\nexport type ComparisonOperatorStrict =\n | ComparisonStrictEqual\n | ComparisonStrictNotEqual\nexport type ComparisonOperator =\n | ComparisonOperatorLoose\n | ComparisonOperatorStrict\n | ComparisonGreaterThan\n | ComparisonGreaterThanOrEqual\n | ComparisonLessThan\n | ComparisonLessThanOrEqual\n\nexport enum ComparisonOperators {\n Equal = '==',\n NotEqual = '!=',\n StrictEqual = '===',\n StrictNotEqual = '!==',\n GreaterThan = '>',\n GreaterThanOrEqual = '>=',\n LessThan = '<',\n LessThanOrEqual = '<=',\n}\n\n// d8888 d8b 888 888 888 d8b\n// d88888 Y8P 888 888 888 Y8P\n// d88P888 888 888 888\n// d88P 888 888d888 888 888888 88888b. 88888b.d88b. .d88b. 888888 888 .d8888b\n// d88P 888 888P\" 888 888 888 \"88b 888 \"888 \"88b d8P Y8b 888 888 d88P\"\n// d88P 888 888 888 888 888 888 888 888 888 88888888 888 888 888\n// d8888888888 888 888 Y88b. 888 888 888 888 888 Y8b. Y88b. 888 Y88b.\n// d.d88888b.88 888 888 \"Y888 888 888 888 8888 888 \"Y8888 \"Y888 888 \"Y8888P\n// d88P\" \"Y88b 888\n// 888 888 888\n// 888 888 88888b. .d88b. 888d888 8888b. 888888 .d88b. 888d888 .d8888b\n// 888 888 888 \"88b d8P Y8b 888P\" \"88b 888 d88\"\"88b 888P\" 88K\n// 888 888 888 888 88888888 888 .d888888 888 888 888 888 \"Y8888b.\n// Y88b. .d88P 888 d88P Y8b. 888 888 888 Y88b. Y88..88P 888 X88\n// \"Y88888P\" 88888P\" \"Y8888 888 \"Y888888 \"Y888 \"Y88P\" 888 88888P'\n// 888\n// 888\n// 888\n/**\n * | Operator | Description | Example |\n * | --- | --- | --- |\n * | Remainder (%) | Binary operator. Returns the integer remainder of dividing the two operands. | 12 % 5 returns 2. |\n * | Increment (++) | Unary operator. Adds one to its operand. If used as a prefix operator (++x), returns the value of its operand after adding one; if used as a postfix operator (x++), returns the value of its operand before adding one. | If x is 3, then ++x sets x to 4 and returns 4, whereas x++ returns 3 and, only then, sets x to 4. |\n * | Decrement (--) | Unary operator. Subtracts one from its operand. The return value is analogous to that for the increment operator. | If x is 3, then --x sets x to 2 and returns 2, whereas x-- returns 3 and, only then, sets x to 2. |\n * | Unary negation (-) | Unary operator. Returns the negation of its operand. | If x is 3, then -x returns -3. |\n * | Unary plus (+) | Unary operator. Attempts to convert the operand to a number, if it is not already. | `+\"3\" returns 3.`, `+true returns 1.` |\n * | Exponentiation operator (**) | Calculates the base to the exponent power, that is, base^exponent | `2 ** 3 returns 8.`, `10 ** -1 returns 0.1.` |\n *\n * [MDN arithmetic operator documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators#arithmetic_operators)\n */\n\nexport type Remainder = '%'\nexport type Increment = '++'\nexport type Decrement = '--'\nexport type UnaryPlus = '+'\nexport type UnaryNegation = '-'\nexport type Exponentiation = '**'\nexport type ArithmeticOperator =\n | Remainder\n | Increment\n | Decrement\n | UnaryPlus\n | UnaryNegation\n | Exponentiation\n\nexport enum ArithmeticOperators {\n Remainder = '%',\n Increment = '++',\n Decrement = '--',\n UnaryPlus = '+',\n UnaryNegation = '-',\n Exponentiation = '**',\n}\n\n//\n// 888888b. d8b 888 d8b\n// 888 \"88b Y8P 888 Y8P\n// 888 .88P 888\n// 8888888K. 888 888888 888 888 888 888 .d8888b .d88b.\n// 888 \"Y88b 888 888 888 888 888 888 88K d8P Y8b\n// 888 888 888 888 888 888 888 888 \"Y8888b. 88888888\n// 888 d88P 888 Y88b. Y88b 888 d88P 888 X88 Y8b.\n// 8.d88888b. 888 \"Y888 \"Y8888888P\" 888 88888P888\"Y8888\n// d88P\" \"Y88b 888\n// 888 888 888\n// 888 888 88888b. .d88b. 888d888 8888b. 888888 .d88b. 888d888 .d8888b\n// 888 888 888 \"88b d8P Y8b 888P\" \"88b 888 d88\"\"88b 888P\" 88K\n// 888 888 888 888 88888888 888 .d888888 888 888 888 888 \"Y8888b.\n// Y88b. .d88P 888 d88P Y8b. 888 888 888 Y88b. Y88..88P 888 X88\n// \"Y88888P\" 88888P\" \"Y8888 888 \"Y888888 \"Y888 \"Y88P\" 888 88888P'\n// 888\n// 888\n// 888\n/**\n * | Operator | Usage | Example |\n * | --- | --- | --- |\n * | Bitwise AND | `a & b` | Returns a one in each bit position for which the corresponding bits of both operands are ones. |\n * | Bitwise OR | a | b | Returns a zero in each bit position for which the corresponding bits of both operands are zeros. |\n * | Bitwise XOR | `a ^ b` | Returns a zero in each bit position for which the corresponding bits are the same. [Returns a one in each bit position for which the corresponding bits are different.] |\n * | Bitwise NOT | `~ a` | Inverts the bits of its operand. |\n * | Left shift | `a << b` | Shifts a in binary representation b bits to the left, shifting in zeros from the right. |\n * | Sign-propagating right shift | `a >> b` | Shifts a in binary representation b bits to the right, discarding bits shifted off. |\n * | Zero-fill right shift | `a >>> b` | Shifts a in binary representation b bits to the right, discarding bits shifted off, and shifting in zeros from the left. |\n *\n * [MDN bitwise operator documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators#bitwise_operators)\n */\n\nexport type BitwiseAND = '&'\nexport type BitwiseOR = '|'\nexport type BitwiseXOR = '~'\nexport type BitwiseLeftShift = '<<'\nexport type BitwiseSignPropgratingRightShift = '>>'\nexport type BitwiseZeroFillRightShift = '>>>'\nexport type BitwiseOperator =\n | BitwiseAND\n | BitwiseOR\n | BitwiseXOR\n | BitwiseLeftShift\n | BitwiseSignPropgratingRightShift\n | BitwiseZeroFillRightShift\n\nexport enum BitwiseOperators {\n AND = '&',\n OR = '|',\n XOR = '~',\n LeftShift = '<<',\n SignPropgratingRightShift = '>>',\n ZeroFillRightShift = '>>>',\n}\n\n// 888 d8b 888\n// 888 Y8P 888\n// 888 888\n// 888 .d88b. .d88b. 888 .d8888b 8888b. 888\n// 888 d88\"\"88b d88P\"88b 888 d88P\" \"88b 888\n// 888 888 888 888 888 888 888 .d888888 888\n// 888 Y88..88P Y88b 888 888 Y88b. 888 888 888\n// 8.d88888b.\"Y88P\" \"Y88888 888 \"Y8888P \"Y8888888888\n// d88P\" \"Y88b 888 888\n// 888 888 Y8b d88P 888\n// 888 888 88888b.\"Y8.d88b. 888d888 8888b. 888888 .d88b. 888d888 .d8888b\n// 888 888 888 \"88b d8P Y8b 888P\" \"88b 888 d88\"\"88b 888P\" 88K\n// 888 888 888 888 88888888 888 .d888888 888 888 888 888 \"Y8888b.\n// Y88b. .d88P 888 d88P Y8b. 888 888 888 Y88b. Y88..88P 888 X88\n// \"Y88888P\" 88888P\" \"Y8888 888 \"Y888888 \"Y888 \"Y88P\" 888 88888P'\n// 888\n// 888\n// 888\n//\n/**\n * | Operator | Usage | Description |\n * | --- | --- | --- |\n * | Logical AND (&&) | expr1 && expr2 | Returns expr1 if it can be converted to false; otherwise, returns expr2. Thus, when used with Boolean values, && returns true if both operands are true; otherwise, returns false. |\n * | Logical OR (||) | expr1 || expr2 | Returns expr1 if it can be converted to true; otherwise, returns expr2. Thus, when used with Boolean values, || returns true if either operand is true; if both are false, returns false. |\n * | Logical NOT (!) | !expr | Returns false if its single operand that can be converted to true; otherwise, returns true. |\n *\n * [MDN logical operator documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators#logical_operators)\n */\n\nexport type LogicalAND = '&&'\nexport type LogicalOR = '||'\nexport type LogicalNOT = '!'\nexport type LogicalOperator = LogicalAND | LogicalOR | LogicalNOT\n\nexport enum LogicalOperators {\n AND = '&&',\n OR = '||',\n NOT = '!',\n}\n"],"names":["AssigmentOperators","ComparisonOperators","ArithmeticOperators","BitwiseOperators","LogicalOperators"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,2FAA2F;AAC3F,2FAA2F;AAC3F,2FAA2F;AAC3F,8FAA8F;AAC9F,2FAA2F;AAC3F,2FAA2F;AAC3F,6FAA6F;AAC7F,8FAA8F;AAC9F,qDAAqD;AACrD,qDAAqD;AACrD,iFAAiF;AACjF,6EAA6E;AAC7E,kFAAkF;AAClF,kFAAkF;AAClF,kFAAkF;AAClF,kBAAkB;AAClB,kBAAkB;AAClB,kBAAkB;AAClB;;;;;;;;;;;;;;;;;;;;;CAqBC,GA0CD,OAAO,IAAA,AAAKA,4CAAAA;;;;;;;;;;;;;;;;;WAAAA;MAiBX;AAuDD,OAAO,IAAA,AAAKC,6CAAAA;;;;;;;;;WAAAA;MASX;AA+CD,OAAO,IAAA,AAAKC,6CAAAA;;;;;;;WAAAA;MAOX;AAiDD,OAAO,IAAA,AAAKC,0CAAAA;;;;;;;WAAAA;MAOX;AAoCD,OAAO,IAAA,AAAKC,0CAAAA;;;;WAAAA;MAIX"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export * from './compare';
|
|
18
|
+
export * from './definitions';
|
|
19
|
+
export * from './inference';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ export * from "./compare.js";
|
|
17
|
+
export * from "./definitions.js";
|
|
18
|
+
export * from "./inference.js";
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/shared/util/tools/src/lib/operator/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './compare'\nexport * from './definitions'\nexport * from './inference'\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,cAAc,eAAW;AACzB,cAAc,mBAAe;AAC7B,cAAc,iBAAa"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export type DataTypeFlag = {
|
|
18
|
+
bool: 0x1;
|
|
19
|
+
[0x1]: 'bool';
|
|
20
|
+
bytes: 0x2;
|
|
21
|
+
[0x2]: 'bytes';
|
|
22
|
+
coordinates: 0x3;
|
|
23
|
+
[0x3]: 'coordinates';
|
|
24
|
+
float: 0x4;
|
|
25
|
+
[0x4]: 'float';
|
|
26
|
+
int32: 0x5;
|
|
27
|
+
[0x5]: 'int32';
|
|
28
|
+
int64: 0x6;
|
|
29
|
+
[0x6]: 'int64';
|
|
30
|
+
number: 0x7;
|
|
31
|
+
[0x7]: 'number';
|
|
32
|
+
mapped: 0x8;
|
|
33
|
+
[0x8]: 'mapped';
|
|
34
|
+
nil: 0x9;
|
|
35
|
+
[0x9]: 'nil';
|
|
36
|
+
sorted: 10;
|
|
37
|
+
[0xa]: 'sorted';
|
|
38
|
+
text: 0xb;
|
|
39
|
+
[0xb]: 'text';
|
|
40
|
+
timestamp: 0xc;
|
|
41
|
+
[0xc]: 'timestamp';
|
|
42
|
+
};
|
|
43
|
+
type KeyOf<T> = keyof T;
|
|
44
|
+
export type IndexOf<T, K extends KeyOf<T> = KeyOf<T>> = T[K];
|
|
45
|
+
export type Bool = boolean;
|
|
46
|
+
export type Bytes = Uint8Array | string;
|
|
47
|
+
export type TimestampSeconds = number;
|
|
48
|
+
export type Float = number;
|
|
49
|
+
export type Int32 = number;
|
|
50
|
+
export type Int64 = number;
|
|
51
|
+
export type Number = Float | Int32 | Int64;
|
|
52
|
+
export type Null = null;
|
|
53
|
+
export type Text = string;
|
|
54
|
+
export type Coordinates = Record<'longitude' | 'latitude', number>;
|
|
55
|
+
export type Mapped<T = any, K extends string | symbol = string> = Record<K, T>;
|
|
56
|
+
export type Sorted<T = any> = T extends any[] ? never : T[];
|
|
57
|
+
export type Nestable<T = any> = Mapped<T> | Sorted<T>;
|
|
58
|
+
/**
|
|
59
|
+
* Any value data type of those seen above
|
|
60
|
+
*/
|
|
61
|
+
export type InferValueTypeAny<T extends InferValueTypeAny = any> = Bool | Bytes | Coordinates | Float | Int32 | Int64 | Mapped<T> | Null | Sorted<Exclude<T, Sorted>> | Text | TimestampSeconds;
|
|
62
|
+
/**
|
|
63
|
+
* Match Type from Tag symbol
|
|
64
|
+
*/
|
|
65
|
+
export type DataTypeInferred<Kind extends IndexOf<DataTypeFlag> | KeyOf<DataTypeFlag>> = Kind extends DataTypeFlag['bool'] ? Bool : Kind extends 'bool' ? DataTypeFlag['bool'] : Kind extends DataTypeFlag['bytes'] ? Uint8Array : Kind extends 'bytes' ? DataTypeFlag['bytes'] : Kind extends DataTypeFlag['timestamp'] ? TimestampSeconds : Kind extends 'timestamp' ? DataTypeFlag['timestamp'] : Kind extends DataTypeFlag['float'] ? Float : Kind extends 'float' ? DataTypeFlag['float'] : Kind extends DataTypeFlag['int32'] ? Int32 : Kind extends 'int32' ? DataTypeFlag['int32'] : Kind extends DataTypeFlag['int64'] ? Int64 : Kind extends 'int64' ? DataTypeFlag['int64'] : Kind extends DataTypeFlag['number'] ? Int64 : Kind extends 'number' ? DataTypeFlag['number'] : Kind extends DataTypeFlag['nil'] ? Null : Kind extends 'nil' ? DataTypeFlag['nil'] : Kind extends DataTypeFlag['text'] ? Text : Kind extends 'text' ? DataTypeFlag['text'] : Kind extends DataTypeFlag['coordinates'] ? Coordinates : Kind extends 'coordinates' ? DataTypeFlag['coordinates'] : Kind extends DataTypeFlag['mapped'] ? Mapped<InferValueTypeAny> : Kind extends 'mapped' ? DataTypeFlag['mapped'] : Kind extends DataTypeFlag['sorted'] ? Sorted<InferValueTypeAny> : Kind extends 'sorted' ? DataTypeFlag['sorted'] : never;
|
|
66
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ /**
|
|
17
|
+
* Match Type from Tag symbol
|
|
18
|
+
*/ // prettier-ignore
|
|
19
|
+
export { }; // export enum DataTypeFlag {
|
|
20
|
+
// BOOL = 0x1,
|
|
21
|
+
// BYTES = 0x2,
|
|
22
|
+
// COORDINATES = 0x3,
|
|
23
|
+
// FLOAT = 0x4,
|
|
24
|
+
// INT32 = 0x5,
|
|
25
|
+
// INT64 = 0x6,
|
|
26
|
+
// MAPPED = 0x7,
|
|
27
|
+
// NIL = 0x8,
|
|
28
|
+
// SORTED = 0x9,
|
|
29
|
+
// TEXT = 0xA,
|
|
30
|
+
// TIMESTAMP = 0xB,
|
|
31
|
+
// }
|
|
32
|
+
// export const DataTypeFlagToString: Record<DataTypeFlag, DataTypeStringValue> = {
|
|
33
|
+
// [DataTypeFlag.BOOL]: 'bool',
|
|
34
|
+
// [DataTypeFlag.BYTES]: 'bytes',
|
|
35
|
+
// [DataTypeFlag.TIMESTAMP]: 'timestamp',
|
|
36
|
+
// [DataTypeFlag.FLOAT]: 'float',
|
|
37
|
+
// [DataTypeFlag.INT32]: 'int32',
|
|
38
|
+
// [DataTypeFlag.INT64]: 'int64',
|
|
39
|
+
// [DataTypeFlag.NIL]: 'nil',
|
|
40
|
+
// [DataTypeFlag.TEXT]: 'text',
|
|
41
|
+
// [DataTypeFlag.COORDINATES]: 'coordinates',
|
|
42
|
+
// [DataTypeFlag.MAPPED]: 'mapped',
|
|
43
|
+
// [DataTypeFlag.SORTED]: 'sorted',
|
|
44
|
+
// }
|
|
45
|
+
//
|
|
46
|
+
// export const DataTypeStringToFlag: Record<DataTypeStringValue, DataTypeFlag> = {
|
|
47
|
+
// 'bool': DataTypeFlag.BOOL,
|
|
48
|
+
// 'bytes': DataTypeFlag.BYTES,
|
|
49
|
+
// 'timestamp': DataTypeFlag.TIMESTAMP,
|
|
50
|
+
// 'float': DataTypeFlag.FLOAT,
|
|
51
|
+
// 'int32': DataTypeFlag.INT32,
|
|
52
|
+
// 'int64': DataTypeFlag.INT64,
|
|
53
|
+
// 'nil': DataTypeFlag.NIL,
|
|
54
|
+
// 'text': DataTypeFlag.TEXT,
|
|
55
|
+
// 'coordinates': DataTypeFlag.COORDINATES,
|
|
56
|
+
// 'mapped': DataTypeFlag.MAPPED,
|
|
57
|
+
// 'sorted': DataTypeFlag.SORTED,
|
|
58
|
+
// }
|
|
59
|
+
|
|
60
|
+
//# sourceMappingURL=inference.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/shared/util/tools/src/lib/operator/inference.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type DataTypeFlag = {\n bool: 0x1\n [0x1]: 'bool'\n\n bytes: 0x2\n [0x2]: 'bytes'\n\n coordinates: 0x3\n [0x3]: 'coordinates'\n\n float: 0x4\n [0x4]: 'float'\n\n int32: 0x5\n [0x5]: 'int32'\n\n int64: 0x6\n [0x6]: 'int64'\n\n number: 0x7\n [0x7]: 'number'\n\n mapped: 0x8\n [0x8]: 'mapped'\n\n nil: 0x9\n [0x9]: 'nil'\n\n sorted: 10\n [0xa]: 'sorted'\n\n text: 0xb\n [0xb]: 'text'\n\n timestamp: 0xc\n [0xc]: 'timestamp'\n}\n\n/* private */\ntype KeyOf<T> = keyof T\nexport type IndexOf<T, K extends KeyOf<T> = KeyOf<T>> = T[K]\n\n/* Value data types, support same as Firestore */\nexport type Bool = boolean\nexport type Bytes = Uint8Array | string\nexport type TimestampSeconds = number\nexport type Float = number\nexport type Int32 = number\nexport type Int64 = number\nexport type Number = Float | Int32 | Int64\nexport type Null = null\nexport type Text = string\nexport type Coordinates = Record<'longitude' | 'latitude', number>\nexport type Mapped<T = any, K extends string | symbol = string> = Record<K, T>\nexport type Sorted<T = any> = T extends any[] ? never : T[]\nexport type Nestable<T = any> = Mapped<T> | Sorted<T>\n\n/**\n * Any value data type of those seen above\n */\nexport type InferValueTypeAny<T extends InferValueTypeAny = any> =\n | Bool\n | Bytes\n | Coordinates\n | Float\n | Int32\n | Int64\n | Mapped<T>\n | Null\n | Sorted<Exclude<T, Sorted>>\n | Text\n | TimestampSeconds\n\n/**\n * Match Type from Tag symbol\n */\n// prettier-ignore\nexport type DataTypeInferred<Kind extends IndexOf<DataTypeFlag> | KeyOf<DataTypeFlag>> =\n Kind extends DataTypeFlag['bool'] ? Bool\n : Kind extends 'bool' ? DataTypeFlag['bool']\n : Kind extends DataTypeFlag['bytes'] ? Uint8Array\n : Kind extends 'bytes' ? DataTypeFlag['bytes']\n : Kind extends DataTypeFlag['timestamp'] ? TimestampSeconds\n : Kind extends 'timestamp' ? DataTypeFlag['timestamp']\n : Kind extends DataTypeFlag['float'] ? Float\n : Kind extends 'float' ? DataTypeFlag['float']\n : Kind extends DataTypeFlag['int32'] ? Int32\n : Kind extends 'int32' ? DataTypeFlag['int32']\n : Kind extends DataTypeFlag['int64'] ? Int64\n : Kind extends 'int64' ? DataTypeFlag['int64']\n : Kind extends DataTypeFlag['number'] ? Int64\n : Kind extends 'number' ? DataTypeFlag['number']\n : Kind extends DataTypeFlag['nil'] ? Null\n : Kind extends 'nil' ? DataTypeFlag['nil']\n : Kind extends DataTypeFlag['text'] ? Text\n : Kind extends 'text' ? DataTypeFlag['text']\n : Kind extends DataTypeFlag['coordinates'] ? Coordinates\n : Kind extends 'coordinates' ? DataTypeFlag['coordinates']\n : Kind extends DataTypeFlag['mapped'] ? Mapped<InferValueTypeAny>\n : Kind extends 'mapped' ? DataTypeFlag['mapped']\n : Kind extends DataTypeFlag['sorted'] ? Sorted<InferValueTypeAny>\n : Kind extends 'sorted' ? DataTypeFlag['sorted']\n : never\n\n// export enum DataTypeFlag {\n// BOOL = 0x1,\n// BYTES = 0x2,\n// COORDINATES = 0x3,\n// FLOAT = 0x4,\n// INT32 = 0x5,\n// INT64 = 0x6,\n// MAPPED = 0x7,\n// NIL = 0x8,\n// SORTED = 0x9,\n// TEXT = 0xA,\n// TIMESTAMP = 0xB,\n// }\n\n// export const DataTypeFlagToString: Record<DataTypeFlag, DataTypeStringValue> = {\n// [DataTypeFlag.BOOL]: 'bool',\n// [DataTypeFlag.BYTES]: 'bytes',\n// [DataTypeFlag.TIMESTAMP]: 'timestamp',\n// [DataTypeFlag.FLOAT]: 'float',\n// [DataTypeFlag.INT32]: 'int32',\n// [DataTypeFlag.INT64]: 'int64',\n// [DataTypeFlag.NIL]: 'nil',\n// [DataTypeFlag.TEXT]: 'text',\n// [DataTypeFlag.COORDINATES]: 'coordinates',\n// [DataTypeFlag.MAPPED]: 'mapped',\n// [DataTypeFlag.SORTED]: 'sorted',\n// }\n//\n// export const DataTypeStringToFlag: Record<DataTypeStringValue, DataTypeFlag> = {\n// 'bool': DataTypeFlag.BOOL,\n// 'bytes': DataTypeFlag.BYTES,\n// 'timestamp': DataTypeFlag.TIMESTAMP,\n// 'float': DataTypeFlag.FLOAT,\n// 'int32': DataTypeFlag.INT32,\n// 'int64': DataTypeFlag.INT64,\n// 'nil': DataTypeFlag.NIL,\n// 'text': DataTypeFlag.TEXT,\n// 'coordinates': DataTypeFlag.COORDINATES,\n// 'mapped': DataTypeFlag.MAPPED,\n// 'sorted': DataTypeFlag.SORTED,\n// }\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GA2ED;;CAEC,GACD,kBAAkB;AAClB,WAyByD,CAEzD,6BAA6B;CAC7B,gBAAgB;CAChB,iBAAiB;CACjB,uBAAuB;CACvB,iBAAiB;CACjB,iBAAiB;CACjB,iBAAiB;CACjB,kBAAkB;CAClB,eAAe;CACf,kBAAkB;CAClB,gBAAgB;CAChB,qBAAqB;CACrB,IAAI;CAEJ,mFAAmF;CACnF,iCAAiC;CACjC,mCAAmC;CACnC,2CAA2C;CAC3C,mCAAmC;CACnC,mCAAmC;CACnC,mCAAmC;CACnC,+BAA+B;CAC/B,iCAAiC;CACjC,+CAA+C;CAC/C,qCAAqC;CACrC,qCAAqC;CACrC,IAAI;CACJ,EAAE;CACF,mFAAmF;CACnF,+BAA+B;CAC/B,iCAAiC;CACjC,yCAAyC;CACzC,iCAAiC;CACjC,iCAAiC;CACjC,iCAAiC;CACjC,6BAA6B;CAC7B,+BAA+B;CAC/B,6CAA6C;CAC7C,mCAAmC;CACnC,mCAAmC;CACnC,IAAI"}
|