@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,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 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 declare enum Equality {
|
|
18
|
+
STRICT = "strict",
|
|
19
|
+
LOOSE = "loose",
|
|
20
|
+
DEFAULT = "strict"
|
|
21
|
+
}
|
|
22
|
+
export declare function _isEqualitySameType<T, U extends T>(value: T, options: {
|
|
23
|
+
truthiness?: Equality;
|
|
24
|
+
} | null, ...possibilities: U[]): value is U;
|
|
25
|
+
export default _isEqualitySameType;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 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 var Equality = /*#__PURE__*/ function(Equality) {
|
|
17
|
+
Equality["STRICT"] = "strict";
|
|
18
|
+
Equality["LOOSE"] = "loose";
|
|
19
|
+
Equality["DEFAULT"] = "strict";
|
|
20
|
+
return Equality;
|
|
21
|
+
}({});
|
|
22
|
+
export function _isEqualitySameType(value, options, ...possibilities) {
|
|
23
|
+
for (const possibility of possibilities){
|
|
24
|
+
if ((options == null ? void 0 : options.truthiness) === "loose") {
|
|
25
|
+
// noinspection EqualityComparisonWithCoercionJS
|
|
26
|
+
if (possibility == value) return true;
|
|
27
|
+
} else if (possibility === value) return true;
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
export default _isEqualitySameType;
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=_is-equality-same-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../libs/shared/util/tools/src/lib/guards/lib/_is-equality-same-type.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2023 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 enum Equality {\n STRICT = 'strict',\n LOOSE = 'loose',\n DEFAULT = STRICT,\n}\n\nexport function _isEqualitySameType<T, U extends T>(\n value: T,\n options: { truthiness?: Equality } | null,\n ...possibilities: U[]\n): value is U {\n for (const possibility of possibilities) {\n if (options?.truthiness === Equality.LOOSE) {\n // noinspection EqualityComparisonWithCoercionJS\n if (possibility == value) return true\n } else if (possibility === value) return true\n }\n return false\n}\nexport default _isEqualitySameType\n"],"names":["Equality","_isEqualitySameType","value","options","possibilities","possibility","truthiness"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,OAAO,IAAA,AAAKA,kCAAAA;;;;WAAAA;MAIX;AAED,OAAO,SAASC,oBACdC,KAAQ,EACRC,OAAyC,EACzC,GAAGC,aAAkB;IAErB,KAAK,MAAMC,eAAeD,cAAe;QACvC,IAAID,CAAAA,2BAAAA,QAASG,UAAU,eAAqB;YAC1C,gDAAgD;YAChD,IAAID,eAAeH,OAAO,OAAO;QACnC,OAAO,IAAIG,gBAAgBH,OAAO,OAAO;IAC3C;IACA,OAAO;AACT;AACA,eAAeD,oBAAmB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 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
|
+
* Is literal type function
|
|
19
|
+
*
|
|
20
|
+
* @export
|
|
21
|
+
* @param {*} val
|
|
22
|
+
* @returns {val is Function}
|
|
23
|
+
*/
|
|
24
|
+
export declare function _isFnT(val: unknown): val is (...args: unknown[]) => unknown;
|
|
25
|
+
export default _isFnT;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 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
|
+
* Is literal type function
|
|
18
|
+
*
|
|
19
|
+
* @export
|
|
20
|
+
* @param {*} val
|
|
21
|
+
* @returns {val is Function}
|
|
22
|
+
*/ export function _isFnT(val) {
|
|
23
|
+
return typeof val === 'function';
|
|
24
|
+
}
|
|
25
|
+
export default _isFnT;
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=_is-fn-t.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../libs/shared/util/tools/src/lib/guards/lib/_is-fn-t.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 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/**\n * Is literal type function\n *\n * @export\n * @param {*} val\n * @returns {val is Function}\n */\nexport function _isFnT(val: unknown): val is (...args: unknown[]) => unknown {\n return typeof val === 'function'\n}\nexport default _isFnT\n"],"names":["_isFnT","val"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;CAMC,GACD,OAAO,SAASA,OAAOC,GAAY;IACjC,OAAO,OAAOA,QAAQ;AACxB;AACA,eAAeD,OAAM"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 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 HasLenOpt<U> = {
|
|
18
|
+
equalTo?: number | undefined;
|
|
19
|
+
lessThan?: number | undefined;
|
|
20
|
+
moreThan?: number | undefined;
|
|
21
|
+
and?: true | undefined;
|
|
22
|
+
also?: ((length: number, value?: U) => boolean) | undefined;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Verify the value has a length or value greater than 0 by default
|
|
26
|
+
*
|
|
27
|
+
* TODO: Document better... And refactor/cleanup.. Maybe just do away with
|
|
28
|
+
* the combination and separate out all, probably best
|
|
29
|
+
*
|
|
30
|
+
* Options:
|
|
31
|
+
* (equalTo) - val must equal to it otherwise false
|
|
32
|
+
* (lessThan) - val must be less than then it
|
|
33
|
+
* (moreThan) - val must be greater than it
|
|
34
|
+
* (lessThan & moreThan) - val must be between the two
|
|
35
|
+
* (also) - provide an additional validator
|
|
36
|
+
* (and) - provide any boolean value that may require true
|
|
37
|
+
*
|
|
38
|
+
* @export
|
|
39
|
+
* @template T
|
|
40
|
+
* @template U
|
|
41
|
+
* @param {T} val
|
|
42
|
+
* @param {HasLenOpt<U>} opts
|
|
43
|
+
* @returns {boolean}
|
|
44
|
+
*/
|
|
45
|
+
export declare function _isLengthOf<T extends Iterable<U> | ArrayLike<U> | number, U>(val: T, opts?: HasLenOpt<U>): boolean;
|
|
46
|
+
export declare function _isLengthOf<T extends Iterable<U> | ArrayLike<U> | number, U>(val: T, equalTo: number): boolean;
|
|
47
|
+
export default _isLengthOf;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2021 Aglyn LLC
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/ import { _isFnT } from "./_is-fn-t.js";
|
|
18
|
+
import { _isNum } from "./_is-num.js";
|
|
19
|
+
import { _isNumPos } from "./_is-num-pos.js";
|
|
20
|
+
import { _isObj } from "./_is-obj.js";
|
|
21
|
+
export function _isLengthOf(val, opts) {
|
|
22
|
+
const _opts = !opts || _isObj(opts) ? _extends({}, opts) : {
|
|
23
|
+
equalTo: opts
|
|
24
|
+
};
|
|
25
|
+
const { equalTo, lessThan, moreThan, and, also } = _opts != null ? _opts : {};
|
|
26
|
+
const v = _isNum(val) ? Number(val) : val;
|
|
27
|
+
const len = _isNum(v) ? v : v.length;
|
|
28
|
+
const e = equalTo;
|
|
29
|
+
const l = lessThan;
|
|
30
|
+
const m = moreThan;
|
|
31
|
+
const et = _isNum(e);
|
|
32
|
+
const lt = _isNum(l);
|
|
33
|
+
const mt = _isNum(m);
|
|
34
|
+
const noOpt = !et && !lt && !mt;
|
|
35
|
+
const chkFunc = (firstCheck)=>{
|
|
36
|
+
if (_isFnT(also)) {
|
|
37
|
+
return Boolean(and ? firstCheck && also(len, v) : firstCheck || also(len, v));
|
|
38
|
+
}
|
|
39
|
+
// !opts && console.log('has len', val, len, _isNumPos(len))
|
|
40
|
+
return firstCheck;
|
|
41
|
+
};
|
|
42
|
+
const chkOpt = (equal, less, more, chk)=>{
|
|
43
|
+
return et === equal && lt === less && mt === more && chkFunc(chk);
|
|
44
|
+
};
|
|
45
|
+
return Boolean(noOpt ? chkFunc(_isNumPos(len)) : chkOpt(true, false, false, len === e) || chkOpt(false, true, false, len < l) || chkOpt(false, false, true, len > m) || chkOpt(false, true, true, and ? len < l && len > m : len < l || len > m) || chkOpt(true, true, false, and ? len === e && len < l : len === e || len < l) || chkOpt(true, false, true, and ? len === e && len > m : len === e || len > m) || chkOpt(true, true, true, and ? len === e && len < l && len > m : len === e || len < l || len > m));
|
|
46
|
+
}
|
|
47
|
+
export default _isLengthOf;
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=_is-length-of.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../libs/shared/util/tools/src/lib/guards/lib/_is-length-of.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 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\nimport { _isFnT } from './_is-fn-t'\nimport { _isNum } from './_is-num'\nimport { _isNumPos } from './_is-num-pos'\nimport { _isObj } from './_is-obj'\n\nexport type HasLenOpt<U> = {\n equalTo?: number | undefined\n lessThan?: number | undefined\n moreThan?: number | undefined\n and?: true | undefined\n also?: ((length: number, value?: U) => boolean) | undefined\n}\n\n/**\n * Verify the value has a length or value greater than 0 by default\n *\n * TODO: Document better... And refactor/cleanup.. Maybe just do away with\n * the combination and separate out all, probably best\n *\n * Options:\n * (equalTo) - val must equal to it otherwise false\n * (lessThan) - val must be less than then it\n * (moreThan) - val must be greater than it\n * (lessThan & moreThan) - val must be between the two\n * (also) - provide an additional validator\n * (and) - provide any boolean value that may require true\n *\n * @export\n * @template T\n * @template U\n * @param {T} val\n * @param {HasLenOpt<U>} opts\n * @returns {boolean}\n */\nexport function _isLengthOf<T extends Iterable<U> | ArrayLike<U> | number, U>(\n val: T,\n opts?: HasLenOpt<U>,\n): boolean\nexport function _isLengthOf<T extends Iterable<U> | ArrayLike<U> | number, U>(\n val: T,\n equalTo: number,\n): boolean\nexport function _isLengthOf<T extends Iterable<U> | ArrayLike<U> | number, U>(\n val: T,\n opts: any,\n): boolean {\n const _opts = !opts || _isObj(opts) ? { ...opts } : { equalTo: opts }\n const { equalTo, lessThan, moreThan, and, also } = _opts ?? {}\n const v = _isNum(val)\n ? Number(val)\n : (val as unknown as Iterable<T> | ArrayLike<T>)\n const len: number = _isNum(v) ? v : (v as any).length\n const e = equalTo\n const l = lessThan\n const m = moreThan\n const et = _isNum(e)\n const lt = _isNum(l)\n const mt = _isNum(m)\n const noOpt = !et && !lt && !mt\n const chkFunc = (firstCheck: boolean): boolean => {\n if (_isFnT(also)) {\n return Boolean(\n and ? firstCheck && also(len, v) : firstCheck || also(len, v),\n )\n }\n // !opts && console.log('has len', val, len, _isNumPos(len))\n return firstCheck\n }\n const chkOpt = (\n equal: boolean,\n less: boolean,\n more: boolean,\n chk: boolean,\n ): boolean => {\n return et === equal && lt === less && mt === more && chkFunc(chk)\n }\n return Boolean(\n noOpt\n ? chkFunc(_isNumPos(len))\n : chkOpt(true, false, false, len === e) ||\n chkOpt(false, true, false, len < l) ||\n chkOpt(false, false, true, len > m) ||\n chkOpt(\n false,\n true,\n true,\n and ? len < l && len > m : len < l || len > m,\n ) ||\n chkOpt(\n true,\n true,\n false,\n and ? len === e && len < l : len === e || len < l,\n ) ||\n chkOpt(\n true,\n false,\n true,\n and ? len === e && len > m : len === e || len > m,\n ) ||\n chkOpt(\n true,\n true,\n true,\n and\n ? len === e && len < l && len > m\n : len === e || len < l || len > m,\n ),\n )\n}\nexport default _isLengthOf\n"],"names":["_isFnT","_isNum","_isNumPos","_isObj","_isLengthOf","val","opts","_opts","equalTo","lessThan","moreThan","and","also","v","Number","len","length","e","l","m","et","lt","mt","noOpt","chkFunc","firstCheck","Boolean","chkOpt","equal","less","more","chk"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,MAAM,QAAQ,gBAAY;AACnC,SAASC,MAAM,QAAQ,eAAW;AAClC,SAASC,SAAS,QAAQ,mBAAe;AACzC,SAASC,MAAM,QAAQ,eAAW;AAuClC,OAAO,SAASC,YACdC,GAAM,EACNC,IAAS;IAET,MAAMC,QAAQ,CAACD,QAAQH,OAAOG,QAAQ,aAAKA,QAAS;QAAEE,SAASF;IAAK;IACpE,MAAM,EAAEE,OAAO,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,GAAG,EAAEC,IAAI,EAAE,GAAGL,gBAAAA,QAAS,CAAC;IAC7D,MAAMM,IAAIZ,OAAOI,OACbS,OAAOT,OACNA;IACL,MAAMU,MAAcd,OAAOY,KAAKA,IAAI,AAACA,EAAUG,MAAM;IACrD,MAAMC,IAAIT;IACV,MAAMU,IAAIT;IACV,MAAMU,IAAIT;IACV,MAAMU,KAAKnB,OAAOgB;IAClB,MAAMI,KAAKpB,OAAOiB;IAClB,MAAMI,KAAKrB,OAAOkB;IAClB,MAAMI,QAAQ,CAACH,MAAM,CAACC,MAAM,CAACC;IAC7B,MAAME,UAAU,CAACC;QACf,IAAIzB,OAAOY,OAAO;YAChB,OAAOc,QACLf,MAAMc,cAAcb,KAAKG,KAAKF,KAAKY,cAAcb,KAAKG,KAAKF;QAE/D;QACA,4DAA4D;QAC5D,OAAOY;IACT;IACA,MAAME,SAAS,CACbC,OACAC,MACAC,MACAC;QAEA,OAAOX,OAAOQ,SAASP,OAAOQ,QAAQP,OAAOQ,QAAQN,QAAQO;IAC/D;IACA,OAAOL,QACLH,QACIC,QAAQtB,UAAUa,QAClBY,OAAO,MAAM,OAAO,OAAOZ,QAAQE,MACjCU,OAAO,OAAO,MAAM,OAAOZ,MAAMG,MACjCS,OAAO,OAAO,OAAO,MAAMZ,MAAMI,MACjCQ,OACE,OACA,MACA,MACAhB,MAAMI,MAAMG,KAAKH,MAAMI,IAAIJ,MAAMG,KAAKH,MAAMI,MAE9CQ,OACE,MACA,MACA,OACAhB,MAAMI,QAAQE,KAAKF,MAAMG,IAAIH,QAAQE,KAAKF,MAAMG,MAElDS,OACE,MACA,OACA,MACAhB,MAAMI,QAAQE,KAAKF,MAAMI,IAAIJ,QAAQE,KAAKF,MAAMI,MAElDQ,OACE,MACA,MACA,MACAhB,MACII,QAAQE,KAAKF,MAAMG,KAAKH,MAAMI,IAC9BJ,QAAQE,KAAKF,MAAMG,KAAKH,MAAMI;AAG9C;AACA,eAAef,YAAW"}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
import { type ComparisonOperator } from '../../operator';
|
|
18
|
+
/**
|
|
19
|
+
* Checks if the parameter has length greater than 0 or second parameter
|
|
20
|
+
* @param leftOperand
|
|
21
|
+
* @param rightOperand
|
|
22
|
+
* @param operator
|
|
23
|
+
*/
|
|
24
|
+
export declare function _isLength<T>(leftOperand: Iterable<T> | ArrayLike<T> | number, rightOperand: Iterable<T> | ArrayLike<T> | number, operator?: ComparisonOperator): boolean;
|
|
25
|
+
export default _isLength;
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
*/ import { compare } from "../../operator/index.js";
|
|
17
|
+
import { _isNum } from "./_is-num.js";
|
|
18
|
+
/**
|
|
19
|
+
* Checks if the parameter has length greater than 0 or second parameter
|
|
20
|
+
* @param leftOperand
|
|
21
|
+
* @param rightOperand
|
|
22
|
+
* @param operator
|
|
23
|
+
*/ export function _isLength(leftOperand, rightOperand, operator = '===') {
|
|
24
|
+
if (typeof leftOperand !== 'undefined') {
|
|
25
|
+
var _leftOperand_length, _rightOperand_length;
|
|
26
|
+
const left = _isNum(leftOperand) ? leftOperand : (_leftOperand_length = leftOperand['length']) != null ? _leftOperand_length : 0;
|
|
27
|
+
const right = _isNum(rightOperand) ? rightOperand : (_rightOperand_length = rightOperand['length']) != null ? _rightOperand_length : 0;
|
|
28
|
+
return compare(left, right, operator);
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
export default _isLength;
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=_is-length.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../libs/shared/util/tools/src/lib/guards/lib/_is-length.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\nimport { compare, type ComparisonOperator } from '../../operator'\nimport { _isNum } from './_is-num'\n\n\n/**\n * Checks if the parameter has length greater than 0 or second parameter\n * @param leftOperand\n * @param rightOperand\n * @param operator\n */\nexport function _isLength<T>(\n leftOperand: Iterable<T> | ArrayLike<T> | number,\n rightOperand: Iterable<T> | ArrayLike<T> | number,\n operator: ComparisonOperator = '===',\n): boolean {\n if (typeof leftOperand !== 'undefined') {\n const left = _isNum(leftOperand) ? leftOperand : (leftOperand as any)['length'] ?? 0\n const right = _isNum(rightOperand)\n ? rightOperand\n : (rightOperand as any)['length'] ?? 0\n return compare(left, right, operator)\n }\n return false\n}\n\nexport default _isLength\n"],"names":["compare","_isNum","_isLength","leftOperand","rightOperand","operator","left","right"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,OAAO,QAAiC,0BAAgB;AACjE,SAASC,MAAM,QAAQ,eAAW;AAGlC;;;;;CAKC,GACD,OAAO,SAASC,UACdC,WAAgD,EAChDC,YAAiD,EACjDC,WAA+B,KAAK;IAEpC,IAAI,OAAOF,gBAAgB,aAAa;YACW,qBAG7C;QAHJ,MAAMG,OAAOL,OAAOE,eAAeA,eAAc,sBAAA,AAACA,WAAmB,CAAC,SAAS,YAA9B,sBAAkC;QACnF,MAAMI,QAAQN,OAAOG,gBACjBA,gBACA,uBAAA,AAACA,YAAoB,CAAC,SAAS,YAA/B,uBAAmC;QACvC,OAAOJ,QAAQM,MAAMC,OAAOF;IAC9B;IACA,OAAO;AACT;AAEA,eAAeH,UAAS"}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
* Check if a value is of primitive `null` literal type. The `typeof value`
|
|
19
|
+
* value on a `null` literal will equal a string equal to `'object'`.
|
|
20
|
+
* @example
|
|
21
|
+
* // Shortcuts the following equality checks
|
|
22
|
+
* value === null && typeof value === 'object'
|
|
23
|
+
*/
|
|
24
|
+
export declare function _isNull(value: unknown): value is null;
|
|
25
|
+
export default _isNull;
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
* Check if a value is of primitive `null` literal type. The `typeof value`
|
|
18
|
+
* value on a `null` literal will equal a string equal to `'object'`.
|
|
19
|
+
* @example
|
|
20
|
+
* // Shortcuts the following equality checks
|
|
21
|
+
* value === null && typeof value === 'object'
|
|
22
|
+
*/ export function _isNull(value) {
|
|
23
|
+
return value === null && typeof value === 'object';
|
|
24
|
+
}
|
|
25
|
+
export default _isNull;
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=_is-null.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../libs/shared/util/tools/src/lib/guards/lib/_is-null.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/**\n * Check if a value is of primitive `null` literal type. The `typeof value`\n * value on a `null` literal will equal a string equal to `'object'`.\n * @example\n * // Shortcuts the following equality checks\n * value === null && typeof value === 'object'\n */\nexport function _isNull(value: unknown): value is null {\n return value === null && typeof value === 'object'\n}\nexport default _isNull\n"],"names":["_isNull","value"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;CAMC,GACD,OAAO,SAASA,QAAQC,KAAc;IACpC,OAAOA,UAAU,QAAQ,OAAOA,UAAU;AAC5C;AACA,eAAeD,QAAO"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 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
|
+
* Checks if the value is a negative number
|
|
19
|
+
*
|
|
20
|
+
* @export
|
|
21
|
+
* @param {*} val
|
|
22
|
+
* @returns {(val is number & boolean)}
|
|
23
|
+
*/
|
|
24
|
+
export declare function _isNumNeg(val: unknown): val is number & boolean;
|
|
25
|
+
export default _isNumNeg;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 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
|
+
*/ import { _isNum } from "./_is-num.js";
|
|
17
|
+
/**
|
|
18
|
+
* Checks if the value is a negative number
|
|
19
|
+
*
|
|
20
|
+
* @export
|
|
21
|
+
* @param {*} val
|
|
22
|
+
* @returns {(val is number & boolean)}
|
|
23
|
+
*/ export function _isNumNeg(val) {
|
|
24
|
+
return _isNum(val) && Number(val) < 0;
|
|
25
|
+
}
|
|
26
|
+
export default _isNumNeg;
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=_is-num-neg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../libs/shared/util/tools/src/lib/guards/lib/_is-num-neg.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 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\nimport { _isNum } from './_is-num'\n\n/**\n * Checks if the value is a negative number\n *\n * @export\n * @param {*} val\n * @returns {(val is number & boolean)}\n */\nexport function _isNumNeg(val: unknown): val is number & boolean {\n return _isNum(val) && Number(val) < 0\n}\nexport default _isNumNeg\n"],"names":["_isNum","_isNumNeg","val","Number"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,MAAM,QAAQ,eAAW;AAElC;;;;;;CAMC,GACD,OAAO,SAASC,UAAUC,GAAY;IACpC,OAAOF,OAAOE,QAAQC,OAAOD,OAAO;AACtC;AACA,eAAeD,UAAS"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 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
|
+
* Checks if the value is a positive number
|
|
19
|
+
*
|
|
20
|
+
* @export
|
|
21
|
+
* @param {*} val
|
|
22
|
+
* @returns {(val is number & boolean)}
|
|
23
|
+
*/
|
|
24
|
+
export declare function _isNumPos(val: unknown): val is number & boolean;
|
|
25
|
+
export default _isNumPos;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 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
|
+
*/ import { _isNum } from "./_is-num.js";
|
|
17
|
+
/**
|
|
18
|
+
* Checks if the value is a positive number
|
|
19
|
+
*
|
|
20
|
+
* @export
|
|
21
|
+
* @param {*} val
|
|
22
|
+
* @returns {(val is number & boolean)}
|
|
23
|
+
*/ export function _isNumPos(val) {
|
|
24
|
+
return _isNum(val) && Number(val) > 0;
|
|
25
|
+
}
|
|
26
|
+
export default _isNumPos;
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=_is-num-pos.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../libs/shared/util/tools/src/lib/guards/lib/_is-num-pos.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 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\nimport { _isNum } from './_is-num'\n\n/**\n * Checks if the value is a positive number\n *\n * @export\n * @param {*} val\n * @returns {(val is number & boolean)}\n */\nexport function _isNumPos(val: unknown): val is number & boolean {\n return _isNum(val) && Number(val) > 0\n}\nexport default _isNumPos\n"],"names":["_isNum","_isNumPos","val","Number"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,MAAM,QAAQ,eAAW;AAElC;;;;;;CAMC,GACD,OAAO,SAASC,UAAUC,GAAY;IACpC,OAAOF,OAAOE,QAAQC,OAAOD,OAAO;AACtC;AACA,eAAeD,UAAS"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 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
|
+
* Is literal type 'number'
|
|
19
|
+
*
|
|
20
|
+
* @export
|
|
21
|
+
* @param {*} val
|
|
22
|
+
* @returns {val is number}
|
|
23
|
+
*/
|
|
24
|
+
export declare function _isNumT(val: unknown): val is number;
|
|
25
|
+
export default _isNumT;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 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
|
+
* Is literal type 'number'
|
|
18
|
+
*
|
|
19
|
+
* @export
|
|
20
|
+
* @param {*} val
|
|
21
|
+
* @returns {val is number}
|
|
22
|
+
*/ export function _isNumT(val) {
|
|
23
|
+
return typeof val === 'number';
|
|
24
|
+
}
|
|
25
|
+
export default _isNumT;
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=_is-num-t.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../libs/shared/util/tools/src/lib/guards/lib/_is-num-t.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 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/**\n * Is literal type 'number'\n *\n * @export\n * @param {*} val\n * @returns {val is number}\n */\nexport function _isNumT(val: unknown): val is number {\n return typeof val === 'number'\n}\nexport default _isNumT\n"],"names":["_isNumT","val"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;CAMC,GACD,OAAO,SAASA,QAAQC,GAAY;IAClC,OAAO,OAAOA,QAAQ;AACxB;AACA,eAAeD,QAAO"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 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
|
+
* Checks if the value is a number equal to zero(0)
|
|
19
|
+
*
|
|
20
|
+
* @export
|
|
21
|
+
* @param {*} val
|
|
22
|
+
* @returns {val is 0}
|
|
23
|
+
*/
|
|
24
|
+
export declare function _isNumZero(val: unknown): val is 0;
|
|
25
|
+
export default _isNumZero;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 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
|
+
*/ import { _isNum } from "./_is-num.js";
|
|
17
|
+
/**
|
|
18
|
+
* Checks if the value is a number equal to zero(0)
|
|
19
|
+
*
|
|
20
|
+
* @export
|
|
21
|
+
* @param {*} val
|
|
22
|
+
* @returns {val is 0}
|
|
23
|
+
*/ export function _isNumZero(val) {
|
|
24
|
+
return _isNum(val) && Number(val) === 0;
|
|
25
|
+
}
|
|
26
|
+
export default _isNumZero;
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=_is-num-zero.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../libs/shared/util/tools/src/lib/guards/lib/_is-num-zero.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 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\nimport { _isNum } from './_is-num'\n\n/**\n * Checks if the value is a number equal to zero(0)\n *\n * @export\n * @param {*} val\n * @returns {val is 0}\n */\nexport function _isNumZero(val: unknown): val is 0 {\n return _isNum(val) && Number(val) === 0\n}\nexport default _isNumZero\n"],"names":["_isNum","_isNumZero","val","Number"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,MAAM,QAAQ,eAAW;AAElC;;;;;;CAMC,GACD,OAAO,SAASC,WAAWC,GAAY;IACrC,OAAOF,OAAOE,QAAQC,OAAOD,SAAS;AACxC;AACA,eAAeD,WAAU"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 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
|
+
* Is value a number, allows even if string (e.g. "6" vs 6)
|
|
19
|
+
*
|
|
20
|
+
* @export
|
|
21
|
+
* @param {*} val
|
|
22
|
+
* @param {boolean} [noStr]
|
|
23
|
+
* @returns {val is number}
|
|
24
|
+
*/
|
|
25
|
+
export declare function _isNum(val: unknown, noStr?: boolean): val is number;
|
|
26
|
+
export default _isNum;
|