@rogolev/value 0.0.3 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +319 -1
- package/docs/classes/Expect/toBe.md +61 -0
- package/docs/classes/Expect/toBeArray.md +52 -0
- package/docs/classes/Expect/toBeAssoc.md +53 -0
- package/docs/classes/Expect/toBeBigInt.md +52 -0
- package/docs/classes/Expect/toBeBool.md +53 -0
- package/docs/classes/Expect/toBeBoolean.md +53 -0
- package/docs/classes/Expect/toBeChar.md +53 -0
- package/docs/classes/Expect/toBeClass.md +53 -0
- package/docs/classes/Expect/toBeFloat.md +53 -0
- package/docs/classes/Expect/toBeFunction.md +52 -0
- package/docs/classes/Expect/toBeInfinity.md +53 -0
- package/docs/classes/Expect/toBeInt.md +53 -0
- package/docs/classes/Expect/toBeInteger.md +53 -0
- package/docs/classes/Expect/toBeList.md +53 -0
- package/docs/classes/Expect/toBeNaN.md +53 -0
- package/docs/classes/Expect/toBeNull.md +51 -0
- package/docs/classes/Expect/toBeNumber.md +52 -0
- package/docs/classes/Expect/toBeNumeric.md +53 -0
- package/docs/classes/Expect/toBeObject.md +52 -0
- package/docs/classes/Expect/toBeScalar.md +53 -0
- package/docs/classes/Expect/toBeString.md +52 -0
- package/docs/classes/Expect/toBeSymbol.md +53 -0
- package/docs/classes/Expect/toBeUndefined.md +54 -0
- package/docs/classes/Expect/toEqual.md +69 -0
- package/docs/classes/Expect/toStrictEqual.md +70 -0
- package/docs/classes/Expect.md +87 -0
- package/docs/classes/Type/expectArray.md +63 -0
- package/docs/classes/Type/expectAssoc.md +65 -0
- package/docs/classes/Type/expectBigInt.md +63 -0
- package/docs/classes/Type/expectBool.md +65 -0
- package/docs/classes/Type/expectBoolean.md +65 -0
- package/docs/classes/Type/expectChar.md +63 -0
- package/docs/classes/Type/expectClass.md +63 -0
- package/docs/classes/Type/expectFloat.md +68 -0
- package/docs/classes/Type/expectFunction.md +63 -0
- package/docs/classes/Type/expectInfinity.md +65 -0
- package/docs/classes/Type/expectInt.md +64 -0
- package/docs/classes/Type/expectInteger.md +64 -0
- package/docs/classes/Type/expectList.md +63 -0
- package/docs/classes/Type/expectNaN.md +63 -0
- package/docs/classes/Type/expectNull.md +63 -0
- package/docs/classes/Type/expectNumber.md +63 -0
- package/docs/classes/Type/expectNumeric.md +63 -0
- package/docs/classes/Type/expectObject.md +64 -0
- package/docs/classes/Type/expectScalar.md +63 -0
- package/docs/classes/Type/expectString.md +63 -0
- package/docs/classes/Type/expectSymbol.md +63 -0
- package/docs/classes/Type/expectUndefined.md +63 -0
- package/docs/classes/Type.md +101 -2
- package/docs/classes.md +2 -1
- package/docs/helpers/array/array_chunk.md +80 -0
- package/docs/helpers/array/array_chunk_with_keys.md +81 -0
- package/docs/helpers/array/array_column.md +110 -0
- package/docs/helpers/array/array_combine.md +77 -0
- package/docs/helpers/array/array_count_values.md +71 -0
- package/docs/helpers/array/array_diff.md +97 -0
- package/docs/helpers/array/array_diff_assoc.md +81 -0
- package/docs/helpers/array/array_diff_key.md +81 -0
- package/docs/helpers/array/array_diff_uassoc.md +101 -0
- package/docs/helpers/array/array_diff_ukey.md +101 -0
- package/docs/helpers/array/array_fill.md +81 -0
- package/docs/helpers/array/array_fill_keys.md +73 -0
- package/docs/helpers/array/array_filter.md +79 -0
- package/docs/helpers/array/array_flip.md +70 -0
- package/docs/helpers/array/array_index_max.md +78 -0
- package/docs/helpers/array/array_index_min.md +78 -0
- package/docs/helpers/array/array_intersect.md +91 -0
- package/docs/helpers/array/array_intersect_assoc.md +91 -0
- package/docs/helpers/array/array_intersect_key.md +91 -0
- package/docs/helpers/array/array_intersect_uassoc.md +101 -0
- package/docs/helpers/array/array_intersect_ukey.md +101 -0
- package/docs/helpers/array/array_key_exists.md +73 -0
- package/docs/helpers/array/array_key_first.md +62 -0
- package/docs/helpers/array/array_key_last.md +62 -0
- package/docs/helpers/array/array_key_to_lower_case.md +57 -0
- package/docs/helpers/array/array_key_to_upper_case.md +57 -0
- package/docs/helpers/array/array_keys.md +62 -0
- package/docs/helpers/array/array_map.md +69 -0
- package/docs/helpers/array/array_merge.md +67 -0
- package/docs/helpers/array/array_merge_recursive.md +86 -0
- package/docs/helpers/array/array_pad.md +83 -0
- package/docs/helpers/array/array_pop.md +64 -0
- package/docs/helpers/array/array_product.md +62 -0
- package/docs/helpers/array/array_push.md +57 -0
- package/docs/helpers/array/array_rand.md +99 -0
- package/docs/helpers/array/array_reduce.md +77 -0
- package/docs/helpers/array/array_replace.md +85 -0
- package/docs/helpers/array/array_replace_recursive.md +87 -0
- package/docs/helpers/array/array_reverse.md +55 -0
- package/docs/helpers/array/array_search.md +74 -0
- package/docs/helpers/array/array_shift.md +64 -0
- package/docs/helpers/array/array_slice.md +65 -0
- package/docs/helpers/array/array_splice.md +103 -0
- package/docs/helpers/array/array_sum.md +55 -0
- package/docs/helpers/array/array_udiff.md +97 -0
- package/docs/helpers/array/array_udiff_assoc.md +101 -0
- package/docs/helpers/array/array_udiff_uassoc.md +88 -0
- package/docs/helpers/array/array_uintersect.md +101 -0
- package/docs/helpers/array/array_uintersect_assoc.md +102 -0
- package/docs/helpers/array/array_uintersect_uassoc.md +135 -0
- package/docs/helpers/array/array_unique.md +54 -0
- package/docs/helpers/array/array_unshift.md +58 -0
- package/docs/helpers/array/array_values.md +54 -0
- package/docs/helpers/array/array_walk.md +87 -0
- package/docs/helpers/array/array_walk_recursive.md +93 -0
- package/docs/helpers/array/count.md +54 -0
- package/docs/helpers/array/in_array.md +65 -0
- package/docs/helpers/array/natsort.md +60 -0
- package/docs/helpers/array/range.md +76 -0
- package/docs/helpers/array/shuffle.md +74 -0
- package/docs/helpers/array/sort.md +79 -0
- package/docs/helpers/expect.md +58 -0
- package/docs/helpers/expect_array.md +63 -0
- package/docs/helpers/expect_assoc.md +65 -0
- package/docs/helpers/expect_bigint.md +63 -0
- package/docs/helpers/expect_bool.md +65 -0
- package/docs/helpers/expect_boolean.md +65 -0
- package/docs/helpers/expect_char.md +63 -0
- package/docs/helpers/expect_class.md +63 -0
- package/docs/helpers/expect_float.md +65 -0
- package/docs/helpers/expect_function.md +63 -0
- package/docs/helpers/expect_infinity.md +65 -0
- package/docs/helpers/expect_int.md +65 -0
- package/docs/helpers/expect_integer.md +65 -0
- package/docs/helpers/expect_list.md +63 -0
- package/docs/helpers/expect_nan.md +63 -0
- package/docs/helpers/expect_null.md +63 -0
- package/docs/helpers/expect_number.md +63 -0
- package/docs/helpers/expect_numeric.md +63 -0
- package/docs/helpers/expect_object.md +64 -0
- package/docs/helpers/expect_scalar.md +63 -0
- package/docs/helpers/expect_string.md +63 -0
- package/docs/helpers/expect_symbol.md +63 -0
- package/docs/helpers/expect_undefined.md +64 -0
- package/docs/helpers/is_char.md +84 -0
- package/docs/helpers/is_equal.md +75 -0
- package/docs/helpers/string/is_digit_char.md +70 -0
- package/docs/helpers/string/is_whitespace_char.md +70 -0
- package/docs/helpers/string/natcompare.md +69 -0
- package/docs/helpers/string/natcompare_numeric.md +70 -0
- package/docs/helpers.md +172 -1
- package/index.mjs +91 -1
- package/package.json +1 -1
- package/prettier.config.mjs +2 -1
- package/src/classes/Expect.mjs +1445 -0
- package/src/classes/Type.mjs +2739 -1284
- package/src/constants.mjs +83 -14
- package/src/helpers/array/array_chunk.mjs +102 -0
- package/src/helpers/array/array_chunk_with_keys.mjs +102 -0
- package/src/helpers/array/array_column.mjs +131 -0
- package/src/helpers/array/array_combine.mjs +26 -0
- package/src/helpers/array/array_count_values.mjs +82 -0
- package/src/helpers/array/array_diff.mjs +77 -0
- package/src/helpers/array/array_diff_assoc.mjs +56 -0
- package/src/helpers/array/array_diff_key.mjs +56 -0
- package/src/helpers/array/array_diff_uassoc.mjs +76 -0
- package/src/helpers/array/array_diff_ukey.mjs +71 -0
- package/src/helpers/array/array_fill.mjs +108 -0
- package/src/helpers/array/array_fill_keys.mjs +90 -0
- package/src/helpers/array/array_filter.mjs +105 -0
- package/src/helpers/array/array_flip.mjs +58 -0
- package/src/helpers/array/array_index_max.mjs +82 -0
- package/src/helpers/array/array_index_min.mjs +82 -0
- package/src/helpers/array/array_intersect.mjs +71 -0
- package/src/helpers/array/array_intersect_assoc.mjs +67 -0
- package/src/helpers/array/array_intersect_key.mjs +67 -0
- package/src/helpers/array/array_intersect_uassoc.mjs +77 -0
- package/src/helpers/array/array_intersect_ukey.mjs +72 -0
- package/src/helpers/array/array_key_exists.mjs +83 -0
- package/src/helpers/array/array_key_first.mjs +73 -0
- package/src/helpers/array/array_key_last.mjs +74 -0
- package/src/helpers/array/array_key_to_lower_case.mjs +71 -0
- package/src/helpers/array/array_key_to_upper_case.mjs +71 -0
- package/src/helpers/array/array_keys.mjs +65 -0
- package/src/helpers/array/array_map.mjs +84 -0
- package/src/helpers/array/array_merge.mjs +95 -0
- package/src/helpers/array/array_merge_recursive.mjs +153 -0
- package/src/helpers/array/array_pad.mjs +105 -0
- package/src/helpers/array/array_pop.mjs +82 -0
- package/src/helpers/array/array_product.mjs +67 -0
- package/src/helpers/array/array_push.mjs +75 -0
- package/src/helpers/array/array_rand.mjs +129 -0
- package/src/helpers/array/array_reduce.mjs +90 -0
- package/src/helpers/array/array_replace.mjs +25 -0
- package/src/helpers/array/array_replace_recursive.mjs +109 -0
- package/src/helpers/array/array_reverse.mjs +62 -0
- package/src/helpers/array/array_search.mjs +104 -0
- package/src/helpers/array/array_shift.mjs +78 -0
- package/src/helpers/array/array_slice.mjs +99 -0
- package/src/helpers/array/array_splice.mjs +218 -0
- package/src/helpers/array/array_sum.mjs +60 -0
- package/src/helpers/array/array_udiff.mjs +91 -0
- package/src/helpers/array/array_udiff_assoc.mjs +71 -0
- package/src/helpers/array/array_udiff_uassoc.mjs +124 -0
- package/src/helpers/array/array_uintersect.mjs +72 -0
- package/src/helpers/array/array_uintersect_assoc.mjs +77 -0
- package/src/helpers/array/array_uintersect_uassoc.mjs +121 -0
- package/src/helpers/array/array_unique.mjs +77 -0
- package/src/helpers/array/array_unshift.mjs +64 -0
- package/src/helpers/array/array_values.mjs +57 -0
- package/src/helpers/array/array_walk.mjs +95 -0
- package/src/helpers/array/array_walk_recursive.mjs +104 -0
- package/src/helpers/array/count.mjs +57 -0
- package/src/helpers/array/in_array.mjs +67 -0
- package/src/helpers/array/natsort.mjs +62 -0
- package/src/helpers/array/range.mjs +121 -0
- package/src/helpers/array/shuffle.mjs +73 -0
- package/src/helpers/array/sort.mjs +69 -0
- package/src/helpers/expect.mjs +44 -0
- package/src/helpers/expect_array.mjs +66 -0
- package/src/helpers/expect_assoc.mjs +66 -0
- package/src/helpers/expect_bigint.mjs +66 -0
- package/src/helpers/expect_bool.mjs +66 -0
- package/src/helpers/expect_boolean.mjs +57 -0
- package/src/helpers/expect_char.mjs +66 -0
- package/src/helpers/expect_class.mjs +66 -0
- package/src/helpers/expect_float.mjs +66 -0
- package/src/helpers/expect_function.mjs +66 -0
- package/src/helpers/expect_infinity.mjs +66 -0
- package/src/helpers/expect_int.mjs +66 -0
- package/src/helpers/expect_integer.mjs +57 -0
- package/src/helpers/expect_list.mjs +66 -0
- package/src/helpers/expect_nan.mjs +66 -0
- package/src/helpers/expect_null.mjs +66 -0
- package/src/helpers/expect_number.mjs +66 -0
- package/src/helpers/expect_numeric.mjs +66 -0
- package/src/helpers/expect_object.mjs +67 -0
- package/src/helpers/expect_scalar.mjs +66 -0
- package/src/helpers/expect_string.mjs +65 -0
- package/src/helpers/expect_symbol.mjs +66 -0
- package/src/helpers/expect_undefined.mjs +66 -0
- package/src/helpers/is_char.mjs +54 -0
- package/src/helpers/is_equal.mjs +94 -0
- package/src/helpers/string/is_digit_char.mjs +60 -0
- package/src/helpers/string/is_whitespace_char.mjs +54 -0
- package/src/helpers/string/natcompare.mjs +107 -0
- package/src/helpers/string/natcompare_numeric.mjs +131 -0
- package/tests/classes/Expect/toBe.test.mjs +60 -0
- package/tests/classes/Expect/toBeArray.test.mjs +46 -0
- package/tests/classes/Expect/toBeAssoc.test.mjs +48 -0
- package/tests/classes/Expect/toBeBigInt.test.mjs +46 -0
- package/tests/classes/Expect/toBeBool.test.mjs +48 -0
- package/tests/classes/Expect/toBeBoolean.test.mjs +48 -0
- package/tests/classes/Expect/toBeChar.test.mjs +46 -0
- package/tests/classes/Expect/toBeClass.test.mjs +48 -0
- package/tests/classes/Expect/toBeFloat.test.mjs +48 -0
- package/tests/classes/Expect/toBeFunction.test.mjs +51 -0
- package/tests/classes/Expect/toBeInfinity.test.mjs +48 -0
- package/tests/classes/Expect/toBeInt.test.mjs +48 -0
- package/tests/classes/Expect/toBeInteger.test.mjs +48 -0
- package/tests/classes/Expect/toBeList.test.mjs +46 -0
- package/tests/classes/Expect/toBeNaN.test.mjs +46 -0
- package/tests/classes/Expect/toBeNull.test.mjs +46 -0
- package/tests/classes/Expect/toBeNumber.test.mjs +46 -0
- package/tests/classes/Expect/toBeNumeric.test.mjs +53 -0
- package/tests/classes/Expect/toBeObject.test.mjs +47 -0
- package/tests/classes/Expect/toBeScalar.test.mjs +63 -0
- package/tests/classes/Expect/toBeString.test.mjs +46 -0
- package/tests/classes/Expect/toBeSymbol.test.mjs +46 -0
- package/tests/classes/Expect/toBeUndefined.test.mjs +50 -0
- package/tests/classes/Expect/toEqual.test.mjs +66 -0
- package/tests/classes/Expect/toStrictEqual.test.mjs +73 -0
- package/tests/classes/Type.test.mjs +1320 -1262
- package/tests/helpers/array/array_chunk.test.mjs +49 -0
- package/tests/helpers/array/array_chunk_with_keys.test.mjs +45 -0
- package/tests/helpers/array/array_column.test.mjs +87 -0
- package/tests/helpers/array/array_combine.test.mjs +41 -0
- package/tests/helpers/array/array_count_values.test.mjs +40 -0
- package/tests/helpers/array/array_diff.test.mjs +78 -0
- package/tests/helpers/array/array_diff_assoc.test.mjs +64 -0
- package/tests/helpers/array/array_diff_key.test.mjs +64 -0
- package/tests/helpers/array/array_diff_uassoc.test.mjs +73 -0
- package/tests/helpers/array/array_diff_ukey.test.mjs +77 -0
- package/tests/helpers/array/array_fill.test.mjs +47 -0
- package/tests/helpers/array/array_fill_keys.test.mjs +35 -0
- package/tests/helpers/array/array_filter.test.mjs +38 -0
- package/tests/helpers/array/array_flip.test.mjs +33 -0
- package/tests/helpers/array/array_index_max.test.mjs +41 -0
- package/tests/helpers/array/array_index_min.test.mjs +41 -0
- package/tests/helpers/array/array_intersect.test.mjs +65 -0
- package/tests/helpers/array/array_intersect_assoc.test.mjs +65 -0
- package/tests/helpers/array/array_intersect_key.test.mjs +65 -0
- package/tests/helpers/array/array_intersect_uassoc.test.mjs +76 -0
- package/tests/helpers/array/array_intersect_ukey.test.mjs +74 -0
- package/tests/helpers/array/array_key_exists.test.mjs +36 -0
- package/tests/helpers/array/array_key_first.test.mjs +29 -0
- package/tests/helpers/array/array_key_last.test.mjs +29 -0
- package/tests/helpers/array/array_key_to_lower_case.test.mjs +23 -0
- package/tests/helpers/array/array_key_to_upper_case.test.mjs +23 -0
- package/tests/helpers/array/array_keys.test.mjs +27 -0
- package/tests/helpers/array/array_map.test.mjs +32 -0
- package/tests/helpers/array/array_merge.test.mjs +37 -0
- package/tests/helpers/array/array_merge_recursive.test.mjs +65 -0
- package/tests/helpers/array/array_pad.test.mjs +48 -0
- package/tests/helpers/array/array_pop.test.mjs +29 -0
- package/tests/helpers/array/array_product.test.mjs +33 -0
- package/tests/helpers/array/array_push.test.mjs +31 -0
- package/tests/helpers/array/array_rand.test.mjs +59 -0
- package/tests/helpers/array/array_reduce.test.mjs +44 -0
- package/tests/helpers/array/array_replace.test.mjs +46 -0
- package/tests/helpers/array/array_replace_recursive.test.mjs +46 -0
- package/tests/helpers/array/array_reverse.test.mjs +31 -0
- package/tests/helpers/array/array_search.test.mjs +48 -0
- package/tests/helpers/array/array_shift.test.mjs +29 -0
- package/tests/helpers/array/array_slice.test.mjs +49 -0
- package/tests/helpers/array/array_splice.test.mjs +67 -0
- package/tests/helpers/array/array_sum.test.mjs +27 -0
- package/tests/helpers/array/array_udiff.test.mjs +95 -0
- package/tests/helpers/array/array_udiff_assoc.test.mjs +77 -0
- package/tests/helpers/array/array_udiff_uassoc.test.mjs +89 -0
- package/tests/helpers/array/array_uintersect.test.mjs +78 -0
- package/tests/helpers/array/array_uintersect_assoc.test.mjs +80 -0
- package/tests/helpers/array/array_uintersect_uassoc.test.mjs +122 -0
- package/tests/helpers/array/array_unique.test.mjs +27 -0
- package/tests/helpers/array/array_unshift.test.mjs +31 -0
- package/tests/helpers/array/array_values.test.mjs +27 -0
- package/tests/helpers/array/array_walk.test.mjs +48 -0
- package/tests/helpers/array/array_walk_recursive.test.mjs +53 -0
- package/tests/helpers/array/count.test.mjs +27 -0
- package/tests/helpers/array/in_array.test.mjs +52 -0
- package/tests/helpers/array/natsort.test.mjs +71 -0
- package/tests/helpers/array/range.test.mjs +51 -0
- package/tests/helpers/array/shuffle.test.mjs +42 -0
- package/tests/helpers/array/sort.test.mjs +60 -0
- package/tests/helpers/array.test.mjs +58 -58
- package/tests/helpers/expect.test.mjs +95 -0
- package/tests/helpers/expect_array.test.mjs +71 -0
- package/tests/helpers/expect_assoc.test.mjs +61 -0
- package/tests/helpers/expect_bigint.test.mjs +63 -0
- package/tests/helpers/expect_bool.test.mjs +59 -0
- package/tests/helpers/expect_boolean.test.mjs +61 -0
- package/tests/helpers/expect_char.test.mjs +63 -0
- package/tests/helpers/expect_class.test.mjs +64 -0
- package/tests/helpers/expect_float.test.mjs +64 -0
- package/tests/helpers/expect_function.test.mjs +65 -0
- package/tests/helpers/expect_infinity.test.mjs +62 -0
- package/tests/helpers/expect_int.test.mjs +57 -0
- package/tests/helpers/expect_integer.test.mjs +59 -0
- package/tests/helpers/expect_list.test.mjs +73 -0
- package/tests/helpers/expect_nan.test.mjs +57 -0
- package/tests/helpers/expect_null.test.mjs +57 -0
- package/tests/helpers/expect_number.test.mjs +57 -0
- package/tests/helpers/expect_numeric.test.mjs +57 -0
- package/tests/helpers/expect_object.test.mjs +63 -0
- package/tests/helpers/expect_scalar.test.mjs +72 -0
- package/tests/helpers/expect_string.test.mjs +65 -0
- package/tests/helpers/expect_symbol.test.mjs +66 -0
- package/tests/helpers/expect_undefined.test.mjs +59 -0
- package/tests/helpers/is_char.test.mjs +40 -0
- package/tests/helpers/is_equal.test.mjs +110 -0
- package/tests/helpers/string/is_digit_char.test.mjs +32 -0
- package/tests/helpers/string/is_whitespace_char.test.mjs +32 -0
- package/tests/helpers/string/natcompare.test.mjs +100 -0
- package/tests/helpers/string/natcompare_numeric.test.mjs +110 -0
@@ -0,0 +1,70 @@
|
|
1
|
+
[Главная](../../../README.md) / [Помощники](../../helpers.md) / is_digit_char
|
2
|
+
|
3
|
+
[Исходный код](../../../src/helpers/string/is_digit_char.mjs)
|
4
|
+
|
5
|
+
# is_digit_char
|
6
|
+
|
7
|
+
`is_digit_char` — Проверяет, является ли символ цифрой.
|
8
|
+
|
9
|
+
## Сигнатура функции
|
10
|
+
|
11
|
+
```ts
|
12
|
+
function is_digit_char(value: any): boolean;
|
13
|
+
```
|
14
|
+
|
15
|
+
## Описание
|
16
|
+
|
17
|
+
Функция `is_digit_char` используется для проверки, является ли переданный символ цифрой. Цифровыми
|
18
|
+
символами считаются символы с кодами от 48 до 57 включительно.
|
19
|
+
|
20
|
+
## Параметры
|
21
|
+
|
22
|
+
- `value` (any): Символ для проверки.
|
23
|
+
|
24
|
+
## Возвращаемое значение
|
25
|
+
|
26
|
+
Возвращает `true`, если символ является цифрой, иначе `false`.
|
27
|
+
|
28
|
+
## Примеры использования
|
29
|
+
|
30
|
+
1. Проверка цифрового символа:
|
31
|
+
|
32
|
+
```js
|
33
|
+
const result = is_digit_char('5');
|
34
|
+
console.log(result); // true
|
35
|
+
```
|
36
|
+
|
37
|
+
2. Проверка непробельного символа:
|
38
|
+
|
39
|
+
```js
|
40
|
+
const result = is_digit_char('a');
|
41
|
+
console.log(result); // false
|
42
|
+
```
|
43
|
+
|
44
|
+
3. Проверка пустой строки:
|
45
|
+
|
46
|
+
```js
|
47
|
+
const result = is_digit_char('');
|
48
|
+
console.log(result); // false
|
49
|
+
```
|
50
|
+
|
51
|
+
4. Проверка строки из нескольких символов:
|
52
|
+
|
53
|
+
```js
|
54
|
+
const result = is_digit_char('123');
|
55
|
+
console.log(result); // false
|
56
|
+
```
|
57
|
+
|
58
|
+
5. Проверка символа табуляции:
|
59
|
+
|
60
|
+
```js
|
61
|
+
const result = is_digit_char('\t');
|
62
|
+
console.log(result); // false
|
63
|
+
```
|
64
|
+
|
65
|
+
6. Проверка символа новой строки:
|
66
|
+
|
67
|
+
```js
|
68
|
+
const result = is_digit_char('\n');
|
69
|
+
console.log(result); // false
|
70
|
+
```
|
@@ -0,0 +1,70 @@
|
|
1
|
+
[Главная](../../../README.md) / [Помощники](../../helpers.md) / is_whitespace_char
|
2
|
+
|
3
|
+
[Исходный код](../../../src/helpers/string/is_whitespace_char.mjs)
|
4
|
+
|
5
|
+
# is_whitespace_char
|
6
|
+
|
7
|
+
`is_whitespace_char` — Проверяет, является ли символ пробельным.
|
8
|
+
|
9
|
+
## Сигнатура функции
|
10
|
+
|
11
|
+
```ts
|
12
|
+
function is_whitespace_char(value: any): boolean;
|
13
|
+
```
|
14
|
+
|
15
|
+
## Описание
|
16
|
+
|
17
|
+
Функция `is_whitespace_char` используется для проверки, является ли переданный символ пробельным.
|
18
|
+
Пробельными символами считаются символы с кодами от 0 до 32 включительно.
|
19
|
+
|
20
|
+
## Параметры
|
21
|
+
|
22
|
+
- `value` (any): Символ для проверки.
|
23
|
+
|
24
|
+
## Возвращаемое значение
|
25
|
+
|
26
|
+
Возвращает `true`, если символ является пробельным, иначе `false`.
|
27
|
+
|
28
|
+
## Примеры использования
|
29
|
+
|
30
|
+
1. Проверка пробельного символа:
|
31
|
+
|
32
|
+
```js
|
33
|
+
const result = is_whitespace_char(' ');
|
34
|
+
console.log(result); // true
|
35
|
+
```
|
36
|
+
|
37
|
+
2. Проверка непробельного символа:
|
38
|
+
|
39
|
+
```js
|
40
|
+
const result = is_whitespace_char('a');
|
41
|
+
console.log(result); // false
|
42
|
+
```
|
43
|
+
|
44
|
+
3. Проверка пустой строки:
|
45
|
+
|
46
|
+
```js
|
47
|
+
const result = is_whitespace_char('');
|
48
|
+
console.log(result); // false
|
49
|
+
```
|
50
|
+
|
51
|
+
4. Проверка строки из нескольких символов:
|
52
|
+
|
53
|
+
```js
|
54
|
+
const result = is_whitespace_char('abc');
|
55
|
+
console.log(result); // false
|
56
|
+
```
|
57
|
+
|
58
|
+
5. Проверка символа табуляции:
|
59
|
+
|
60
|
+
```js
|
61
|
+
const result = is_whitespace_char('\t');
|
62
|
+
console.log(result); // true
|
63
|
+
```
|
64
|
+
|
65
|
+
6. Проверка символа новой строки:
|
66
|
+
|
67
|
+
```js
|
68
|
+
const result = is_whitespace_char('\n');
|
69
|
+
console.log(result); // true
|
70
|
+
```
|
@@ -0,0 +1,69 @@
|
|
1
|
+
[Главная](../../../README.md) / [Помощники](../../helpers.md) / natcompare
|
2
|
+
|
3
|
+
[Исходный код](../../../src/helpers/string/natcompare.mjs)
|
4
|
+
|
5
|
+
# natcompare
|
6
|
+
|
7
|
+
`natcompare` — Сравнивает две строки в естественном порядке.
|
8
|
+
|
9
|
+
## Сигнатура функции
|
10
|
+
|
11
|
+
```ts
|
12
|
+
function natcompare(a: string, b: string): number;
|
13
|
+
```
|
14
|
+
|
15
|
+
## Описание
|
16
|
+
|
17
|
+
Функция `natcompare` используется для сравнения двух строк в естественном порядке. Она поддерживает
|
18
|
+
строки с ведущими нулями и пробелами и игнорирует их при сравнении.
|
19
|
+
|
20
|
+
## Параметры
|
21
|
+
|
22
|
+
- `a` (string): Первая строка для сравнения.
|
23
|
+
- `b` (string): Вторая строка для сравнения.
|
24
|
+
|
25
|
+
## Возвращаемое значение
|
26
|
+
|
27
|
+
Возвращает отрицательное значение, если `a` меньше `b`, ноль, если `a` равно `b`, и положительное
|
28
|
+
значение, если `a` больше `b`.
|
29
|
+
|
30
|
+
## Примеры использования
|
31
|
+
|
32
|
+
1. Сравнение строк с числовыми значениями:
|
33
|
+
|
34
|
+
```js
|
35
|
+
const result = natcompare('10', '2');
|
36
|
+
console.log(result); // 1
|
37
|
+
```
|
38
|
+
|
39
|
+
2. Сравнение строк с ведущими нулями:
|
40
|
+
|
41
|
+
```js
|
42
|
+
const result = natcompare('0010', '10');
|
43
|
+
console.log(result); // 0
|
44
|
+
```
|
45
|
+
|
46
|
+
3. Сравнение строк с пробелами:
|
47
|
+
|
48
|
+
```js
|
49
|
+
const result = natcompare(' 10', '10');
|
50
|
+
console.log(result); // 0
|
51
|
+
```
|
52
|
+
|
53
|
+
4. Сравнение строк с буквами и числами:
|
54
|
+
|
55
|
+
```js
|
56
|
+
const result = natcompare('a10', 'a2');
|
57
|
+
console.log(result); // 1
|
58
|
+
```
|
59
|
+
|
60
|
+
5. Сравнение строк с разными символами:
|
61
|
+
|
62
|
+
```js
|
63
|
+
const result = natcompare('10-', '10+');
|
64
|
+
console.log(result); // 1
|
65
|
+
```
|
66
|
+
|
67
|
+
## Исключения
|
68
|
+
|
69
|
+
- `TypeError`: Если параметры не являются строками.
|
@@ -0,0 +1,70 @@
|
|
1
|
+
[Главная](../../../README.md) / [Помощники](../../helpers.md) / natcompare_numeric
|
2
|
+
|
3
|
+
[Исходный код](../../../src/helpers/string/natcompare_numeric.mjs)
|
4
|
+
|
5
|
+
# natcompare_numeric
|
6
|
+
|
7
|
+
`natcompare_numeric` — Сравнивает две строки, содержащие числовые значения, в естественном
|
8
|
+
порядке.
|
9
|
+
|
10
|
+
## Сигнатура функции
|
11
|
+
|
12
|
+
```ts
|
13
|
+
function natcompare_numeric(a: string, b: string): number;
|
14
|
+
```
|
15
|
+
|
16
|
+
## Описание
|
17
|
+
|
18
|
+
Функция `natcompare_numeric` используется для сравнения двух строк, содержащих числовые значения, в
|
19
|
+
естественном порядке. Она поддерживает строки с ведущими нулями и игнорирует их при сравнении.
|
20
|
+
|
21
|
+
## Параметры
|
22
|
+
|
23
|
+
- `a` (string): Первая строка для сравнения.
|
24
|
+
- `b` (string): Вторая строка для сравнения.
|
25
|
+
|
26
|
+
## Возвращаемое значение
|
27
|
+
|
28
|
+
Возвращает отрицательное значение, если `a` меньше `b`, ноль, если `a` равно `b`, и положительное
|
29
|
+
значение, если `a` больше `b`.
|
30
|
+
|
31
|
+
## Примеры использования
|
32
|
+
|
33
|
+
1. Сравнение строк с числовыми значениями:
|
34
|
+
|
35
|
+
```js
|
36
|
+
const result = natcompare_numeric('10', '2');
|
37
|
+
console.log(result); // 1
|
38
|
+
```
|
39
|
+
|
40
|
+
2. Сравнение строк с ведущими нулями:
|
41
|
+
|
42
|
+
```js
|
43
|
+
const result = natcompare_numeric('0010', '10');
|
44
|
+
console.log(result); // 0
|
45
|
+
```
|
46
|
+
|
47
|
+
3. Сравнение строк с пробелами:
|
48
|
+
|
49
|
+
```js
|
50
|
+
const result = natcompare_numeric(' 10', '10');
|
51
|
+
console.log(result); // 0
|
52
|
+
```
|
53
|
+
|
54
|
+
4. Сравнение строк с буквами и числами:
|
55
|
+
|
56
|
+
```js
|
57
|
+
const result = natcompare_numeric('a10', 'a2');
|
58
|
+
console.log(result); // 1
|
59
|
+
```
|
60
|
+
|
61
|
+
5. Сравнение строк с разными символами:
|
62
|
+
|
63
|
+
```js
|
64
|
+
const result = natcompare_numeric('10-', '10+');
|
65
|
+
console.log(result); // 0
|
66
|
+
```
|
67
|
+
|
68
|
+
## Исключения
|
69
|
+
|
70
|
+
- `TypeError`: Если параметры не являются строками.
|
package/docs/helpers.md
CHANGED
@@ -1,10 +1,58 @@
|
|
1
1
|
[Главная](../README.md) / Помощники
|
2
2
|
|
3
|
-
# Помощники
|
3
|
+
# Помощники
|
4
|
+
|
5
|
+
## Помощники для работы с типами данных
|
4
6
|
|
5
7
|
- [array](./helpers/array.md) — Создаёт массив из переданных значений, обрабатывая
|
6
8
|
ассоциативные массивы (объекты с ключами).
|
7
9
|
- [empty](./helpers/empty.md) — Проверяет, является ли переменная пустой.
|
10
|
+
- [expect_array](./helpers/expect_array.md) — Проверяет, является ли значение массивом, и
|
11
|
+
выбрасывает ошибку с указанным сообщением, если это не так.
|
12
|
+
- [expect_assoc](./helpers/expect_assoc.md) — Проверяет, является ли значение ассоциативным
|
13
|
+
массивом, и выбрасывает ошибку с указанным сообщением, если это не так.
|
14
|
+
- [expect_bigint](./helpers/expect_bigint.md) — Проверяет, является ли значение BigInt, и
|
15
|
+
выбрасывает ошибку с указанным сообщением, если это не так.
|
16
|
+
- [expect_bool](./helpers/expect_bool.md) — Проверяет, является ли значение логическим типом,
|
17
|
+
и выбрасывает ошибку с указанным сообщением, если это не так.
|
18
|
+
- [expect_boolean](./helpers/expect_boolean.md) — Проверяет, является ли значение логическим
|
19
|
+
типом, и выбрасывает ошибку с указанным сообщением, если это не так.
|
20
|
+
- [expect_char](./helpers/expect_char.md) — Проверяет, является ли значение символом, и
|
21
|
+
выбрасывает ошибку с указанным сообщением, если это не так.
|
22
|
+
- [expect_class](./helpers/expect_class.md) — Проверяет, является ли значение классом, и
|
23
|
+
выбрасывает ошибку с указанным сообщением, если это не так.
|
24
|
+
- [expect_float](./helpers/expect_float.md) — Проверяет, является ли значение числом с
|
25
|
+
плавающей запятой, и выбрасывает ошибку с указанным сообщением, если это не так.
|
26
|
+
- [expect_function](./helpers/expect_function.md) — Проверяет, является ли значение функцией,
|
27
|
+
и выбрасывает ошибку с указанным сообщением, если это не так.
|
28
|
+
- [expect_infinity](./helpers/expect_infinity.md) — Проверяет, является ли значение
|
29
|
+
бесконечностью, и выбрасывает ошибку с указанным сообщением, если это не так.
|
30
|
+
- [expect_int](./helpers/expect_int.md) — Проверяет, является ли значение целым числом, и
|
31
|
+
выбрасывает ошибку с указанным сообщением, если это не так.
|
32
|
+
- [expect_integer](./helpers/expect_integer.md) — Проверяет, является ли значение целым
|
33
|
+
числом, и выбрасывает ошибку с указанным сообщением, если это не так.
|
34
|
+
- [expect_list](./helpers/expect_list.md) — Проверяет, является ли значение списком, и
|
35
|
+
выбрасывает ошибку с указанным сообщением, если это не так.
|
36
|
+
- [expect_nan](./helpers/expect_nan.md) — Проверяет, является ли значение NaN, и выбрасывает
|
37
|
+
ошибку с указанным сообщением, если это не так.
|
38
|
+
- [expect_null](./helpers/expect_null.md) — Проверяет, является ли значение null, и
|
39
|
+
выбрасывает ошибку с указанным сообщением, если это не так.
|
40
|
+
- [expect_number](./helpers/expect_number.md) — Проверяет, является ли значение числом, и
|
41
|
+
выбрасывает ошибку с указанным сообщением, если это не так.
|
42
|
+
- [expect_numeric](./helpers/expect_numeric.md) — Проверяет, является ли значение числовым, и
|
43
|
+
выбрасывает ошибку с указанным сообщением, если это не так.
|
44
|
+
- [expect_object](./helpers/expect_object.md) — Проверяет, является ли значение объектом, и
|
45
|
+
выбрасывает ошибку с указанным сообщением, если это не так.
|
46
|
+
- [expect_scalar](./helpers/expect_scalar.md) — Проверяет, является ли значение скалярным, и
|
47
|
+
выбрасывает ошибку с указанным сообщением, если это не так.
|
48
|
+
- [expect_string](./helpers/expect_string.md) — Проверяет, является ли значение строкой, и
|
49
|
+
выбрасывает ошибку с указанным сообщением, если это не так.
|
50
|
+
- [expect_symbol](./helpers/expect_symbol.md) — Проверяет, является ли значение символом, и
|
51
|
+
выбрасывает ошибку с указанным сообщением, если это не так.
|
52
|
+
- [expect_undefined](./helpers/expect_undefined.md) — Проверяет, является ли значение
|
53
|
+
undefined, и выбрасывает ошибку с указанным сообщением, если это не так.
|
54
|
+
- [expect](./helpers/expect.md) — Функция, создающая новый экземпляр класса `Expect` для
|
55
|
+
проверки значений.
|
8
56
|
- [gettype](./helpers/gettype.md) — Определяет тип переданного значения.
|
9
57
|
- [is_array](./helpers/is_array.md) — Проверяет, является ли переданное значение массивом или
|
10
58
|
ассоциативным массивом (объектом с ключами и значениями).
|
@@ -14,7 +62,9 @@
|
|
14
62
|
типом (`boolean`).
|
15
63
|
- [is_boolean](./helpers/is_boolean.md) — Проверяет, является ли переданное значение
|
16
64
|
логическим типом (`boolean`).
|
65
|
+
- [is_char](./helpers/is_char.md) — Проверяет, является ли значение одиночным символом.
|
17
66
|
- [is_class](./helpers/is_class.md) — Проверяет, является ли переданная переменная классом.
|
67
|
+
- [is_equal](./helpers/is_equal.md) — Проверяет, являются ли два значения равными.
|
18
68
|
- [is_float](./helpers/is_float.md) — Проверяет, является ли значение числом с плавающей
|
19
69
|
точкой.
|
20
70
|
- [is_function](./helpers/is_function.md) — Проверяет, что значение является функцией,
|
@@ -51,3 +101,124 @@
|
|
51
101
|
- [to_string](./helpers/to_string.md) — Преобразует значение в строку.
|
52
102
|
- [value](./helpers/value.md) — Создает новый экземпляр класса `Value` с заданным значением.
|
53
103
|
|
104
|
+
## Помощники для работы с массивами
|
105
|
+
|
106
|
+
- [array_chunk_with_keys](./helpers/array/array_chunk_with_keys.md) — Разбивает массив на
|
107
|
+
части указанной длины с сохранением ключей.
|
108
|
+
- [array_chunk](./helpers/array/array_chunk.md) — Разбивает массив на части указанной длины.
|
109
|
+
- [array_column](./helpers/array/array_column.md) — Извлекает значения указанного столбца из
|
110
|
+
массива объектов.
|
111
|
+
- [array_combine](./helpers/array/array_combine.md) — Объединяет два массива в ассоциативный
|
112
|
+
массив.
|
113
|
+
- [array_count_values](./helpers/array/array_count_values.md) — Подсчитывает количество
|
114
|
+
значений в массиве.
|
115
|
+
- [array_diff_assoc](./helpers/array/array_diff_assoc.md) — Вычисляет расхождение между
|
116
|
+
массивами с использованием стандартной функции сравнения значений и ключей.
|
117
|
+
- [array_diff_key](./helpers/array/array_diff_key.md) — Вычисляет расхождение между массивами
|
118
|
+
с использованием стандартной функции сравнения ключей.
|
119
|
+
- [array_diff_uassoc](./helpers/array/array_diff_uassoc.md) — Вычисляет расхождение между
|
120
|
+
массивами с использованием пользовательской функции сравнения ключей.
|
121
|
+
- [array_diff_ukey](./helpers/array/array_diff_ukey.md) — Вычисляет расхождение между
|
122
|
+
массивами с использованием пользовательской функции сравнения для ключей.
|
123
|
+
- [array_diff](./helpers/array/array_diff.md) — Вычисляет расхождение между массивами.
|
124
|
+
- [array_fill_keys](./helpers/array/array_fill_keys.md) — Заполняет массив значениями по
|
125
|
+
указанным ключам.
|
126
|
+
- [array_fill](./helpers/array/array_fill.md) — Заполняет массив значениями, начиная с
|
127
|
+
указанного индекса.
|
128
|
+
- [array_filter](./helpers/array/array_filter.md) — Фильтрует элементы массива с
|
129
|
+
использованием функции обратного вызова.
|
130
|
+
- [array_flip](./helpers/array/array_flip.md) — Меняет местами ключи и значения в массиве.
|
131
|
+
- [array_index_max](./helpers/array/array_index_max.md) — Возвращает максимальный индекс
|
132
|
+
массива.
|
133
|
+
- [array_index_min](./helpers/array/array_index_min.md) — Возвращает минимальный индекс
|
134
|
+
массива.
|
135
|
+
- [array_intersect_assoc](./helpers/array/array_intersect_assoc.md) — Вычисляет пересечение
|
136
|
+
между массивами с использованием стандартной функции сравнения для значений и ключей.
|
137
|
+
- [array_intersect_key](./helpers/array/array_intersect_key.md) — Вычисляет пересечение между
|
138
|
+
массивами с использованием стандартной функции сравнения для ключей.
|
139
|
+
- [array_intersect_uassoc](./helpers/array/array_intersect_uassoc.md) — Вычисляет пересечение
|
140
|
+
между массивами с использованием пользовательской функции сравнения для значений и ключей.
|
141
|
+
- [array_intersect_ukey](./helpers/array/array_intersect_ukey.md) — Вычисляет пересечение
|
142
|
+
между массивами с использованием пользовательской функции сравнения для ключей.
|
143
|
+
- [array_intersect](./helpers/array/array_intersect.md) — Вычисляет пересечение между
|
144
|
+
массивами с использованием стандартной функции сравнения значений.
|
145
|
+
- [array_key_exists](./helpers/array/array_key_exists.md) — Проверяет, существует ли указанный
|
146
|
+
ключ в массиве.
|
147
|
+
- [array_key_first](./helpers/array/array_key_first.md) — Возвращает первый ключ массива.
|
148
|
+
- [array_key_last](./helpers/array/array_key_last.md) — Возвращает последний ключ массива.
|
149
|
+
- [array_key_to_lower_case](./helpers/array/array_key_to_lower_case.md) — Преобразует ключи
|
150
|
+
ассоциативного массива в нижний регистр.
|
151
|
+
- [array_key_to_upper_case](./helpers/array/array_key_to_upper_case.md) — Преобразует ключи
|
152
|
+
ассоциативного массива в верхний регистр.
|
153
|
+
- [array_keys](./helpers/array/array_keys.md) — Возвращает массив ключей из переданного
|
154
|
+
массива или объекта.
|
155
|
+
- [array_map](./helpers/array/array_map.md) — Применяет функцию обратного вызова к каждому
|
156
|
+
элементу массива.
|
157
|
+
- [array_merge_recursive](./helpers/array/array_merge_recursive.md) — Объединяет несколько
|
158
|
+
массивов рекурсивно.
|
159
|
+
- [array_merge](./helpers/array/array_merge.md) — Объединяет несколько массивов в один.
|
160
|
+
- [array_pad](./helpers/array/array_pad.md) — Дополняет массив до заданной длины указанным
|
161
|
+
значением.
|
162
|
+
- [array_pop](./helpers/array/array_pop.md) — Удаляет и возвращает последний элемент массива.
|
163
|
+
- [array_product](./helpers/array/array_product.md) — Вычисляет произведение значений массива.
|
164
|
+
- [array_push](./helpers/array/array_push.md) — Добавляет один или несколько элементов в конец
|
165
|
+
массива.
|
166
|
+
- [array_rand](./helpers/array/array_rand.md) — Возвращает один или несколько случайных ключей
|
167
|
+
из массива.
|
168
|
+
- [array_reduce](./helpers/array/array_reduce.md) — Применяет функцию обратного вызова к
|
169
|
+
каждому элементу массива (слева направо), чтобы уменьшить его до одного значения.
|
170
|
+
- [array_replace_recursive](./helpers/array/array_replace_recursive.md) — Рекурсивно заменяет
|
171
|
+
значения в массиве на значения из других массивов.
|
172
|
+
- [array_replace](./helpers/array/array_replace.md) — Заменяет значения в массиве на значения
|
173
|
+
из других массивов.
|
174
|
+
- [array_reverse](./helpers/array/array_reverse.md) — Переворачивает массив, изменяя порядок
|
175
|
+
его элементов на обратный.
|
176
|
+
- [array_search](./helpers/array/array_search.md) — Ищет значение в массиве и возвращает ключ
|
177
|
+
первого найденного элемента.
|
178
|
+
- [array_shift](./helpers/array/array_shift.md) — Удаляет и возвращает первый элемент массива.
|
179
|
+
- [array_slice](./helpers/array/array_slice.md) — Возвращает новый массив, содержащий часть
|
180
|
+
исходного массива.
|
181
|
+
- [array_splice](./helpers/array/array_splice.md) — Удаляет элементы из массива и, при
|
182
|
+
необходимости, добавляет новые элементы на их место.
|
183
|
+
- [array_sum](./helpers/array/array_sum.md) — Вычисляет сумму значений массива.
|
184
|
+
- [array_udiff_assoc](./helpers/array/array_udiff_assoc.md) — Вычисляет расхождение между
|
185
|
+
массивами с использованием пользовательской функции сравнения для значений и ассоциативного
|
186
|
+
сравнения ключей.
|
187
|
+
- [array_udiff_uassoc](./helpers/array/array_udiff_uassoc.md) — Вычисляет расхождение между
|
188
|
+
массивами с использованием пользовательских функций сравнения для значений и ключей.
|
189
|
+
- [array_udiff](./helpers/array/array_udiff.md) — Вычисляет расхождение между массивами с
|
190
|
+
использованием пользовательской функции сравнения для значений.
|
191
|
+
- [array_uintersect_assoc](./helpers/array/array_uintersect_assoc.md) — Вычисляет пересечение
|
192
|
+
между массивами с использованием пользовательской функции сравнения для значений и стандартной
|
193
|
+
функции сравнения для ключей.
|
194
|
+
- [array_uintersect_uassoc](./helpers/array/array_uintersect_uassoc.md) — Вычисляет
|
195
|
+
пересечение между массивами с использованием пользовательских функций сравнения для значений и
|
196
|
+
ключей.
|
197
|
+
- [array_uintersect](./helpers/array/array_uintersect.md) — Вычисляет пересечение между
|
198
|
+
массивами с использованием пользовательской функции сравнения для значений.
|
199
|
+
- [array_unique](./helpers/array/array_unique.md) — Удаляет дублирующиеся значения из массива.
|
200
|
+
- [array_unshift](./helpers/array/array_unshift.md) — Добавляет один или несколько элементов в
|
201
|
+
начало массива.
|
202
|
+
- [array_values](./helpers/array/array_values.md) — Возвращает массив значений из переданного
|
203
|
+
массива или объекта.
|
204
|
+
- [array_walk_recursive](./helpers/array/array_walk_recursive.md) — Применяет пользовательскую
|
205
|
+
функцию к каждому элементу массива рекурсивно.
|
206
|
+
- [array_walk](./helpers/array/array_walk.md) — Применяет пользовательскую функцию к каждому
|
207
|
+
элементу массива.
|
208
|
+
- [count](./helpers/array/count.md) — Возвращает количество элементов в массиве или
|
209
|
+
ассоциативном массиве.
|
210
|
+
- [in_array](./helpers/array/in_array.md) — Проверяет, существует ли значение в массиве.
|
211
|
+
- [natsort](./helpers/array/natsort.md) — Сортирует массив в естественном порядке.
|
212
|
+
- [range](./helpers/array/range.md) — Генерирует массив значений от start до end с шагом step.
|
213
|
+
- [shuffle](./helpers/array/shuffle.md) — Перемешивает элементы массива в случайном порядке.
|
214
|
+
- [sort](./helpers/array/sort.md) — Сортирует элементы массива с использованием функции
|
215
|
+
сравнения.
|
216
|
+
|
217
|
+
## Помощники для работы со строками
|
218
|
+
|
219
|
+
- [is_digit_char](./helpers/string/is_digit_char.md) — Проверяет, является ли символ цифрой.
|
220
|
+
- [is_whitespace_char](./helpers/string/is_whitespace_char.md) — Проверяет, является ли символ
|
221
|
+
пробельным.
|
222
|
+
- [natcompare_numeric](./helpers/string/natcompare_numeric.md) — Сравнивает две строки,
|
223
|
+
содержащие числовые значения, в естественном порядке.
|
224
|
+
- [natcompare](./helpers/string/natcompare.md) — Сравнивает две строки в естественном порядке.
|
package/index.mjs
CHANGED
@@ -40,4 +40,94 @@ export { default as Type } from './src/classes/Type.mjs';
|
|
40
40
|
export { default as Convert } from './src/classes/Convert.mjs';
|
41
41
|
export { default as Value } from './src/classes/Value.mjs';
|
42
42
|
export * from './src/constants.mjs';
|
43
|
-
|
43
|
+
export { default as array_key_to_lower_case } from './src/helpers/array/array_key_to_lower_case.mjs';
|
44
|
+
export { default as array_key_to_upper_case } from './src/helpers/array/array_key_to_upper_case.mjs';
|
45
|
+
export { default as array_chunk } from './src/helpers/array/array_chunk.mjs';
|
46
|
+
export { default as array_chunk_with_keys } from './src/helpers/array/array_chunk_with_keys.mjs';
|
47
|
+
export { default as array_column } from './src/helpers/array/array_column.mjs';
|
48
|
+
export { default as array_combine } from './src/helpers/array/array_combine.mjs';
|
49
|
+
export { default as array_count_values } from './src/helpers/array/array_count_values.mjs';
|
50
|
+
export { default as array_udiff_uassoc } from './src/helpers/array/array_udiff_uassoc.mjs';
|
51
|
+
export { default as array_udiff } from './src/helpers/array/array_udiff.mjs';
|
52
|
+
export { default as array_udiff_assoc } from './src/helpers/array/array_udiff_assoc.mjs';
|
53
|
+
export { default as array_diff } from './src/helpers/array/array_diff.mjs';
|
54
|
+
export { default as array_diff_ukey } from './src/helpers/array/array_diff_ukey.mjs';
|
55
|
+
export { default as array_diff_uassoc } from './src/helpers/array/array_diff_uassoc.mjs';
|
56
|
+
export { default as array_diff_key } from './src/helpers/array/array_diff_key.mjs';
|
57
|
+
export { default as array_diff_assoc } from './src/helpers/array/array_diff_assoc.mjs';
|
58
|
+
export { default as array_uintersect_uassoc } from './src/helpers/array/array_uintersect_uassoc.mjs';
|
59
|
+
export { default as array_uintersect } from './src/helpers/array/array_uintersect.mjs';
|
60
|
+
export { default as array_uintersect_assoc } from './src/helpers/array/array_uintersect_assoc.mjs';
|
61
|
+
export { default as array_intersect } from './src/helpers/array/array_intersect.mjs';
|
62
|
+
export { default as array_intersect_ukey } from './src/helpers/array/array_intersect_ukey.mjs';
|
63
|
+
export { default as array_intersect_uassoc } from './src/helpers/array/array_intersect_uassoc.mjs';
|
64
|
+
export { default as array_intersect_key } from './src/helpers/array/array_intersect_key.mjs';
|
65
|
+
export { default as array_intersect_assoc } from './src/helpers/array/array_intersect_assoc.mjs';
|
66
|
+
export { default as array_fill } from './src/helpers/array/array_fill.mjs';
|
67
|
+
export { default as array_fill_keys } from './src/helpers/array/array_fill_keys.mjs';
|
68
|
+
export { default as array_filter } from './src/helpers/array/array_filter.mjs';
|
69
|
+
export { default as array_flip } from './src/helpers/array/array_flip.mjs';
|
70
|
+
export { default as array_index_max } from './src/helpers/array/array_index_max.mjs';
|
71
|
+
export { default as array_index_min } from './src/helpers/array/array_index_min.mjs';
|
72
|
+
export { default as array_key_exists } from './src/helpers/array/array_key_exists.mjs';
|
73
|
+
export { default as array_key_first } from './src/helpers/array/array_key_first.mjs';
|
74
|
+
export { default as array_key_last } from './src/helpers/array/array_key_last.mjs';
|
75
|
+
export { default as array_keys } from './src/helpers/array/array_keys.mjs';
|
76
|
+
export { default as array_map } from './src/helpers/array/array_map.mjs';
|
77
|
+
export { default as array_merge } from './src/helpers/array/array_merge.mjs';
|
78
|
+
export { default as array_merge_recursive } from './src/helpers/array/array_merge_recursive.mjs';
|
79
|
+
export { default as array_pad } from './src/helpers/array/array_pad.mjs';
|
80
|
+
export { default as array_pop } from './src/helpers/array/array_pop.mjs';
|
81
|
+
export { default as array_reduce } from './src/helpers/array/array_reduce.mjs';
|
82
|
+
export { default as array_product } from './src/helpers/array/array_product.mjs';
|
83
|
+
export { default as array_push } from './src/helpers/array/array_push.mjs';
|
84
|
+
export { default as array_rand } from './src/helpers/array/array_rand.mjs';
|
85
|
+
export { default as array_replace } from './src/helpers/array/array_replace.mjs';
|
86
|
+
export { default as array_replace_recursive } from './src/helpers/array/array_replace_recursive.mjs';
|
87
|
+
export { default as array_reverse } from './src/helpers/array/array_reverse.mjs';
|
88
|
+
export { default as array_search } from './src/helpers/array/array_search.mjs';
|
89
|
+
export { default as array_shift } from './src/helpers/array/array_shift.mjs';
|
90
|
+
export { default as array_slice } from './src/helpers/array/array_slice.mjs';
|
91
|
+
export { default as array_splice } from './src/helpers/array/array_splice.mjs';
|
92
|
+
export { default as array_sum } from './src/helpers/array/array_sum.mjs';
|
93
|
+
export { default as array_unique } from './src/helpers/array/array_unique.mjs';
|
94
|
+
export { default as array_unshift } from './src/helpers/array/array_unshift.mjs';
|
95
|
+
export { default as array_values } from './src/helpers/array/array_values.mjs';
|
96
|
+
export { default as array_walk } from './src/helpers/array/array_walk.mjs';
|
97
|
+
export { default as array_walk_recursive } from './src/helpers/array/array_walk_recursive.mjs';
|
98
|
+
export { default as count } from './src/helpers/array/count.mjs';
|
99
|
+
export { default as in_array } from './src/helpers/array/in_array.mjs';
|
100
|
+
export { default as range } from './src/helpers/array/range.mjs';
|
101
|
+
export { default as shuffle } from './src/helpers/array/shuffle.mjs';
|
102
|
+
export { default as sort } from './src/helpers/array/sort.mjs';
|
103
|
+
export { default as is_char } from './src/helpers/is_char.mjs';
|
104
|
+
export { default as is_whitespace_char } from './src/helpers/string/is_whitespace_char.mjs';
|
105
|
+
export { default as is_digit_char } from './src/helpers/string/is_digit_char.mjs';
|
106
|
+
export { default as natcompare_numeric } from './src/helpers/string/natcompare_numeric.mjs';
|
107
|
+
export { default as natcompare } from './src/helpers/string/natcompare.mjs';
|
108
|
+
export { default as natsort } from './src/helpers/array/natsort.mjs';
|
109
|
+
export { default as expect_array } from './src/helpers/expect_array.mjs';
|
110
|
+
export { default as expect_assoc } from './src/helpers/expect_assoc.mjs';
|
111
|
+
export { default as expect_bigint } from './src/helpers/expect_bigint.mjs';
|
112
|
+
export { default as expect_bool } from './src/helpers/expect_bool.mjs';
|
113
|
+
export { default as expect_boolean } from './src/helpers/expect_boolean.mjs';
|
114
|
+
export { default as expect_char } from './src/helpers/expect_char.mjs';
|
115
|
+
export { default as expect_class } from './src/helpers/expect_class.mjs';
|
116
|
+
export { default as expect_float } from './src/helpers/expect_float.mjs';
|
117
|
+
export { default as expect_function } from './src/helpers/expect_function.mjs';
|
118
|
+
export { default as expect_infinity } from './src/helpers/expect_infinity.mjs';
|
119
|
+
export { default as expect_int } from './src/helpers/expect_int.mjs';
|
120
|
+
export { default as expect_integer } from './src/helpers/expect_integer.mjs';
|
121
|
+
export { default as expect_list } from './src/helpers/expect_list.mjs';
|
122
|
+
export { default as expect_nan } from './src/helpers/expect_nan.mjs';
|
123
|
+
export { default as expect_null } from './src/helpers/expect_null.mjs';
|
124
|
+
export { default as expect_number } from './src/helpers/expect_number.mjs';
|
125
|
+
export { default as expect_numeric } from './src/helpers/expect_numeric.mjs';
|
126
|
+
export { default as expect_object } from './src/helpers/expect_object.mjs';
|
127
|
+
export { default as expect_scalar } from './src/helpers/expect_scalar.mjs';
|
128
|
+
export { default as expect_string } from './src/helpers/expect_string.mjs';
|
129
|
+
export { default as expect_symbol } from './src/helpers/expect_symbol.mjs';
|
130
|
+
export { default as expect_undefined } from './src/helpers/expect_undefined.mjs';
|
131
|
+
export { default as is_equal } from './src/helpers/is_equal.mjs';
|
132
|
+
export { default as Expect } from './src/classes/Expect.mjs';
|
133
|
+
export { default as expect } from './src/helpers/expect.mjs';
|
package/package.json
CHANGED
package/prettier.config.mjs
CHANGED
@@ -146,7 +146,7 @@ export default {
|
|
146
146
|
* - `crlf` - Символы Carriage Return + Line Feed (\r\n).
|
147
147
|
* - `cr` - Только символ Carriage Return (\r).
|
148
148
|
*/
|
149
|
-
endOfLine: '
|
149
|
+
endOfLine: 'lf',
|
150
150
|
|
151
151
|
/**
|
152
152
|
* Изменить, когда свойства в объектах заключаются в кавычки.
|
@@ -222,3 +222,4 @@ export default {
|
|
222
222
|
*/
|
223
223
|
useTabs: false,
|
224
224
|
};
|
225
|
+
|