3.0.3 • Published 1 year ago

@snickerdoodlelabs/common-utils v3.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Common Utils

This package contains a number of utility classes used throughout the Snickerdoodle Labs ecosystem. They don't really have a common theme. Most are designed for IOC patterns, and are marked with Inversify decorators. Some, such as AjaxUtils and TimeUtils, mostly provide Neverthrow semantics for underlying library methods. ObjectUtils is a pure static class that provides a number of functional methods. Some are just utility classes that are designed to be new'd up and used in a normal OO way, such as TimedCache.

Concepts

Neverthrow

Neverthrow provides a way to do strong typing of errors in Typescript, in both synchronous and asynchronous methods. We do things almost entirely async and most every method returns ResultAsync<>. Some may view this as a digression since using ResultAsync looks a lot like old promise-based code; ResultAsync<> is incompatible with async/await mechanics in modern Javascript/Typescript. We view it as a trade off instead- ResultAsync<> allows for strongly typed errors, something that cannot be done with TS normally. We take the trade off of being able to say exactly what errors may be returned by a method over slick coding semantics.

Inversion of Control

We use Inversify to provide Inversion of Control, and most of our utilities include an interface and a type for use by Inversify, as well as being decorated for injection.

3.0.3

1 year ago

3.0.2

1 year ago

2.0.4

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.12

1 year ago

1.0.9

1 year ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.21

2 years ago

0.0.22

2 years ago

0.0.23

2 years ago

0.0.24

2 years ago

0.0.25

2 years ago

1.0.8

1 year ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

0.2.0

2 years ago

0.0.20

2 years ago

0.0.19

2 years ago

0.0.16

2 years ago

0.0.17

2 years ago

0.0.18

2 years ago

0.0.10

3 years ago

0.0.11

3 years ago

0.0.12

3 years ago

0.0.13

3 years ago

0.1.0

3 years ago

0.0.15

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.5

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago