metano-runtime 2.10.0 → 3.0.0
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/README.md +11 -1
- package/dist/system/argument-guards.d.ts +63 -0
- package/dist/system/argument-guards.js +155 -0
- package/dist/system/array-length.d.ts +6 -0
- package/dist/system/array-length.js +17 -0
- package/dist/system/big-integer.d.ts +50 -0
- package/dist/system/big-integer.js +108 -0
- package/dist/system/boolean-format.d.ts +6 -0
- package/dist/system/boolean-format.js +11 -0
- package/dist/system/collections/builder-iterator.d.ts +14 -0
- package/dist/system/collections/builder-iterator.js +15 -0
- package/dist/system/collections/checks.d.ts +17 -0
- package/dist/system/collections/checks.js +0 -0
- package/dist/system/collections/close-collection.d.ts +33 -0
- package/dist/system/collections/close-collection.js +68 -0
- package/dist/system/collections/collection-type-name.d.ts +11 -0
- package/dist/system/collections/collection-type-name.js +19 -0
- package/dist/system/collections/concurrent-dictionary.d.ts +80 -0
- package/dist/system/collections/concurrent-dictionary.js +261 -0
- package/dist/system/collections/copy-to.d.ts +8 -0
- package/dist/system/collections/copy-to.js +37 -0
- package/dist/system/collections/default-comparer.d.ts +64 -0
- package/dist/system/collections/default-comparer.js +231 -0
- package/dist/system/collections/descriptors.d.ts +58 -0
- package/dist/system/collections/descriptors.js +181 -0
- package/dist/system/collections/dictionary-helpers.d.ts +3 -28
- package/dist/system/collections/dictionary-helpers.js +3 -38
- package/dist/system/collections/dictionary-views.d.ts +39 -0
- package/dist/system/collections/dictionary-views.js +153 -0
- package/dist/system/collections/dictionary.d.ts +68 -0
- package/dist/system/collections/dictionary.js +165 -0
- package/dist/system/collections/hash-core.d.ts +51 -0
- package/dist/system/collections/hash-core.js +160 -0
- package/dist/system/collections/hash-set.d.ts +51 -24
- package/dist/system/collections/hash-set.js +165 -137
- package/dist/system/collections/helpers.d.ts +29 -0
- package/dist/system/collections/helpers.js +73 -0
- package/dist/system/collections/immutable-array-builder.d.ts +37 -0
- package/dist/system/collections/immutable-array-builder.js +117 -0
- package/dist/system/collections/immutable-array.d.ts +74 -0
- package/dist/system/collections/immutable-array.js +243 -0
- package/dist/system/collections/immutable-dictionary-builder.d.ts +58 -0
- package/dist/system/collections/immutable-dictionary-builder.js +126 -0
- package/dist/system/collections/immutable-dictionary.d.ts +80 -0
- package/dist/system/collections/immutable-dictionary.js +284 -0
- package/dist/system/collections/immutable-hash-set-builder.d.ts +58 -0
- package/dist/system/collections/immutable-hash-set-builder.js +125 -0
- package/dist/system/collections/immutable-hash-set.d.ts +71 -0
- package/dist/system/collections/immutable-hash-set.js +242 -0
- package/dist/system/collections/immutable-interfaces.d.ts +51 -0
- package/dist/system/collections/immutable-interfaces.js +0 -0
- package/dist/system/collections/immutable-list-builder-core.d.ts +58 -0
- package/dist/system/collections/immutable-list-builder-core.js +136 -0
- package/dist/system/collections/immutable-list-builder.d.ts +35 -0
- package/dist/system/collections/immutable-list-builder.js +73 -0
- package/dist/system/collections/immutable-list-core.d.ts +98 -0
- package/dist/system/collections/immutable-list-core.js +268 -0
- package/dist/system/collections/immutable-list.d.ts +49 -0
- package/dist/system/collections/immutable-list.js +176 -0
- package/dist/system/collections/immutable-storage.d.ts +50 -0
- package/dist/system/collections/immutable-storage.js +83 -0
- package/dist/system/collections/index.d.ts +25 -2
- package/dist/system/collections/index.js +22 -2
- package/dist/system/collections/interfaces.d.ts +76 -0
- package/dist/system/collections/interfaces.js +0 -0
- package/dist/system/collections/list.d.ts +96 -0
- package/dist/system/collections/list.js +335 -0
- package/dist/system/collections/queue.d.ts +44 -0
- package/dist/system/collections/queue.js +115 -0
- package/dist/system/collections/read-only-list.d.ts +45 -0
- package/dist/system/collections/read-only-list.js +152 -0
- package/dist/system/collections/red-black-tree.d.ts +64 -0
- package/dist/system/collections/red-black-tree.js +361 -0
- package/dist/system/collections/set-algebra.d.ts +15 -0
- package/dist/system/collections/set-algebra.js +58 -0
- package/dist/system/collections/sorted-array.d.ts +14 -0
- package/dist/system/collections/sorted-array.js +31 -0
- package/dist/system/collections/sorted-dictionary.d.ts +64 -0
- package/dist/system/collections/sorted-dictionary.js +163 -0
- package/dist/system/collections/sorted-list.d.ts +131 -0
- package/dist/system/collections/sorted-list.js +301 -0
- package/dist/system/collections/sorted-set.d.ts +98 -0
- package/dist/system/collections/sorted-set.js +255 -0
- package/dist/system/collections/stack.d.ts +39 -0
- package/dist/system/collections/stack.js +106 -0
- package/dist/system/collections/throw-helpers.d.ts +77 -0
- package/dist/system/collections/throw-helpers.js +158 -0
- package/dist/system/date-time-offset.d.ts +23 -0
- package/dist/system/date-time-offset.js +61 -0
- package/dist/system/decimal-parsing.d.ts +18 -0
- package/dist/system/decimal-parsing.js +74 -0
- package/dist/system/decimal.d.ts +20 -0
- package/dist/system/decimal.js +30 -0
- package/dist/system/default-text.d.ts +11 -0
- package/dist/system/default-text.js +52 -0
- package/dist/system/delegates.js +1 -1
- package/dist/system/double-format.d.ts +20 -0
- package/dist/system/double-format.js +171 -0
- package/dist/system/dynamic-conversion.d.ts +37 -0
- package/dist/system/dynamic-conversion.js +229 -0
- package/dist/system/equality.d.ts +23 -3
- package/dist/system/equality.js +135 -3
- package/dist/system/exceptions/argument-exception.d.ts +17 -0
- package/dist/system/exceptions/argument-exception.js +44 -0
- package/dist/system/exceptions/argument-null-exception.d.ts +16 -0
- package/dist/system/exceptions/argument-null-exception.js +35 -0
- package/dist/system/exceptions/argument-out-of-range-exception.d.ts +18 -0
- package/dist/system/exceptions/argument-out-of-range-exception.js +51 -0
- package/dist/system/exceptions/arithmetic-exception.d.ts +12 -0
- package/dist/system/exceptions/arithmetic-exception.js +31 -0
- package/dist/system/exceptions/divide-by-zero-exception.d.ts +12 -0
- package/dist/system/exceptions/divide-by-zero-exception.js +31 -0
- package/dist/system/exceptions/exception.d.ts +38 -0
- package/dist/system/exceptions/exception.js +77 -0
- package/dist/system/exceptions/format-exception.d.ts +12 -0
- package/dist/system/exceptions/format-exception.js +31 -0
- package/dist/system/exceptions/index-out-of-range-exception.d.ts +12 -0
- package/dist/system/exceptions/index-out-of-range-exception.js +31 -0
- package/dist/system/exceptions/index.d.ts +26 -0
- package/dist/system/exceptions/index.js +26 -0
- package/dist/system/exceptions/invalid-cast-exception.d.ts +12 -0
- package/dist/system/exceptions/invalid-cast-exception.js +31 -0
- package/dist/system/exceptions/invalid-operation-exception.d.ts +12 -0
- package/dist/system/exceptions/invalid-operation-exception.js +31 -0
- package/dist/system/exceptions/json-exception.d.ts +18 -0
- package/dist/system/exceptions/json-exception.js +39 -0
- package/dist/system/exceptions/key-not-found-exception.d.ts +13 -0
- package/dist/system/exceptions/key-not-found-exception.js +34 -0
- package/dist/system/exceptions/message-value.d.ts +7 -0
- package/dist/system/exceptions/message-value.js +9 -0
- package/dist/system/exceptions/missing-method-exception.d.ts +19 -0
- package/dist/system/exceptions/missing-method-exception.js +38 -0
- package/dist/system/exceptions/named-exception.d.ts +7 -0
- package/dist/system/exceptions/named-exception.js +29 -0
- package/dist/system/exceptions/not-implemented-exception.d.ts +12 -0
- package/dist/system/exceptions/not-implemented-exception.js +31 -0
- package/dist/system/exceptions/not-supported-exception.d.ts +12 -0
- package/dist/system/exceptions/not-supported-exception.js +31 -0
- package/dist/system/exceptions/null-reference-exception.d.ts +12 -0
- package/dist/system/exceptions/null-reference-exception.js +31 -0
- package/dist/system/exceptions/object-disposed-exception.d.ts +18 -0
- package/dist/system/exceptions/object-disposed-exception.js +41 -0
- package/dist/system/exceptions/operation-canceled-exception.d.ts +12 -0
- package/dist/system/exceptions/operation-canceled-exception.js +31 -0
- package/dist/system/exceptions/overflow-exception.d.ts +15 -0
- package/dist/system/exceptions/overflow-exception.js +34 -0
- package/dist/system/exceptions/switch-expression-exception.d.ts +21 -0
- package/dist/system/exceptions/switch-expression-exception.js +49 -0
- package/dist/system/exceptions/system-exception.d.ts +12 -0
- package/dist/system/exceptions/system-exception.js +31 -0
- package/dist/system/exceptions/task-canceled-exception.d.ts +13 -0
- package/dist/system/exceptions/task-canceled-exception.js +34 -0
- package/dist/system/exceptions/timeout-exception.d.ts +12 -0
- package/dist/system/exceptions/timeout-exception.js +31 -0
- package/dist/system/exceptions/to-exception.d.ts +25 -0
- package/dist/system/exceptions/to-exception.js +53 -0
- package/dist/system/exceptions/type-initialization-exception.d.ts +19 -0
- package/dist/system/exceptions/type-initialization-exception.js +36 -0
- package/dist/system/hash-code.d.ts +0 -7
- package/dist/system/hash-code.js +3 -1
- package/dist/system/identity-memo.d.ts +7 -0
- package/dist/system/identity-memo.js +14 -0
- package/dist/system/index.d.ts +21 -0
- package/dist/system/index.js +21 -0
- package/dist/system/int64-convert.d.ts +59 -0
- package/dist/system/int64-convert.js +226 -0
- package/dist/system/int64-format.d.ts +13 -0
- package/dist/system/int64-format.js +28 -0
- package/dist/system/int64-math.d.ts +56 -0
- package/dist/system/int64-math.js +109 -0
- package/dist/system/int64-parsing.d.ts +45 -0
- package/dist/system/int64-parsing.js +153 -0
- package/dist/system/int64.d.ts +134 -0
- package/dist/system/int64.js +298 -0
- package/dist/system/integer-division.d.ts +1 -1
- package/dist/system/integer-division.js +2 -3
- package/dist/system/integer-format.d.ts +12 -0
- package/dist/system/integer-format.js +22 -0
- package/dist/system/integer-standard-format.d.ts +9 -0
- package/dist/system/integer-standard-format.js +66 -0
- package/dist/system/json/byte-array-converter.d.ts +19 -0
- package/dist/system/json/byte-array-converter.js +106 -0
- package/dist/system/json/container-depth.d.ts +10 -0
- package/dist/system/json/container-depth.js +43 -16
- package/dist/system/json/contract-name.d.ts +8 -3
- package/dist/system/json/contract-name.js +22 -2
- package/dist/system/json/converter-set-cache.d.ts +17 -0
- package/dist/system/json/converter-set-cache.js +26 -0
- package/dist/system/json/converters.d.ts +27 -12
- package/dist/system/json/converters.js +498 -169
- package/dist/system/json/decimal-text.d.ts +9 -0
- package/dist/system/json/decimal-text.js +125 -0
- package/dist/system/json/dictionary-keys.d.ts +31 -0
- package/dist/system/json/dictionary-keys.js +195 -0
- package/dist/system/json/errors.d.ts +9 -11
- package/dist/system/json/errors.js +9 -11
- package/dist/system/json/exact-json-number.d.ts +103 -0
- package/dist/system/json/exact-json-number.js +155 -0
- package/dist/system/json/exact-number-reads.d.ts +21 -0
- package/dist/system/json/exact-number-reads.js +104 -0
- package/dist/system/json/index.d.ts +1 -2
- package/dist/system/json/index.js +0 -1
- package/dist/system/json/json-serializer.d.ts +64 -9
- package/dist/system/json/json-serializer.js +52 -12
- package/dist/system/json/json-text-reader.d.ts +33 -0
- package/dist/system/json/json-text-reader.js +608 -0
- package/dist/system/json/null-reads.d.ts +22 -0
- package/dist/system/json/null-reads.js +43 -0
- package/dist/system/json/number-from-string.d.ts +44 -0
- package/dist/system/json/number-from-string.js +248 -0
- package/dist/system/json/numeric-converters.d.ts +65 -0
- package/dist/system/json/numeric-converters.js +361 -0
- package/dist/system/json/numeric-enum-members.d.ts +18 -0
- package/dist/system/json/numeric-enum-members.js +18 -0
- package/dist/system/json/ordinal-ignore-case.d.ts +14 -0
- package/dist/system/json/ordinal-ignore-case.js +60 -0
- package/dist/system/json/polymorphism.d.ts +2 -0
- package/dist/system/json/polymorphism.js +101 -20
- package/dist/system/json/property-lookup.d.ts +17 -0
- package/dist/system/json/property-lookup.js +32 -0
- package/dist/system/json/property-naming-policy.d.ts +5 -5
- package/dist/system/json/property-naming-policy.js +163 -73
- package/dist/system/json/serializer-context.d.ts +19 -4
- package/dist/system/json/serializer-context.js +33 -7
- package/dist/system/json/spec-kind.d.ts +3 -0
- package/dist/system/json/spec-kind.js +4 -0
- package/dist/system/json/temporal-reads.d.ts +15 -0
- package/dist/system/json/temporal-reads.js +423 -0
- package/dist/system/json/temporal-text.d.ts +16 -0
- package/dist/system/json/temporal-text.js +32 -0
- package/dist/system/json/types.d.ts +190 -24
- package/dist/system/json/types.js +0 -1
- package/dist/system/json/value-converter.d.ts +5 -0
- package/dist/system/json/value-converter.js +0 -0
- package/dist/system/lazy-value.d.ts +9 -0
- package/dist/system/lazy-value.js +19 -0
- package/dist/system/linq/compare-keys.js +4 -0
- package/dist/system/linq/decimal-terminals.d.ts +24 -0
- package/dist/system/linq/decimal-terminals.js +67 -0
- package/dist/system/linq/expr-tree-visitor.d.ts +2 -27
- package/dist/system/linq/expr-tree-visitor.js +62 -0
- package/dist/system/linq/expr-tree.d.ts +11 -1
- package/dist/system/linq/index.d.ts +7 -4
- package/dist/system/linq/index.js +4 -2
- package/dist/system/linq/int64-terminals.d.ts +33 -0
- package/dist/system/linq/int64-terminals.js +131 -0
- package/dist/system/linq/operators.d.ts +7 -1
- package/dist/system/linq/operators.js +60 -2
- package/dist/system/linq/terminals.d.ts +85 -7
- package/dist/system/linq/terminals.js +220 -67
- package/dist/system/linq/types.d.ts +101 -20
- package/dist/system/math.d.ts +6 -5
- package/dist/system/math.js +26 -14
- package/dist/system/number-parsing.d.ts +43 -17
- package/dist/system/number-parsing.js +121 -37
- package/dist/system/record-copy.js +11 -0
- package/dist/system/reflection/box.d.ts +19 -0
- package/dist/system/reflection/box.js +32 -0
- package/dist/system/reflection/boxed-text.d.ts +8 -0
- package/dist/system/reflection/boxed-text.js +31 -0
- package/dist/system/reflection/cast-to.d.ts +15 -0
- package/dist/system/reflection/cast-to.js +32 -0
- package/dist/system/reflection/constructor-descriptor.d.ts +11 -0
- package/dist/system/reflection/constructor-descriptor.js +22 -0
- package/dist/system/reflection/create-instance.d.ts +6 -0
- package/dist/system/reflection/create-instance.js +11 -0
- package/dist/system/reflection/decimal-type-defaults.d.ts +7 -0
- package/dist/system/reflection/decimal-type-defaults.js +17 -0
- package/dist/system/reflection/enum-from-raw.d.ts +14 -0
- package/dist/system/reflection/enum-from-raw.js +89 -0
- package/dist/system/reflection/enum-is-defined.d.ts +7 -0
- package/dist/system/reflection/enum-is-defined.js +14 -0
- package/dist/system/reflection/get-number-type.d.ts +7 -0
- package/dist/system/reflection/get-number-type.js +10 -0
- package/dist/system/reflection/get-runtime-type-from-type.d.ts +6 -0
- package/dist/system/reflection/get-runtime-type-from-type.js +22 -0
- package/dist/system/reflection/get-runtime-type.d.ts +3 -0
- package/dist/system/reflection/get-runtime-type.js +105 -0
- package/dist/system/reflection/implements-interface.d.ts +10 -0
- package/dist/system/reflection/implements-interface.js +26 -0
- package/dist/system/reflection/index.d.ts +27 -0
- package/dist/system/reflection/index.js +26 -0
- package/dist/system/reflection/invalid-cast.d.ts +8 -0
- package/dist/system/reflection/invalid-cast.js +33 -0
- package/dist/system/reflection/is-assignable-from.d.ts +13 -0
- package/dist/system/reflection/is-assignable-from.js +121 -0
- package/dist/system/reflection/is-box-of.d.ts +3 -0
- package/dist/system/reflection/is-box-of.js +5 -0
- package/dist/system/reflection/is-boxed.d.ts +7 -0
- package/dist/system/reflection/is-boxed.js +9 -0
- package/dist/system/reflection/is-type.d.ts +12 -0
- package/dist/system/reflection/is-type.js +20 -0
- package/dist/system/reflection/nullable-type.d.ts +3 -0
- package/dist/system/reflection/nullable-type.js +19 -0
- package/dist/system/reflection/opaque-type.d.ts +6 -0
- package/dist/system/reflection/opaque-type.js +22 -0
- package/dist/system/reflection/primitive-types.d.ts +20 -0
- package/dist/system/reflection/primitive-types.js +160 -0
- package/dist/system/reflection/runtime-type.d.ts +131 -0
- package/dist/system/reflection/runtime-type.js +5 -0
- package/dist/system/reflection/specialize-collection.d.ts +11 -0
- package/dist/system/reflection/specialize-collection.js +93 -0
- package/dist/system/reflection/specialize.d.ts +7 -0
- package/dist/system/reflection/specialize.js +33 -0
- package/dist/system/reflection/temporal-type-defaults.d.ts +11 -0
- package/dist/system/reflection/temporal-type-defaults.js +61 -0
- package/dist/system/reflection/temporal-types.d.ts +7 -0
- package/dist/system/reflection/temporal-types.js +44 -0
- package/dist/system/reflection/to-string-tag.d.ts +6 -0
- package/dist/system/reflection/to-string-tag.js +8 -0
- package/dist/system/reflection/tuple-type.d.ts +6 -0
- package/dist/system/reflection/tuple-type.js +23 -0
- package/dist/system/reflection/unbox-for-cast.d.ts +10 -0
- package/dist/system/reflection/unbox-for-cast.js +28 -0
- package/dist/system/reflection/unbox-for.d.ts +9 -0
- package/dist/system/reflection/unbox-for.js +15 -0
- package/dist/system/reflection/unbox.d.ts +5 -0
- package/dist/system/reflection/unbox.js +8 -0
- package/dist/system/reflection/unsupported-type.d.ts +7 -0
- package/dist/system/reflection/unsupported-type.js +27 -0
- package/dist/system/reflection/well-known-types.d.ts +13 -0
- package/dist/system/reflection/well-known-types.js +32 -0
- package/dist/system/reflection/with-implementers.d.ts +8 -0
- package/dist/system/reflection/with-implementers.js +23 -0
- package/dist/system/standard-numeric-format.d.ts +67 -0
- package/dist/system/standard-numeric-format.js +213 -0
- package/dist/system/string-members.d.ts +170 -0
- package/dist/system/string-members.js +445 -0
- package/dist/system/strings.d.ts +13 -9
- package/dist/system/strings.js +17 -18
- package/dist/system/temporal-helpers.d.ts +33 -0
- package/dist/system/temporal-helpers.js +117 -2
- package/dist/system/time-span-format.d.ts +3 -0
- package/dist/system/time-span-format.js +17 -0
- package/dist/system/time-span.d.ts +33 -0
- package/dist/system/time-span.js +90 -0
- package/dist/system/type-initializer.d.ts +14 -0
- package/dist/system/type-initializer.js +36 -0
- package/dist/system/uuid.d.ts +54 -38
- package/dist/system/uuid.js +120 -79
- package/dist/type-checking/primitive-type-checks.d.ts +17 -5
- package/dist/type-checking/primitive-type-checks.js +22 -15
- package/dist-unchecked/index.d.ts +2 -0
- package/dist-unchecked/index.js +2 -0
- package/dist-unchecked/system/argument-guards.d.ts +63 -0
- package/dist-unchecked/system/argument-guards.js +155 -0
- package/dist-unchecked/system/array-length.d.ts +6 -0
- package/dist-unchecked/system/array-length.js +17 -0
- package/dist-unchecked/system/big-integer.d.ts +50 -0
- package/dist-unchecked/system/big-integer.js +108 -0
- package/dist-unchecked/system/bind-receiver.d.ts +26 -0
- package/dist-unchecked/system/bind-receiver.js +30 -0
- package/dist-unchecked/system/boolean-format.d.ts +6 -0
- package/dist-unchecked/system/boolean-format.js +11 -0
- package/dist-unchecked/system/collections/builder-iterator.d.ts +14 -0
- package/dist-unchecked/system/collections/builder-iterator.js +15 -0
- package/dist-unchecked/system/collections/checks.d.ts +17 -0
- package/dist-unchecked/system/collections/checks.js +0 -0
- package/dist-unchecked/system/collections/close-collection.d.ts +33 -0
- package/dist-unchecked/system/collections/close-collection.js +68 -0
- package/dist-unchecked/system/collections/collection-type-name.d.ts +11 -0
- package/dist-unchecked/system/collections/collection-type-name.js +19 -0
- package/dist-unchecked/system/collections/concurrent-dictionary.d.ts +80 -0
- package/dist-unchecked/system/collections/concurrent-dictionary.js +261 -0
- package/dist-unchecked/system/collections/copy-to.d.ts +8 -0
- package/dist-unchecked/system/collections/copy-to.js +37 -0
- package/dist-unchecked/system/collections/default-comparer.d.ts +64 -0
- package/dist-unchecked/system/collections/default-comparer.js +231 -0
- package/dist-unchecked/system/collections/descriptors.d.ts +58 -0
- package/dist-unchecked/system/collections/descriptors.js +181 -0
- package/dist-unchecked/system/collections/dictionary-helpers.d.ts +15 -0
- package/dist-unchecked/system/collections/dictionary-helpers.js +17 -0
- package/dist-unchecked/system/collections/dictionary-views.d.ts +39 -0
- package/dist-unchecked/system/collections/dictionary-views.js +153 -0
- package/dist-unchecked/system/collections/dictionary.d.ts +68 -0
- package/dist-unchecked/system/collections/dictionary.js +164 -0
- package/dist-unchecked/system/collections/hash-core.d.ts +51 -0
- package/dist-unchecked/system/collections/hash-core.js +160 -0
- package/dist-unchecked/system/collections/hash-set.d.ts +56 -0
- package/dist-unchecked/system/collections/hash-set.js +165 -0
- package/dist-unchecked/system/collections/helpers.d.ts +29 -0
- package/dist-unchecked/system/collections/helpers.js +73 -0
- package/dist-unchecked/system/collections/immutable-array-builder.d.ts +37 -0
- package/dist-unchecked/system/collections/immutable-array-builder.js +117 -0
- package/dist-unchecked/system/collections/immutable-array.d.ts +74 -0
- package/dist-unchecked/system/collections/immutable-array.js +243 -0
- package/dist-unchecked/system/collections/immutable-dictionary-builder.d.ts +58 -0
- package/dist-unchecked/system/collections/immutable-dictionary-builder.js +125 -0
- package/dist-unchecked/system/collections/immutable-dictionary.d.ts +80 -0
- package/dist-unchecked/system/collections/immutable-dictionary.js +284 -0
- package/dist-unchecked/system/collections/immutable-hash-set-builder.d.ts +58 -0
- package/dist-unchecked/system/collections/immutable-hash-set-builder.js +124 -0
- package/dist-unchecked/system/collections/immutable-hash-set.d.ts +71 -0
- package/dist-unchecked/system/collections/immutable-hash-set.js +242 -0
- package/dist-unchecked/system/collections/immutable-interfaces.d.ts +51 -0
- package/dist-unchecked/system/collections/immutable-interfaces.js +0 -0
- package/dist-unchecked/system/collections/immutable-list-builder-core.d.ts +58 -0
- package/dist-unchecked/system/collections/immutable-list-builder-core.js +136 -0
- package/dist-unchecked/system/collections/immutable-list-builder.d.ts +35 -0
- package/dist-unchecked/system/collections/immutable-list-builder.js +72 -0
- package/dist-unchecked/system/collections/immutable-list-core.d.ts +98 -0
- package/dist-unchecked/system/collections/immutable-list-core.js +268 -0
- package/dist-unchecked/system/collections/immutable-list.d.ts +49 -0
- package/dist-unchecked/system/collections/immutable-list.js +176 -0
- package/dist-unchecked/system/collections/immutable-storage.d.ts +50 -0
- package/dist-unchecked/system/collections/immutable-storage.js +83 -0
- package/dist-unchecked/system/collections/index.d.ts +27 -0
- package/dist-unchecked/system/collections/index.js +24 -0
- package/dist-unchecked/system/collections/interfaces.d.ts +76 -0
- package/dist-unchecked/system/collections/interfaces.js +0 -0
- package/dist-unchecked/system/collections/list.d.ts +96 -0
- package/dist-unchecked/system/collections/list.js +332 -0
- package/dist-unchecked/system/collections/queue.d.ts +44 -0
- package/dist-unchecked/system/collections/queue.js +114 -0
- package/dist-unchecked/system/collections/read-only-list.d.ts +45 -0
- package/dist-unchecked/system/collections/read-only-list.js +152 -0
- package/dist-unchecked/system/collections/red-black-tree.d.ts +64 -0
- package/dist-unchecked/system/collections/red-black-tree.js +361 -0
- package/dist-unchecked/system/collections/set-algebra.d.ts +15 -0
- package/dist-unchecked/system/collections/set-algebra.js +58 -0
- package/dist-unchecked/system/collections/sorted-array.d.ts +14 -0
- package/dist-unchecked/system/collections/sorted-array.js +31 -0
- package/dist-unchecked/system/collections/sorted-dictionary.d.ts +64 -0
- package/dist-unchecked/system/collections/sorted-dictionary.js +161 -0
- package/dist-unchecked/system/collections/sorted-list.d.ts +131 -0
- package/dist-unchecked/system/collections/sorted-list.js +300 -0
- package/dist-unchecked/system/collections/sorted-set.d.ts +98 -0
- package/dist-unchecked/system/collections/sorted-set.js +253 -0
- package/dist-unchecked/system/collections/stack.d.ts +39 -0
- package/dist-unchecked/system/collections/stack.js +105 -0
- package/dist-unchecked/system/collections/throw-helpers.d.ts +77 -0
- package/dist-unchecked/system/collections/throw-helpers.js +158 -0
- package/dist-unchecked/system/date-time-offset.d.ts +23 -0
- package/dist-unchecked/system/date-time-offset.js +61 -0
- package/dist-unchecked/system/decimal-parsing.d.ts +18 -0
- package/dist-unchecked/system/decimal-parsing.js +74 -0
- package/dist-unchecked/system/decimal.d.ts +20 -0
- package/dist-unchecked/system/decimal.js +30 -0
- package/dist-unchecked/system/default-text.d.ts +11 -0
- package/dist-unchecked/system/default-text.js +52 -0
- package/dist-unchecked/system/delegates.d.ts +40 -0
- package/dist-unchecked/system/delegates.js +74 -0
- package/dist-unchecked/system/double-format.d.ts +20 -0
- package/dist-unchecked/system/double-format.js +171 -0
- package/dist-unchecked/system/dynamic-conversion.d.ts +37 -0
- package/dist-unchecked/system/dynamic-conversion.js +229 -0
- package/dist-unchecked/system/equality.d.ts +111 -0
- package/dist-unchecked/system/equality.js +392 -0
- package/dist-unchecked/system/exceptions/argument-exception.d.ts +17 -0
- package/dist-unchecked/system/exceptions/argument-exception.js +44 -0
- package/dist-unchecked/system/exceptions/argument-null-exception.d.ts +16 -0
- package/dist-unchecked/system/exceptions/argument-null-exception.js +35 -0
- package/dist-unchecked/system/exceptions/argument-out-of-range-exception.d.ts +18 -0
- package/dist-unchecked/system/exceptions/argument-out-of-range-exception.js +51 -0
- package/dist-unchecked/system/exceptions/arithmetic-exception.d.ts +12 -0
- package/dist-unchecked/system/exceptions/arithmetic-exception.js +31 -0
- package/dist-unchecked/system/exceptions/divide-by-zero-exception.d.ts +12 -0
- package/dist-unchecked/system/exceptions/divide-by-zero-exception.js +31 -0
- package/dist-unchecked/system/exceptions/exception.d.ts +38 -0
- package/dist-unchecked/system/exceptions/exception.js +77 -0
- package/dist-unchecked/system/exceptions/format-exception.d.ts +12 -0
- package/dist-unchecked/system/exceptions/format-exception.js +31 -0
- package/dist-unchecked/system/exceptions/index-out-of-range-exception.d.ts +12 -0
- package/dist-unchecked/system/exceptions/index-out-of-range-exception.js +31 -0
- package/dist-unchecked/system/exceptions/index.d.ts +26 -0
- package/dist-unchecked/system/exceptions/index.js +26 -0
- package/dist-unchecked/system/exceptions/invalid-cast-exception.d.ts +12 -0
- package/dist-unchecked/system/exceptions/invalid-cast-exception.js +31 -0
- package/dist-unchecked/system/exceptions/invalid-operation-exception.d.ts +12 -0
- package/dist-unchecked/system/exceptions/invalid-operation-exception.js +31 -0
- package/dist-unchecked/system/exceptions/json-exception.d.ts +18 -0
- package/dist-unchecked/system/exceptions/json-exception.js +39 -0
- package/dist-unchecked/system/exceptions/key-not-found-exception.d.ts +13 -0
- package/dist-unchecked/system/exceptions/key-not-found-exception.js +34 -0
- package/dist-unchecked/system/exceptions/message-value.d.ts +7 -0
- package/dist-unchecked/system/exceptions/message-value.js +9 -0
- package/dist-unchecked/system/exceptions/missing-method-exception.d.ts +19 -0
- package/dist-unchecked/system/exceptions/missing-method-exception.js +38 -0
- package/dist-unchecked/system/exceptions/named-exception.d.ts +7 -0
- package/dist-unchecked/system/exceptions/named-exception.js +29 -0
- package/dist-unchecked/system/exceptions/not-implemented-exception.d.ts +12 -0
- package/dist-unchecked/system/exceptions/not-implemented-exception.js +31 -0
- package/dist-unchecked/system/exceptions/not-supported-exception.d.ts +12 -0
- package/dist-unchecked/system/exceptions/not-supported-exception.js +31 -0
- package/dist-unchecked/system/exceptions/null-reference-exception.d.ts +12 -0
- package/dist-unchecked/system/exceptions/null-reference-exception.js +31 -0
- package/dist-unchecked/system/exceptions/object-disposed-exception.d.ts +18 -0
- package/dist-unchecked/system/exceptions/object-disposed-exception.js +41 -0
- package/dist-unchecked/system/exceptions/operation-canceled-exception.d.ts +12 -0
- package/dist-unchecked/system/exceptions/operation-canceled-exception.js +31 -0
- package/dist-unchecked/system/exceptions/overflow-exception.d.ts +15 -0
- package/dist-unchecked/system/exceptions/overflow-exception.js +34 -0
- package/dist-unchecked/system/exceptions/switch-expression-exception.d.ts +21 -0
- package/dist-unchecked/system/exceptions/switch-expression-exception.js +49 -0
- package/dist-unchecked/system/exceptions/system-exception.d.ts +12 -0
- package/dist-unchecked/system/exceptions/system-exception.js +31 -0
- package/dist-unchecked/system/exceptions/task-canceled-exception.d.ts +13 -0
- package/dist-unchecked/system/exceptions/task-canceled-exception.js +34 -0
- package/dist-unchecked/system/exceptions/timeout-exception.d.ts +12 -0
- package/dist-unchecked/system/exceptions/timeout-exception.js +31 -0
- package/dist-unchecked/system/exceptions/to-exception.d.ts +25 -0
- package/dist-unchecked/system/exceptions/to-exception.js +53 -0
- package/dist-unchecked/system/exceptions/type-initialization-exception.d.ts +19 -0
- package/dist-unchecked/system/exceptions/type-initialization-exception.js +36 -0
- package/dist-unchecked/system/hash-code.d.ts +28 -0
- package/dist-unchecked/system/hash-code.js +179 -0
- package/dist-unchecked/system/identity-memo.d.ts +7 -0
- package/dist-unchecked/system/identity-memo.js +14 -0
- package/dist-unchecked/system/index.d.ts +35 -0
- package/dist-unchecked/system/index.js +35 -0
- package/dist-unchecked/system/int64-convert.d.ts +59 -0
- package/dist-unchecked/system/int64-convert.js +226 -0
- package/dist-unchecked/system/int64-format.d.ts +13 -0
- package/dist-unchecked/system/int64-format.js +28 -0
- package/dist-unchecked/system/int64-math.d.ts +56 -0
- package/dist-unchecked/system/int64-math.js +109 -0
- package/dist-unchecked/system/int64-parsing.d.ts +45 -0
- package/dist-unchecked/system/int64-parsing.js +153 -0
- package/dist-unchecked/system/int64.d.ts +134 -0
- package/dist-unchecked/system/int64.js +298 -0
- package/dist-unchecked/system/integer-division.d.ts +20 -0
- package/dist-unchecked/system/integer-division.js +17 -0
- package/dist-unchecked/system/integer-format.d.ts +12 -0
- package/dist-unchecked/system/integer-format.js +22 -0
- package/dist-unchecked/system/integer-standard-format.d.ts +9 -0
- package/dist-unchecked/system/integer-standard-format.js +66 -0
- package/dist-unchecked/system/json/byte-array-converter.d.ts +19 -0
- package/dist-unchecked/system/json/byte-array-converter.js +106 -0
- package/dist-unchecked/system/json/container-depth.d.ts +30 -0
- package/dist-unchecked/system/json/container-depth.js +84 -0
- package/dist-unchecked/system/json/contract-name.d.ts +15 -0
- package/dist-unchecked/system/json/contract-name.js +33 -0
- package/dist-unchecked/system/json/converter-set-cache.d.ts +17 -0
- package/dist-unchecked/system/json/converter-set-cache.js +26 -0
- package/dist-unchecked/system/json/converters.d.ts +52 -0
- package/dist-unchecked/system/json/converters.js +677 -0
- package/dist-unchecked/system/json/decimal-text.d.ts +9 -0
- package/dist-unchecked/system/json/decimal-text.js +125 -0
- package/dist-unchecked/system/json/dictionary-keys.d.ts +31 -0
- package/dist-unchecked/system/json/dictionary-keys.js +195 -0
- package/dist-unchecked/system/json/errors.d.ts +18 -0
- package/dist-unchecked/system/json/errors.js +18 -0
- package/dist-unchecked/system/json/exact-json-number.d.ts +103 -0
- package/dist-unchecked/system/json/exact-json-number.js +155 -0
- package/dist-unchecked/system/json/exact-number-reads.d.ts +21 -0
- package/dist-unchecked/system/json/exact-number-reads.js +104 -0
- package/dist-unchecked/system/json/index.d.ts +7 -0
- package/dist-unchecked/system/json/index.js +6 -0
- package/dist-unchecked/system/json/json-serializer.d.ts +102 -0
- package/dist-unchecked/system/json/json-serializer.js +114 -0
- package/dist-unchecked/system/json/json-text-reader.d.ts +33 -0
- package/dist-unchecked/system/json/json-text-reader.js +608 -0
- package/dist-unchecked/system/json/null-reads.d.ts +22 -0
- package/dist-unchecked/system/json/null-reads.js +43 -0
- package/dist-unchecked/system/json/number-from-string.d.ts +44 -0
- package/dist-unchecked/system/json/number-from-string.js +248 -0
- package/dist-unchecked/system/json/numeric-converters.d.ts +65 -0
- package/dist-unchecked/system/json/numeric-converters.js +361 -0
- package/dist-unchecked/system/json/numeric-enum-members.d.ts +18 -0
- package/dist-unchecked/system/json/numeric-enum-members.js +18 -0
- package/dist-unchecked/system/json/ordinal-ignore-case.d.ts +14 -0
- package/dist-unchecked/system/json/ordinal-ignore-case.js +60 -0
- package/dist-unchecked/system/json/polymorphism.d.ts +26 -0
- package/dist-unchecked/system/json/polymorphism.js +430 -0
- package/dist-unchecked/system/json/property-lookup.d.ts +17 -0
- package/dist-unchecked/system/json/property-lookup.js +32 -0
- package/dist-unchecked/system/json/property-naming-policy.d.ts +14 -0
- package/dist-unchecked/system/json/property-naming-policy.js +206 -0
- package/dist-unchecked/system/json/public-json-shape.d.ts +13 -0
- package/dist-unchecked/system/json/public-json-shape.js +38 -0
- package/dist-unchecked/system/json/serializer-context.d.ts +59 -0
- package/dist-unchecked/system/json/serializer-context.js +85 -0
- package/dist-unchecked/system/json/spec-kind.d.ts +3 -0
- package/dist-unchecked/system/json/spec-kind.js +4 -0
- package/dist-unchecked/system/json/temporal-reads.d.ts +15 -0
- package/dist-unchecked/system/json/temporal-reads.js +423 -0
- package/dist-unchecked/system/json/temporal-text.d.ts +16 -0
- package/dist-unchecked/system/json/temporal-text.js +32 -0
- package/dist-unchecked/system/json/types.d.ts +347 -0
- package/dist-unchecked/system/json/types.js +0 -0
- package/dist-unchecked/system/json/value-converter.d.ts +5 -0
- package/dist-unchecked/system/json/value-converter.js +0 -0
- package/dist-unchecked/system/lazy-value.d.ts +9 -0
- package/dist-unchecked/system/lazy-value.js +19 -0
- package/dist-unchecked/system/linq/compare-keys.d.ts +8 -0
- package/dist-unchecked/system/linq/compare-keys.js +37 -0
- package/dist-unchecked/system/linq/decimal-terminals.d.ts +24 -0
- package/dist-unchecked/system/linq/decimal-terminals.js +67 -0
- package/dist-unchecked/system/linq/expr-tree-visitor.d.ts +148 -0
- package/dist-unchecked/system/linq/expr-tree-visitor.js +479 -0
- package/dist-unchecked/system/linq/expr-tree.d.ts +166 -0
- package/dist-unchecked/system/linq/expr-tree.js +18 -0
- package/dist-unchecked/system/linq/index.d.ts +32 -0
- package/dist-unchecked/system/linq/index.js +27 -0
- package/dist-unchecked/system/linq/int64-terminals.d.ts +33 -0
- package/dist-unchecked/system/linq/int64-terminals.js +131 -0
- package/dist-unchecked/system/linq/linq.d.ts +107 -0
- package/dist-unchecked/system/linq/linq.js +46 -0
- package/dist-unchecked/system/linq/operators.d.ts +40 -0
- package/dist-unchecked/system/linq/operators.js +410 -0
- package/dist-unchecked/system/linq/terminals.d.ts +100 -0
- package/dist-unchecked/system/linq/terminals.js +467 -0
- package/dist-unchecked/system/linq/types.d.ts +330 -0
- package/dist-unchecked/system/linq/types.js +0 -0
- package/dist-unchecked/system/math.d.ts +55 -0
- package/dist-unchecked/system/math.js +141 -0
- package/dist-unchecked/system/number-parsing.d.ts +58 -0
- package/dist-unchecked/system/number-parsing.js +174 -0
- package/dist-unchecked/system/record-copy.d.ts +26 -0
- package/dist-unchecked/system/record-copy.js +72 -0
- package/dist-unchecked/system/reflection/box.d.ts +19 -0
- package/dist-unchecked/system/reflection/box.js +32 -0
- package/dist-unchecked/system/reflection/boxed-text.d.ts +8 -0
- package/dist-unchecked/system/reflection/boxed-text.js +31 -0
- package/dist-unchecked/system/reflection/cast-to.d.ts +15 -0
- package/dist-unchecked/system/reflection/cast-to.js +32 -0
- package/dist-unchecked/system/reflection/constructor-descriptor.d.ts +11 -0
- package/dist-unchecked/system/reflection/constructor-descriptor.js +22 -0
- package/dist-unchecked/system/reflection/create-instance.d.ts +6 -0
- package/dist-unchecked/system/reflection/create-instance.js +11 -0
- package/dist-unchecked/system/reflection/decimal-type-defaults.d.ts +7 -0
- package/dist-unchecked/system/reflection/decimal-type-defaults.js +17 -0
- package/dist-unchecked/system/reflection/enum-from-raw.d.ts +14 -0
- package/dist-unchecked/system/reflection/enum-from-raw.js +89 -0
- package/dist-unchecked/system/reflection/enum-is-defined.d.ts +7 -0
- package/dist-unchecked/system/reflection/enum-is-defined.js +14 -0
- package/dist-unchecked/system/reflection/get-number-type.d.ts +7 -0
- package/dist-unchecked/system/reflection/get-number-type.js +10 -0
- package/dist-unchecked/system/reflection/get-runtime-type-from-type.d.ts +6 -0
- package/dist-unchecked/system/reflection/get-runtime-type-from-type.js +22 -0
- package/dist-unchecked/system/reflection/get-runtime-type.d.ts +3 -0
- package/dist-unchecked/system/reflection/get-runtime-type.js +105 -0
- package/dist-unchecked/system/reflection/implements-interface.d.ts +10 -0
- package/dist-unchecked/system/reflection/implements-interface.js +26 -0
- package/dist-unchecked/system/reflection/index.d.ts +27 -0
- package/dist-unchecked/system/reflection/index.js +26 -0
- package/dist-unchecked/system/reflection/invalid-cast.d.ts +8 -0
- package/dist-unchecked/system/reflection/invalid-cast.js +33 -0
- package/dist-unchecked/system/reflection/is-assignable-from.d.ts +13 -0
- package/dist-unchecked/system/reflection/is-assignable-from.js +121 -0
- package/dist-unchecked/system/reflection/is-box-of.d.ts +3 -0
- package/dist-unchecked/system/reflection/is-box-of.js +5 -0
- package/dist-unchecked/system/reflection/is-boxed.d.ts +7 -0
- package/dist-unchecked/system/reflection/is-boxed.js +9 -0
- package/dist-unchecked/system/reflection/is-type.d.ts +12 -0
- package/dist-unchecked/system/reflection/is-type.js +20 -0
- package/dist-unchecked/system/reflection/nullable-type.d.ts +3 -0
- package/dist-unchecked/system/reflection/nullable-type.js +19 -0
- package/dist-unchecked/system/reflection/opaque-type.d.ts +6 -0
- package/dist-unchecked/system/reflection/opaque-type.js +22 -0
- package/dist-unchecked/system/reflection/primitive-types.d.ts +20 -0
- package/dist-unchecked/system/reflection/primitive-types.js +160 -0
- package/dist-unchecked/system/reflection/runtime-type.d.ts +131 -0
- package/dist-unchecked/system/reflection/runtime-type.js +5 -0
- package/dist-unchecked/system/reflection/specialize-collection.d.ts +11 -0
- package/dist-unchecked/system/reflection/specialize-collection.js +93 -0
- package/dist-unchecked/system/reflection/specialize.d.ts +7 -0
- package/dist-unchecked/system/reflection/specialize.js +33 -0
- package/dist-unchecked/system/reflection/temporal-type-defaults.d.ts +11 -0
- package/dist-unchecked/system/reflection/temporal-type-defaults.js +61 -0
- package/dist-unchecked/system/reflection/temporal-types.d.ts +7 -0
- package/dist-unchecked/system/reflection/temporal-types.js +44 -0
- package/dist-unchecked/system/reflection/to-string-tag.d.ts +6 -0
- package/dist-unchecked/system/reflection/to-string-tag.js +8 -0
- package/dist-unchecked/system/reflection/tuple-type.d.ts +6 -0
- package/dist-unchecked/system/reflection/tuple-type.js +23 -0
- package/dist-unchecked/system/reflection/unbox-for-cast.d.ts +10 -0
- package/dist-unchecked/system/reflection/unbox-for-cast.js +28 -0
- package/dist-unchecked/system/reflection/unbox-for.d.ts +9 -0
- package/dist-unchecked/system/reflection/unbox-for.js +15 -0
- package/dist-unchecked/system/reflection/unbox.d.ts +5 -0
- package/dist-unchecked/system/reflection/unbox.js +8 -0
- package/dist-unchecked/system/reflection/unsupported-type.d.ts +7 -0
- package/dist-unchecked/system/reflection/unsupported-type.js +27 -0
- package/dist-unchecked/system/reflection/well-known-types.d.ts +13 -0
- package/dist-unchecked/system/reflection/well-known-types.js +32 -0
- package/dist-unchecked/system/reflection/with-implementers.d.ts +8 -0
- package/dist-unchecked/system/reflection/with-implementers.js +23 -0
- package/dist-unchecked/system/standard-numeric-format.d.ts +67 -0
- package/dist-unchecked/system/standard-numeric-format.js +213 -0
- package/dist-unchecked/system/string-members.d.ts +170 -0
- package/dist-unchecked/system/string-members.js +445 -0
- package/dist-unchecked/system/strings.d.ts +42 -0
- package/dist-unchecked/system/strings.js +66 -0
- package/dist-unchecked/system/temporal-helpers.d.ts +43 -0
- package/dist-unchecked/system/temporal-helpers.js +127 -0
- package/dist-unchecked/system/time-span-format.d.ts +3 -0
- package/dist-unchecked/system/time-span-format.js +17 -0
- package/dist-unchecked/system/time-span.d.ts +33 -0
- package/dist-unchecked/system/time-span.js +90 -0
- package/dist-unchecked/system/type-initializer.d.ts +14 -0
- package/dist-unchecked/system/type-initializer.js +36 -0
- package/dist-unchecked/system/uuid.d.ts +68 -0
- package/dist-unchecked/system/uuid.js +124 -0
- package/dist-unchecked/type-checking/index.d.ts +1 -0
- package/dist-unchecked/type-checking/index.js +1 -0
- package/dist-unchecked/type-checking/primitive-type-checks.d.ts +45 -0
- package/dist-unchecked/type-checking/primitive-type-checks.js +81 -0
- package/package.json +88 -10
- package/src/index.ts +2 -0
- package/src/system/argument-guards.ts +253 -0
- package/src/system/array-length.ts +19 -0
- package/src/system/big-integer.ts +135 -0
- package/src/system/bind-receiver.ts +32 -0
- package/src/system/boolean-format.ts +13 -0
- package/src/system/collections/builder-iterator.ts +30 -0
- package/src/system/collections/checks.ts +18 -0
- package/src/system/collections/close-collection.ts +127 -0
- package/src/system/collections/collection-type-name.ts +37 -0
- package/src/system/collections/concurrent-dictionary.ts +396 -0
- package/src/system/collections/copy-to.ts +52 -0
- package/src/system/collections/default-comparer.ts +334 -0
- package/src/system/collections/descriptors.ts +310 -0
- package/src/system/collections/dictionary-helpers.ts +18 -0
- package/src/system/collections/dictionary-views.ts +231 -0
- package/src/system/collections/dictionary.ts +325 -0
- package/src/system/collections/hash-core.ts +232 -0
- package/src/system/collections/hash-set.ts +302 -0
- package/src/system/collections/helpers.ts +92 -0
- package/src/system/collections/immutable-array-builder.ts +160 -0
- package/src/system/collections/immutable-array.ts +352 -0
- package/src/system/collections/immutable-dictionary-builder.ts +238 -0
- package/src/system/collections/immutable-dictionary.ts +493 -0
- package/src/system/collections/immutable-hash-set-builder.ts +218 -0
- package/src/system/collections/immutable-hash-set.ts +362 -0
- package/src/system/collections/immutable-interfaces.ts +58 -0
- package/src/system/collections/immutable-list-builder-core.ts +204 -0
- package/src/system/collections/immutable-list-builder.ts +146 -0
- package/src/system/collections/immutable-list-core.ts +419 -0
- package/src/system/collections/immutable-list.ts +257 -0
- package/src/system/collections/immutable-storage.ts +107 -0
- package/src/system/collections/index.ts +27 -0
- package/src/system/collections/interfaces.ts +84 -0
- package/src/system/collections/list.ts +680 -0
- package/src/system/collections/queue.ts +240 -0
- package/src/system/collections/read-only-list.ts +210 -0
- package/src/system/collections/red-black-tree.ts +485 -0
- package/src/system/collections/set-algebra.ts +89 -0
- package/src/system/collections/sorted-array.ts +43 -0
- package/src/system/collections/sorted-dictionary.ts +322 -0
- package/src/system/collections/sorted-list.ts +566 -0
- package/src/system/collections/sorted-set.ts +483 -0
- package/src/system/collections/stack.ts +201 -0
- package/src/system/collections/throw-helpers.ts +240 -0
- package/src/system/date-time-offset.ts +102 -0
- package/src/system/decimal-parsing.ts +102 -0
- package/src/system/decimal.ts +36 -0
- package/src/system/default-text.ts +73 -0
- package/src/system/delegates.ts +83 -0
- package/src/system/double-format.ts +234 -0
- package/src/system/dynamic-conversion.ts +337 -0
- package/src/system/equality.ts +448 -0
- package/src/system/exceptions/argument-exception.ts +51 -0
- package/src/system/exceptions/argument-null-exception.ts +42 -0
- package/src/system/exceptions/argument-out-of-range-exception.ts +65 -0
- package/src/system/exceptions/arithmetic-exception.ts +37 -0
- package/src/system/exceptions/divide-by-zero-exception.ts +38 -0
- package/src/system/exceptions/exception.ts +91 -0
- package/src/system/exceptions/format-exception.ts +37 -0
- package/src/system/exceptions/index-out-of-range-exception.ts +38 -0
- package/src/system/exceptions/index.ts +26 -0
- package/src/system/exceptions/invalid-cast-exception.ts +38 -0
- package/src/system/exceptions/invalid-operation-exception.ts +39 -0
- package/src/system/exceptions/json-exception.ts +46 -0
- package/src/system/exceptions/key-not-found-exception.ts +42 -0
- package/src/system/exceptions/message-value.ts +9 -0
- package/src/system/exceptions/missing-method-exception.ts +45 -0
- package/src/system/exceptions/named-exception.ts +43 -0
- package/src/system/exceptions/not-implemented-exception.ts +38 -0
- package/src/system/exceptions/not-supported-exception.ts +38 -0
- package/src/system/exceptions/null-reference-exception.ts +38 -0
- package/src/system/exceptions/object-disposed-exception.ts +49 -0
- package/src/system/exceptions/operation-canceled-exception.ts +38 -0
- package/src/system/exceptions/overflow-exception.ts +40 -0
- package/src/system/exceptions/switch-expression-exception.ts +62 -0
- package/src/system/exceptions/system-exception.ts +37 -0
- package/src/system/exceptions/task-canceled-exception.ts +42 -0
- package/src/system/exceptions/timeout-exception.ts +37 -0
- package/src/system/exceptions/to-exception.ts +70 -0
- package/src/system/exceptions/type-initialization-exception.ts +42 -0
- package/src/system/hash-code.ts +202 -0
- package/src/system/identity-memo.ts +25 -0
- package/src/system/index.ts +35 -0
- package/src/system/int64-convert.ts +326 -0
- package/src/system/int64-format.ts +37 -0
- package/src/system/int64-math.ts +137 -0
- package/src/system/int64-parsing.ts +243 -0
- package/src/system/int64.ts +446 -0
- package/src/system/integer-division.ts +41 -0
- package/src/system/integer-format.ts +34 -0
- package/src/system/integer-standard-format.ts +103 -0
- package/src/system/json/byte-array-converter.ts +148 -0
- package/src/system/json/container-depth.ts +101 -0
- package/src/system/json/contract-name.ts +39 -0
- package/src/system/json/converter-set-cache.ts +55 -0
- package/src/system/json/converters.ts +1040 -0
- package/src/system/json/decimal-text.ts +174 -0
- package/src/system/json/dictionary-keys.ts +293 -0
- package/src/system/json/errors.ts +19 -0
- package/src/system/json/exact-json-number.ts +196 -0
- package/src/system/json/exact-number-reads.ts +136 -0
- package/src/system/json/index.ts +35 -0
- package/src/system/json/json-serializer.ts +259 -0
- package/src/system/json/json-text-reader.ts +799 -0
- package/src/system/json/null-reads.ts +47 -0
- package/src/system/json/number-from-string.ts +372 -0
- package/src/system/json/numeric-converters.ts +495 -0
- package/src/system/json/numeric-enum-members.ts +35 -0
- package/src/system/json/ordinal-ignore-case.ts +74 -0
- package/src/system/json/polymorphism.ts +650 -0
- package/src/system/json/property-lookup.ts +63 -0
- package/src/system/json/property-naming-policy.ts +258 -0
- package/src/system/json/public-json-shape.ts +43 -0
- package/src/system/json/serializer-context.ts +105 -0
- package/src/system/json/spec-kind.ts +6 -0
- package/src/system/json/temporal-reads.ts +606 -0
- package/src/system/json/temporal-text.ts +48 -0
- package/src/system/json/types.ts +433 -0
- package/src/system/json/value-converter.ts +5 -0
- package/src/system/lazy-value.ts +21 -0
- package/src/system/linq/compare-keys.ts +38 -0
- package/src/system/linq/decimal-terminals.ts +122 -0
- package/src/system/linq/expr-tree-visitor.ts +568 -0
- package/src/system/linq/expr-tree.ts +213 -0
- package/src/system/linq/index.ts +181 -0
- package/src/system/linq/int64-terminals.ts +199 -0
- package/src/system/linq/linq.ts +1816 -0
- package/src/system/linq/operators.ts +491 -0
- package/src/system/linq/terminals.ts +672 -0
- package/src/system/linq/types.ts +484 -0
- package/src/system/math.ts +182 -0
- package/src/system/number-parsing.ts +242 -0
- package/src/system/record-copy.ts +89 -0
- package/src/system/reflection/box.ts +38 -0
- package/src/system/reflection/boxed-text.ts +42 -0
- package/src/system/reflection/cast-to.ts +43 -0
- package/src/system/reflection/constructor-descriptor.ts +28 -0
- package/src/system/reflection/create-instance.ts +14 -0
- package/src/system/reflection/decimal-type-defaults.ts +20 -0
- package/src/system/reflection/enum-from-raw.ts +131 -0
- package/src/system/reflection/enum-is-defined.ts +18 -0
- package/src/system/reflection/get-number-type.ts +12 -0
- package/src/system/reflection/get-runtime-type-from-type.ts +33 -0
- package/src/system/reflection/get-runtime-type.ts +145 -0
- package/src/system/reflection/implements-interface.ts +40 -0
- package/src/system/reflection/index.ts +44 -0
- package/src/system/reflection/invalid-cast.ts +46 -0
- package/src/system/reflection/is-assignable-from.ts +161 -0
- package/src/system/reflection/is-box-of.ts +7 -0
- package/src/system/reflection/is-boxed.ts +17 -0
- package/src/system/reflection/is-type.ts +25 -0
- package/src/system/reflection/nullable-type.ts +27 -0
- package/src/system/reflection/opaque-type.ts +30 -0
- package/src/system/reflection/primitive-types.ts +197 -0
- package/src/system/reflection/runtime-type.ts +220 -0
- package/src/system/reflection/specialize-collection.ts +161 -0
- package/src/system/reflection/specialize.ts +52 -0
- package/src/system/reflection/temporal-type-defaults.ts +78 -0
- package/src/system/reflection/temporal-types.ts +57 -0
- package/src/system/reflection/to-string-tag.ts +8 -0
- package/src/system/reflection/tuple-type.ts +32 -0
- package/src/system/reflection/unbox-for-cast.ts +31 -0
- package/src/system/reflection/unbox-for.ts +19 -0
- package/src/system/reflection/unbox.ts +9 -0
- package/src/system/reflection/unsupported-type.ts +35 -0
- package/src/system/reflection/well-known-types.ts +50 -0
- package/src/system/reflection/with-implementers.ts +33 -0
- package/src/system/standard-numeric-format.ts +334 -0
- package/src/system/string-members.ts +641 -0
- package/src/system/strings.ts +83 -0
- package/src/system/temporal-helpers.ts +183 -0
- package/src/system/time-span-format.ts +21 -0
- package/src/system/time-span.ts +126 -0
- package/src/system/type-initializer.ts +41 -0
- package/src/system/uuid.ts +163 -0
- package/src/type-checking/index.ts +1 -0
- package/src/type-checking/primitive-type-checks.ts +113 -0
- package/dist/system/collections/immutable-collection.d.ts +0 -31
- package/dist/system/collections/immutable-collection.js +0 -58
- package/dist/system/collections/list-helpers.d.ts +0 -43
- package/dist/system/collections/list-helpers.js +0 -58
- package/dist/system/json/union-guard-registry.d.ts +0 -30
- package/dist/system/json/union-guard-registry.js +0 -34
|
@@ -9,7 +9,10 @@
|
|
|
9
9
|
* Short-circuit terminals (`first`, `any`, `contains`) stop iterating
|
|
10
10
|
* as soon as the answer is known.
|
|
11
11
|
*/
|
|
12
|
+
import { Dictionary } from "../collections/dictionary.js";
|
|
12
13
|
import { HashSet } from "../collections/hash-set.js";
|
|
14
|
+
import { List } from "../collections/list.js";
|
|
15
|
+
import { InvalidOperationException } from "../exceptions/invalid-operation-exception.js";
|
|
13
16
|
import { compareKeys } from "./compare-keys.js";
|
|
14
17
|
export function toArray() {
|
|
15
18
|
return {
|
|
@@ -38,6 +41,38 @@ export function toSet() {
|
|
|
38
41
|
apply: (source) => new HashSet(source),
|
|
39
42
|
};
|
|
40
43
|
}
|
|
44
|
+
/** `ToList()`: a new runtime `List` holding the elements in order (spec 011 § LINQ terminals). */
|
|
45
|
+
export function toList(typeArguments) {
|
|
46
|
+
return {
|
|
47
|
+
kind: "toList",
|
|
48
|
+
apply: (source) => List.of([...source], typeArguments),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export function toDictionary(keySelector, valueSelector, keyQueryable, valueQueryable, typeArguments) {
|
|
52
|
+
const selectValue = valueSelector ?? ((item) => item);
|
|
53
|
+
function materialize(source) {
|
|
54
|
+
const dictionary = new Dictionary(null, null, typeArguments);
|
|
55
|
+
for (const item of source) {
|
|
56
|
+
dictionary.add(keySelector(item), selectValue(item));
|
|
57
|
+
}
|
|
58
|
+
return dictionary;
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
kind: "toDictionary",
|
|
62
|
+
keySelector,
|
|
63
|
+
valueSelector: selectValue,
|
|
64
|
+
keyQueryable,
|
|
65
|
+
valueQueryable,
|
|
66
|
+
apply: materialize,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/** `ToHashSet()`: a new runtime `HashSet`; duplicates collapse. */
|
|
70
|
+
export function toHashSet(typeArguments) {
|
|
71
|
+
return {
|
|
72
|
+
kind: "toHashSet",
|
|
73
|
+
apply: (source) => HashSet.from(source, null, typeArguments),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
41
76
|
export function first(predicate, queryable) {
|
|
42
77
|
return {
|
|
43
78
|
kind: "first",
|
|
@@ -47,7 +82,7 @@ export function first(predicate, queryable) {
|
|
|
47
82
|
for (const item of source)
|
|
48
83
|
if (!predicate || predicate(item))
|
|
49
84
|
return item;
|
|
50
|
-
throw
|
|
85
|
+
throw noElementException(predicate != null);
|
|
51
86
|
},
|
|
52
87
|
};
|
|
53
88
|
}
|
|
@@ -79,7 +114,7 @@ export function last(predicate, queryable) {
|
|
|
79
114
|
found = true;
|
|
80
115
|
}
|
|
81
116
|
if (!found)
|
|
82
|
-
throw
|
|
117
|
+
throw noElementException(predicate != null);
|
|
83
118
|
return result;
|
|
84
119
|
},
|
|
85
120
|
};
|
|
@@ -112,7 +147,7 @@ export function singleOrDefault(predicate, defaultValue = null, queryable) {
|
|
|
112
147
|
if (!predicate || predicate(item)) {
|
|
113
148
|
result = item;
|
|
114
149
|
if (++count > 1)
|
|
115
|
-
throw
|
|
150
|
+
throw moreThanOneElementException(predicate != null);
|
|
116
151
|
}
|
|
117
152
|
return result;
|
|
118
153
|
},
|
|
@@ -130,10 +165,10 @@ export function single(predicate, queryable) {
|
|
|
130
165
|
if (!predicate || predicate(item)) {
|
|
131
166
|
result = item;
|
|
132
167
|
if (++count > 1)
|
|
133
|
-
throw
|
|
168
|
+
throw moreThanOneElementException(predicate != null);
|
|
134
169
|
}
|
|
135
170
|
if (count === 0)
|
|
136
|
-
throw
|
|
171
|
+
throw noElementException(predicate != null);
|
|
137
172
|
return result;
|
|
138
173
|
},
|
|
139
174
|
};
|
|
@@ -178,6 +213,10 @@ export function count(predicate, queryable) {
|
|
|
178
213
|
},
|
|
179
214
|
};
|
|
180
215
|
}
|
|
216
|
+
/**
|
|
217
|
+
* `Sum()` / `Sum(selector)` over `int`, `double`, … and their nullable forms: nulls count as
|
|
218
|
+
* zero, an empty sequence is `0`. The `decimal` and 64-bit sums are `sumDecimal` and `sumInt64`.
|
|
219
|
+
*/
|
|
181
220
|
export function sum(selector, queryable) {
|
|
182
221
|
return {
|
|
183
222
|
kind: "sum",
|
|
@@ -186,105 +225,126 @@ export function sum(selector, queryable) {
|
|
|
186
225
|
apply: (source) => {
|
|
187
226
|
let total = 0;
|
|
188
227
|
for (const item of source)
|
|
189
|
-
total += selector ? selector(item) : item;
|
|
228
|
+
total += (selector ? selector(item) : item) ?? 0;
|
|
190
229
|
return total;
|
|
191
230
|
},
|
|
192
231
|
};
|
|
193
232
|
}
|
|
233
|
+
/**
|
|
234
|
+
* `Min()` / `Min(selector)` over a sequence of non-nullable values: numbers, strings, `decimal`s,
|
|
235
|
+
* dates, anything ordered. Nulls are skipped; a `NaN` wins, as in .NET.
|
|
236
|
+
*
|
|
237
|
+
* @throws InvalidOperationException for an empty sequence.
|
|
238
|
+
*/
|
|
194
239
|
export function min(selector, queryable) {
|
|
195
240
|
return {
|
|
196
241
|
kind: "min",
|
|
197
242
|
selector,
|
|
198
243
|
queryable,
|
|
199
|
-
apply: (source) =>
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
244
|
+
apply: (source) => requireValue(smallest(valuesOf(source, selector))),
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* `Min()` / `Min(selector)` over `int?`, `string`, a class, …: nulls are skipped and
|
|
249
|
+
* `null` is the result when no value is left.
|
|
250
|
+
*/
|
|
251
|
+
export function minNullable(selector, queryable) {
|
|
252
|
+
return {
|
|
253
|
+
kind: "min",
|
|
254
|
+
selector,
|
|
255
|
+
queryable,
|
|
256
|
+
apply: (source) => (smallest(valuesOf(source, selector)) ?? null),
|
|
208
257
|
};
|
|
209
258
|
}
|
|
259
|
+
/**
|
|
260
|
+
* `Max()` / `Max(selector)` over a sequence of non-nullable values. Nulls are skipped; a `NaN`
|
|
261
|
+
* loses to any other value, as in .NET.
|
|
262
|
+
*
|
|
263
|
+
* @throws InvalidOperationException for an empty sequence.
|
|
264
|
+
*/
|
|
210
265
|
export function max(selector, queryable) {
|
|
211
266
|
return {
|
|
212
267
|
kind: "max",
|
|
213
268
|
selector,
|
|
214
269
|
queryable,
|
|
215
|
-
apply: (source) =>
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
270
|
+
apply: (source) => requireValue(largest(valuesOf(source, selector))),
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
/** `Max()` / `Max(selector)` over `int?`, `string`, a class, …: `null` when no value is left. */
|
|
274
|
+
export function maxNullable(selector, queryable) {
|
|
275
|
+
return {
|
|
276
|
+
kind: "max",
|
|
277
|
+
selector,
|
|
278
|
+
queryable,
|
|
279
|
+
apply: (source) => (largest(valuesOf(source, selector)) ?? null),
|
|
224
280
|
};
|
|
225
281
|
}
|
|
282
|
+
/**
|
|
283
|
+
* `MinBy(keySelector)` over a value-typed element: the first element with the smallest key.
|
|
284
|
+
* A `null` key is skipped; when every key is null the first element is the result.
|
|
285
|
+
*
|
|
286
|
+
* @throws InvalidOperationException for an empty sequence.
|
|
287
|
+
*/
|
|
226
288
|
export function minBy(keySelector, queryable) {
|
|
227
289
|
return {
|
|
228
290
|
kind: "minBy",
|
|
229
291
|
keySelector,
|
|
230
292
|
queryable,
|
|
231
|
-
apply: (source) =>
|
|
232
|
-
let result;
|
|
233
|
-
let minKey;
|
|
234
|
-
let found = false;
|
|
235
|
-
for (const item of source) {
|
|
236
|
-
const key = keySelector(item);
|
|
237
|
-
if (!found || compareKeys(key, minKey) < 0) {
|
|
238
|
-
result = item;
|
|
239
|
-
minKey = key;
|
|
240
|
-
found = true;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
if (!found)
|
|
244
|
-
throw new Error("Sequence contains no elements");
|
|
245
|
-
return result;
|
|
246
|
-
},
|
|
293
|
+
apply: (source) => requireValue(extremeBy(source, keySelector, -1)),
|
|
247
294
|
};
|
|
248
295
|
}
|
|
296
|
+
/** `MinBy(keySelector)` over a reference or nullable element: `null` for an empty sequence. */
|
|
297
|
+
export function minByNullable(keySelector, queryable) {
|
|
298
|
+
return {
|
|
299
|
+
kind: "minBy",
|
|
300
|
+
keySelector,
|
|
301
|
+
queryable,
|
|
302
|
+
apply: (source) => extremeBy(source, keySelector, -1) ?? null,
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* `MaxBy(keySelector)` over a value-typed element: the first element with the largest key.
|
|
307
|
+
*
|
|
308
|
+
* @throws InvalidOperationException for an empty sequence.
|
|
309
|
+
*/
|
|
249
310
|
export function maxBy(keySelector, queryable) {
|
|
250
311
|
return {
|
|
251
312
|
kind: "maxBy",
|
|
252
313
|
keySelector,
|
|
253
314
|
queryable,
|
|
254
|
-
apply: (source) =>
|
|
255
|
-
let result;
|
|
256
|
-
let maxKey;
|
|
257
|
-
let found = false;
|
|
258
|
-
for (const item of source) {
|
|
259
|
-
const key = keySelector(item);
|
|
260
|
-
if (!found || compareKeys(key, maxKey) > 0) {
|
|
261
|
-
result = item;
|
|
262
|
-
maxKey = key;
|
|
263
|
-
found = true;
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
if (!found)
|
|
267
|
-
throw new Error("Sequence contains no elements");
|
|
268
|
-
return result;
|
|
269
|
-
},
|
|
315
|
+
apply: (source) => requireValue(extremeBy(source, keySelector, 1)),
|
|
270
316
|
};
|
|
271
317
|
}
|
|
318
|
+
/** `MaxBy(keySelector)` over a reference or nullable element: `null` for an empty sequence. */
|
|
319
|
+
export function maxByNullable(keySelector, queryable) {
|
|
320
|
+
return {
|
|
321
|
+
kind: "maxBy",
|
|
322
|
+
keySelector,
|
|
323
|
+
queryable,
|
|
324
|
+
apply: (source) => extremeBy(source, keySelector, 1) ?? null,
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* `Average()` / `Average(selector)` over `int`, `double`, …: the sum as a `number`, divided by
|
|
329
|
+
* the count. The `decimal` and 64-bit averages are `averageDecimal` and `averageInt64`.
|
|
330
|
+
*
|
|
331
|
+
* @throws InvalidOperationException for an empty sequence.
|
|
332
|
+
*/
|
|
272
333
|
export function average(selector, queryable) {
|
|
273
334
|
return {
|
|
274
335
|
kind: "average",
|
|
275
336
|
selector,
|
|
276
337
|
queryable,
|
|
277
|
-
apply: (source) =>
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
},
|
|
338
|
+
apply: (source) => requireValue(averageOf(valuesOf(source, selector))),
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
/** `Average()` / `Average(selector)` over `int?`, `double?`, …: nulls skipped; `null` when none is left. */
|
|
342
|
+
export function averageNullable(selector, queryable) {
|
|
343
|
+
return {
|
|
344
|
+
kind: "average",
|
|
345
|
+
selector,
|
|
346
|
+
queryable,
|
|
347
|
+
apply: (source) => averageOf(valuesOf(source, selector)),
|
|
288
348
|
};
|
|
289
349
|
}
|
|
290
350
|
export function contains(value) {
|
|
@@ -312,3 +372,96 @@ export function aggregate(seed, accumulator) {
|
|
|
312
372
|
},
|
|
313
373
|
};
|
|
314
374
|
}
|
|
375
|
+
/** The non-null values of `source`, through `selector` when there is one. */
|
|
376
|
+
function* valuesOf(source, selector) {
|
|
377
|
+
for (const item of source) {
|
|
378
|
+
const value = selector ? selector(item) : item;
|
|
379
|
+
if (value != null)
|
|
380
|
+
yield value;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
/** `value` for a sequence that had one, .NET's exception for one that had none. */
|
|
384
|
+
function requireValue(value) {
|
|
385
|
+
if (value === undefined || value === null)
|
|
386
|
+
throw new InvalidOperationException(NO_ELEMENTS_MESSAGE);
|
|
387
|
+
return value;
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* The smallest of `values`; `undefined` when there are none. `double.NaN` wins over every other
|
|
391
|
+
* value wherever it stands, as in `Enumerable.Min`; `-0` and `0` keep the first one met.
|
|
392
|
+
*/
|
|
393
|
+
function smallest(values) {
|
|
394
|
+
let result;
|
|
395
|
+
for (const value of values) {
|
|
396
|
+
if (isNaNValue(value))
|
|
397
|
+
return value;
|
|
398
|
+
if (result === undefined || compareKeys(value, result) < 0)
|
|
399
|
+
result = value;
|
|
400
|
+
}
|
|
401
|
+
return result;
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* The largest of `values`; `undefined` when there are none. `double.NaN` is the result only
|
|
405
|
+
* when it is all there is, as in `Enumerable.Max`.
|
|
406
|
+
*/
|
|
407
|
+
function largest(values) {
|
|
408
|
+
let result;
|
|
409
|
+
for (const value of values) {
|
|
410
|
+
if (result === undefined || isNaNValue(result) || compareKeys(value, result) > 0) {
|
|
411
|
+
result = value;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
return result;
|
|
415
|
+
}
|
|
416
|
+
function isNaNValue(value) {
|
|
417
|
+
return typeof value === "number" && Number.isNaN(value);
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* The element of `source` with the smallest (`direction` -1) or largest (1) key, the first one
|
|
421
|
+
* on a tie, as `MinBy` / `MaxBy` pick it. A `null` key is skipped; the first element stands in
|
|
422
|
+
* when every key is null. `undefined` for an empty sequence.
|
|
423
|
+
*/
|
|
424
|
+
function extremeBy(source, keySelector, direction) {
|
|
425
|
+
let first;
|
|
426
|
+
let hasFirst = false;
|
|
427
|
+
let result;
|
|
428
|
+
let resultKey;
|
|
429
|
+
let hasResult = false;
|
|
430
|
+
for (const item of source) {
|
|
431
|
+
if (!hasFirst) {
|
|
432
|
+
first = item;
|
|
433
|
+
hasFirst = true;
|
|
434
|
+
}
|
|
435
|
+
const key = keySelector(item);
|
|
436
|
+
if (key == null)
|
|
437
|
+
continue;
|
|
438
|
+
if (!hasResult || compareKeys(key, resultKey) * direction > 0) {
|
|
439
|
+
result = item;
|
|
440
|
+
resultKey = key;
|
|
441
|
+
hasResult = true;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
return hasResult ? result : first;
|
|
445
|
+
}
|
|
446
|
+
/** The sum as a `number` divided by the count of `values`; `null` when there are none. */
|
|
447
|
+
function averageOf(values) {
|
|
448
|
+
let total = 0;
|
|
449
|
+
let count = 0;
|
|
450
|
+
for (const value of values) {
|
|
451
|
+
total += value;
|
|
452
|
+
count++;
|
|
453
|
+
}
|
|
454
|
+
return count === 0 ? null : total / count;
|
|
455
|
+
}
|
|
456
|
+
/** .NET's message for `Average`, `Min`, `Max`, `MinBy` and `MaxBy` over an empty sequence. */
|
|
457
|
+
const NO_ELEMENTS_MESSAGE = "Sequence contains no elements";
|
|
458
|
+
/** .NET's exception for a sequence with no element, or with none that matches its predicate. */
|
|
459
|
+
function noElementException(hasPredicate) {
|
|
460
|
+
return new InvalidOperationException(hasPredicate ? "Sequence contains no matching element" : "Sequence contains no elements");
|
|
461
|
+
}
|
|
462
|
+
/** .NET's exception for a sequence with more than one element (that matches its predicate). */
|
|
463
|
+
function moreThanOneElementException(hasPredicate) {
|
|
464
|
+
return new InvalidOperationException(hasPredicate
|
|
465
|
+
? "Sequence contains more than one matching element"
|
|
466
|
+
: "Sequence contains more than one element");
|
|
467
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { Dictionary } from "../collections/dictionary.ts";
|
|
1
2
|
import type { HashSet } from "../collections/hash-set.ts";
|
|
3
|
+
import type { List } from "../collections/list.ts";
|
|
2
4
|
import type { QueryableMeta } from "./expr-tree.ts";
|
|
3
5
|
/**
|
|
4
6
|
* Descriptor-based LINQ runtime — prototype for #20.
|
|
@@ -20,8 +22,8 @@ import type { QueryableMeta } from "./expr-tree.ts";
|
|
|
20
22
|
* Bundlers still tree-shake every unused operator: each factory is a
|
|
21
23
|
* standalone function and the union-type definition compiles away.
|
|
22
24
|
*/
|
|
23
|
-
export type OperatorKind = "where" | "select" | "selectMany" | "take" | "skip" | "takeWhile" | "skipWhile" | "distinct" | "distinctBy" | "concat" | "append" | "prepend" | "reverse" | "orderBy" | "orderByDescending" | "thenBy" | "thenByDescending" | "groupBy" | "zip";
|
|
24
|
-
export type TerminalKind = "toArray" | "toMap" | "toSet" | "first" | "firstOrDefault" | "last" | "lastOrDefault" | "single" | "singleOrDefault" | "any" | "all" | "count" | "sum" | "min" | "max" | "minBy" | "maxBy" | "average" | "contains" | "aggregate";
|
|
25
|
+
export type OperatorKind = "where" | "select" | "selectMany" | "take" | "skip" | "takeWhile" | "skipWhile" | "distinct" | "distinctBy" | "concat" | "union" | "intersect" | "except" | "append" | "prepend" | "reverse" | "orderBy" | "orderByDescending" | "thenBy" | "thenByDescending" | "groupBy" | "zip";
|
|
26
|
+
export type TerminalKind = "toArray" | "toMap" | "toSet" | "toList" | "toDictionary" | "toHashSet" | "first" | "firstOrDefault" | "last" | "lastOrDefault" | "single" | "singleOrDefault" | "any" | "all" | "count" | "sum" | "min" | "max" | "minBy" | "maxBy" | "average" | "contains" | "aggregate";
|
|
25
27
|
/**
|
|
26
28
|
* Common shape every composition operator shares: a discriminator (`kind`)
|
|
27
29
|
* + a runtime walker (`apply`). Concrete descriptors extend this with the
|
|
@@ -83,6 +85,21 @@ export interface ConcatOp<T> extends OperatorBase<T, T> {
|
|
|
83
85
|
readonly kind: "concat";
|
|
84
86
|
readonly other: Iterable<T>;
|
|
85
87
|
}
|
|
88
|
+
/** `Union`: the distinct elements of the source, then those of `other` it lacks. */
|
|
89
|
+
export interface UnionOp<T> extends OperatorBase<T, T> {
|
|
90
|
+
readonly kind: "union";
|
|
91
|
+
readonly other: Iterable<T>;
|
|
92
|
+
}
|
|
93
|
+
/** `Intersect`: the distinct elements of the source that `other` holds too. */
|
|
94
|
+
export interface IntersectOp<T> extends OperatorBase<T, T> {
|
|
95
|
+
readonly kind: "intersect";
|
|
96
|
+
readonly other: Iterable<T>;
|
|
97
|
+
}
|
|
98
|
+
/** `Except`: the distinct elements of the source that `other` lacks. */
|
|
99
|
+
export interface ExceptOp<T> extends OperatorBase<T, T> {
|
|
100
|
+
readonly kind: "except";
|
|
101
|
+
readonly other: Iterable<T>;
|
|
102
|
+
}
|
|
86
103
|
export interface AppendOp<T> extends OperatorBase<T, T> {
|
|
87
104
|
readonly kind: "append";
|
|
88
105
|
readonly element: T;
|
|
@@ -135,7 +152,7 @@ export interface GroupByOp<T, K> extends OperatorBase<T, Grouping<K, T>> {
|
|
|
135
152
|
readonly queryable?: QueryableMeta;
|
|
136
153
|
}
|
|
137
154
|
/** Discriminated union of every composition operator. */
|
|
138
|
-
export type AnyOperator = WhereOp<unknown> | SelectOp<unknown, unknown> | SelectManyOp<unknown, unknown> | TakeOp<unknown> | SkipOp<unknown> | TakeWhileOp<unknown> | SkipWhileOp<unknown> | DistinctOp<unknown> | DistinctByOp<unknown, unknown> | ConcatOp<unknown> | AppendOp<unknown> | PrependOp<unknown> | ReverseOp<unknown> | OrderByOp<unknown, unknown> | OrderByDescendingOp<unknown, unknown> | ThenByOp<unknown, unknown> | ThenByDescendingOp<unknown, unknown> | GroupByOp<unknown, unknown> | ZipOp<unknown, unknown, unknown>;
|
|
155
|
+
export type AnyOperator = WhereOp<unknown> | SelectOp<unknown, unknown> | SelectManyOp<unknown, unknown> | TakeOp<unknown> | SkipOp<unknown> | TakeWhileOp<unknown> | SkipWhileOp<unknown> | DistinctOp<unknown> | DistinctByOp<unknown, unknown> | ConcatOp<unknown> | UnionOp<unknown> | IntersectOp<unknown> | ExceptOp<unknown> | AppendOp<unknown> | PrependOp<unknown> | ReverseOp<unknown> | OrderByOp<unknown, unknown> | OrderByDescendingOp<unknown, unknown> | ThenByOp<unknown, unknown> | ThenByDescendingOp<unknown, unknown> | GroupByOp<unknown, unknown> | ZipOp<unknown, unknown, unknown>;
|
|
139
156
|
/**
|
|
140
157
|
* Common shape every terminal shares. `apply` walks the source and
|
|
141
158
|
* produces a concrete value; providers read `kind` + the captured
|
|
@@ -158,15 +175,32 @@ export interface ToMapTerm<T, K, V> extends TerminalBase<T, Map<K, V>> {
|
|
|
158
175
|
export interface ToSetTerm<T> extends TerminalBase<T, HashSet<T>> {
|
|
159
176
|
readonly kind: "toSet";
|
|
160
177
|
}
|
|
178
|
+
export interface ToListTerm<T> extends TerminalBase<T, List<T>> {
|
|
179
|
+
readonly kind: "toList";
|
|
180
|
+
}
|
|
181
|
+
export interface ToDictionaryTerm<T, K, V> extends TerminalBase<T, Dictionary<K, V>> {
|
|
182
|
+
readonly kind: "toDictionary";
|
|
183
|
+
readonly keySelector: (item: T) => K;
|
|
184
|
+
readonly valueSelector: (item: T) => V;
|
|
185
|
+
readonly keyQueryable?: QueryableMeta;
|
|
186
|
+
readonly valueQueryable?: QueryableMeta;
|
|
187
|
+
}
|
|
188
|
+
export interface ToHashSetTerm<T> extends TerminalBase<T, HashSet<T>> {
|
|
189
|
+
readonly kind: "toHashSet";
|
|
190
|
+
}
|
|
161
191
|
export interface FirstTerm<T> extends TerminalBase<T, T> {
|
|
162
192
|
readonly kind: "first";
|
|
163
193
|
readonly predicate?: (item: T) => boolean;
|
|
164
194
|
readonly queryable?: QueryableMeta;
|
|
165
195
|
}
|
|
166
|
-
|
|
196
|
+
/**
|
|
197
|
+
* `D` is the type of the miss value: `null` without a `defaultValue`, `T` with one, or
|
|
198
|
+
* `T | null` for a nullable or optional default.
|
|
199
|
+
*/
|
|
200
|
+
export interface FirstOrDefaultTerm<T, D extends T | null = T | null> extends TerminalBase<T, T | D> {
|
|
167
201
|
readonly kind: "firstOrDefault";
|
|
168
202
|
readonly predicate?: (item: T) => boolean;
|
|
169
|
-
readonly defaultValue:
|
|
203
|
+
readonly defaultValue: D;
|
|
170
204
|
readonly queryable?: QueryableMeta;
|
|
171
205
|
}
|
|
172
206
|
export interface LastTerm<T> extends TerminalBase<T, T> {
|
|
@@ -174,10 +208,14 @@ export interface LastTerm<T> extends TerminalBase<T, T> {
|
|
|
174
208
|
readonly predicate?: (item: T) => boolean;
|
|
175
209
|
readonly queryable?: QueryableMeta;
|
|
176
210
|
}
|
|
177
|
-
|
|
211
|
+
/**
|
|
212
|
+
* `D` is the type of the miss value: `null` without a `defaultValue`, `T` with one, or
|
|
213
|
+
* `T | null` for a nullable or optional default.
|
|
214
|
+
*/
|
|
215
|
+
export interface LastOrDefaultTerm<T, D extends T | null = T | null> extends TerminalBase<T, T | D> {
|
|
178
216
|
readonly kind: "lastOrDefault";
|
|
179
217
|
readonly predicate?: (item: T) => boolean;
|
|
180
|
-
readonly defaultValue:
|
|
218
|
+
readonly defaultValue: D;
|
|
181
219
|
readonly queryable?: QueryableMeta;
|
|
182
220
|
}
|
|
183
221
|
export interface SingleTerm<T> extends TerminalBase<T, T> {
|
|
@@ -185,10 +223,14 @@ export interface SingleTerm<T> extends TerminalBase<T, T> {
|
|
|
185
223
|
readonly predicate?: (item: T) => boolean;
|
|
186
224
|
readonly queryable?: QueryableMeta;
|
|
187
225
|
}
|
|
188
|
-
|
|
226
|
+
/**
|
|
227
|
+
* `D` is the type of the miss value: `null` without a `defaultValue`, `T` with one, or
|
|
228
|
+
* `T | null` for a nullable or optional default.
|
|
229
|
+
*/
|
|
230
|
+
export interface SingleOrDefaultTerm<T, D extends T | null = T | null> extends TerminalBase<T, T | D> {
|
|
189
231
|
readonly kind: "singleOrDefault";
|
|
190
232
|
readonly predicate?: (item: T) => boolean;
|
|
191
|
-
readonly defaultValue:
|
|
233
|
+
readonly defaultValue: D;
|
|
192
234
|
readonly queryable?: QueryableMeta;
|
|
193
235
|
}
|
|
194
236
|
export interface AnyTerm<T> extends TerminalBase<T, boolean> {
|
|
@@ -206,34 +248,73 @@ export interface CountTerm<T> extends TerminalBase<T, number> {
|
|
|
206
248
|
readonly predicate?: (item: T) => boolean;
|
|
207
249
|
readonly queryable?: QueryableMeta;
|
|
208
250
|
}
|
|
209
|
-
|
|
251
|
+
/**
|
|
252
|
+
* `Sum`: `R` is `number`, or the decimal.js value of a `decimal` sum. A `null` the
|
|
253
|
+
* selector (or the source) yields counts as zero, as for `int?`.
|
|
254
|
+
*/
|
|
255
|
+
export interface SumTerm<T, R = number> extends TerminalBase<T, R> {
|
|
210
256
|
readonly kind: "sum";
|
|
211
|
-
readonly selector?: (item: T) =>
|
|
257
|
+
readonly selector?: (item: T) => R | null;
|
|
212
258
|
readonly queryable?: QueryableMeta;
|
|
213
259
|
}
|
|
214
|
-
|
|
260
|
+
/**
|
|
261
|
+
* `Min`: `R` is the type of the values, or `R | null` when an empty sequence
|
|
262
|
+
* or one of nulls gives `null` (a nullable or reference-typed result).
|
|
263
|
+
*/
|
|
264
|
+
export interface MinTerm<T, R = number> extends TerminalBase<T, R> {
|
|
215
265
|
readonly kind: "min";
|
|
216
|
-
readonly selector?: (item: T) =>
|
|
266
|
+
readonly selector?: (item: T) => unknown;
|
|
217
267
|
readonly queryable?: QueryableMeta;
|
|
218
268
|
}
|
|
219
|
-
|
|
269
|
+
/** `Max`: `R` is the type of the values, or `R | null` as for {@link MinTerm}. */
|
|
270
|
+
export interface MaxTerm<T, R = number> extends TerminalBase<T, R> {
|
|
220
271
|
readonly kind: "max";
|
|
221
|
-
readonly selector?: (item: T) =>
|
|
272
|
+
readonly selector?: (item: T) => unknown;
|
|
222
273
|
readonly queryable?: QueryableMeta;
|
|
223
274
|
}
|
|
224
|
-
|
|
275
|
+
/** `MinBy`: the element with the smallest key; `null` for an empty sequence of a nullable element type. */
|
|
276
|
+
export interface MinByTerm<T, K, R = T> extends TerminalBase<T, R> {
|
|
225
277
|
readonly kind: "minBy";
|
|
226
278
|
readonly keySelector: (item: T) => K;
|
|
227
279
|
readonly queryable?: QueryableMeta;
|
|
228
280
|
}
|
|
229
|
-
|
|
281
|
+
/** `MaxBy`: the element with the largest key; `null` for an empty sequence of a nullable element type. */
|
|
282
|
+
export interface MaxByTerm<T, K, R = T> extends TerminalBase<T, R> {
|
|
230
283
|
readonly kind: "maxBy";
|
|
231
284
|
readonly keySelector: (item: T) => K;
|
|
232
285
|
readonly queryable?: QueryableMeta;
|
|
233
286
|
}
|
|
234
|
-
|
|
287
|
+
/** `Average`: `R` is `number`, or the decimal.js value of a `decimal` average; `R | null` for nullable values. */
|
|
288
|
+
export interface AverageTerm<T, R = number> extends TerminalBase<T, R> {
|
|
289
|
+
readonly kind: "average";
|
|
290
|
+
readonly selector?: (item: T) => unknown;
|
|
291
|
+
readonly queryable?: QueryableMeta;
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* `Sum` over 64-bit values (`long`, `long?`, a `long` selector), which are
|
|
295
|
+
* `bigint`s: a checked sum, nulls skipped, `0n` when empty.
|
|
296
|
+
*/
|
|
297
|
+
export interface SumInt64Term<T> extends TerminalBase<T, bigint> {
|
|
298
|
+
readonly kind: "sum";
|
|
299
|
+
readonly selector?: (item: T) => bigint | null;
|
|
300
|
+
readonly queryable?: QueryableMeta;
|
|
301
|
+
}
|
|
302
|
+
/** `Average` over 64-bit values: `R` is `number`, or `number | null` for `long?` values. */
|
|
303
|
+
export interface AverageInt64Term<T, R extends number | null> extends TerminalBase<T, R> {
|
|
235
304
|
readonly kind: "average";
|
|
236
|
-
readonly selector?: (item: T) =>
|
|
305
|
+
readonly selector?: (item: T) => bigint | null;
|
|
306
|
+
readonly queryable?: QueryableMeta;
|
|
307
|
+
}
|
|
308
|
+
/** `Min` over 64-bit values: `R` is `bigint`, or `bigint | null` for `long?` values. */
|
|
309
|
+
export interface MinInt64Term<T, R extends bigint | null> extends TerminalBase<T, R> {
|
|
310
|
+
readonly kind: "min";
|
|
311
|
+
readonly selector?: (item: T) => bigint | null;
|
|
312
|
+
readonly queryable?: QueryableMeta;
|
|
313
|
+
}
|
|
314
|
+
/** `Max` over 64-bit values: `R` is `bigint`, or `bigint | null` for `long?` values. */
|
|
315
|
+
export interface MaxInt64Term<T, R extends bigint | null> extends TerminalBase<T, R> {
|
|
316
|
+
readonly kind: "max";
|
|
317
|
+
readonly selector?: (item: T) => bigint | null;
|
|
237
318
|
readonly queryable?: QueryableMeta;
|
|
238
319
|
}
|
|
239
320
|
export interface ContainsTerm<T> extends TerminalBase<T, boolean> {
|
|
@@ -246,4 +327,4 @@ export interface AggregateTerm<T, A> extends TerminalBase<T, A> {
|
|
|
246
327
|
readonly accumulator: (acc: A, item: T) => A;
|
|
247
328
|
}
|
|
248
329
|
/** Discriminated union of every terminal. */
|
|
249
|
-
export type AnyTerminal = ToArrayTerm<unknown> | ToMapTerm<unknown, unknown, unknown> | ToSetTerm<unknown> | FirstTerm<unknown> | FirstOrDefaultTerm<unknown> | LastTerm<unknown> | LastOrDefaultTerm<unknown> | SingleTerm<unknown> | SingleOrDefaultTerm<unknown> | AnyTerm<unknown> | AllTerm<unknown> | CountTerm<unknown> | SumTerm<unknown> | MinTerm<unknown> | MaxTerm<unknown> | MinByTerm<unknown, unknown> | MaxByTerm<unknown, unknown> | AverageTerm<unknown> | ContainsTerm<unknown> | AggregateTerm<unknown, unknown>;
|
|
330
|
+
export type AnyTerminal = ToArrayTerm<unknown> | ToMapTerm<unknown, unknown, unknown> | ToSetTerm<unknown> | ToListTerm<unknown> | ToDictionaryTerm<unknown, unknown, unknown> | ToHashSetTerm<unknown> | FirstTerm<unknown> | FirstOrDefaultTerm<unknown> | LastTerm<unknown> | LastOrDefaultTerm<unknown> | SingleTerm<unknown> | SingleOrDefaultTerm<unknown> | AnyTerm<unknown> | AllTerm<unknown> | CountTerm<unknown> | SumTerm<unknown, unknown> | MinTerm<unknown, unknown> | MaxTerm<unknown, unknown> | MinByTerm<unknown, unknown, unknown> | MaxByTerm<unknown, unknown, unknown> | AverageTerm<unknown, unknown> | SumInt64Term<unknown> | AverageInt64Term<unknown, number | null> | MinInt64Term<unknown, bigint | null> | MaxInt64Term<unknown, bigint | null> | ContainsTerm<unknown> | AggregateTerm<unknown, unknown>;
|
package/dist/system/math.d.ts
CHANGED
|
@@ -37,9 +37,9 @@ export interface DecimalRoundable<D> {
|
|
|
37
37
|
* there), so parity is pinned to the .NET 10 algorithm; revisit this helper when the
|
|
38
38
|
* supported target framework moves past .NET 10.
|
|
39
39
|
*
|
|
40
|
-
* @throws
|
|
41
|
-
* {@link MidpointRounding} value,
|
|
42
|
-
*
|
|
40
|
+
* @throws ArgumentOutOfRangeException when `digits` is outside 0–15, and
|
|
41
|
+
* ArgumentException when `mode` is not a {@link MidpointRounding} value, with
|
|
42
|
+
* .NET's messages.
|
|
43
43
|
*/
|
|
44
44
|
export declare function roundNumber(value: number, digits?: number, mode?: MidpointRounding): number;
|
|
45
45
|
/**
|
|
@@ -48,7 +48,8 @@ export declare function roundNumber(value: number, digits?: number, mode?: Midpo
|
|
|
48
48
|
* `decimal.Round`. `decimal.js` rounds the exact decimal value, so no binary
|
|
49
49
|
* representation error is involved.
|
|
50
50
|
*
|
|
51
|
-
* @throws
|
|
52
|
-
* {@link MidpointRounding} value
|
|
51
|
+
* @throws ArgumentOutOfRangeException when `digits` is outside 0–28, and
|
|
52
|
+
* ArgumentException when `mode` is not a {@link MidpointRounding} value, with
|
|
53
|
+
* .NET's messages.
|
|
53
54
|
*/
|
|
54
55
|
export declare function roundDecimal<D extends DecimalRoundable<D>>(value: D, digits?: number, mode?: MidpointRounding): D;
|