3.7.14 • Published 5 days ago

@typedash/typedash v3.7.14

Weekly downloads
-
License
MIT
Repository
-
Last release
5 days ago

@typedash/typedash

This package houses domain agnostic utility functions that can be used in any project/package. This is the centralized place where you can get util functions without needing to know which underlying package it's coming from.

Everything in this package should be curried/auto-curried, take data last, follow similar patterns as ramda, ramda-adjunct, fp-ts, fp-ts-std, and have thorough test coverage.

Installation

npm install @typedash/typedash
yard add --save @typedash/typedash

Organization

Utility functions are organized based on the type of data they work on. If they don't fit into a group (pipe, flow, ifElse, etc) then they will be exported as bare functions at the root. To encourage cohesiveness, modules have been collected and exported under a reserved abbreviation. See below for the mapping. In each module, you'll find a _external.ts file that houses all the external methods we're re-exporting. Any custom methods that aren't covered by the utils mentioned above are alongside that with tests and exported from the index.ts. The root of the src directory enforces common abbreviations that are loosely tied to how fp-ts organizes itself.

Module NameAbbreviationNote
functionN/ABare word exports, no namespace
ArrayA
ApplyAP
BooleanB
DateDATE
EitherE
JsonJ
SpectaclesLL for "Lenses"
NumberN
NonEmptyArrayNEA
OptionO
OrdORD
PromiseP
PredicatePRED
RecordRAKA Object/Struct methods
ReadonlyArrayRA
ReadonlyNonEmptyArrayRNEA
StringS
SemigroupSemi
TaskT
TaskEitherTE
TaskOptionTO
UndefinedU

Example

Below is an example of how you would/could use this package in your project.

import { A, R, pipe, double } from '@typedash/typedash'

A.join(', ')(['foo', 'bar']) // 'foo, bar'

R.map((x) => x * 2)({ foo: 5, bar: 6 }) // { foo: 10, bar: 12 }
A.map(double)([5, 6]) // [10, 12]

pipe(
  [5, 6, 5, 10],
  A.map(double),
  A.filter(equal(10)),
  A.map(toString),
  A.join(', '),
) // '10, 10'

Adding functions

Add functions as you see fit, but be careful of conflicting names. As a base, fp-ts functions should b preferred as they are generally safer than the other utility libraries. From there, you can grab methods from other externals and export them by name. Can't find something you need in any of the current externals (see External References)? Implement your own in a separate file inside the appropriate data module and export it in that module's index.ts. Be sure not to override an existing function name!

External References

PackageDocs Url
fp-tshttps://gcanti.github.io/fp-ts/modules/
fp-ts-stdhttps://github.com/samhh/fp-ts-std
ramdahttps://ramdajs.com/docs/
ramda-adjuncthttps://char0n.github.io/ramda-adjunct/2.23.0/RA.html
3.7.13

5 days ago

3.7.14

5 days ago

3.7.12

8 days ago

3.7.9

1 month ago

3.7.11

1 month ago

3.7.10

1 month ago

3.7.5

6 months ago

3.7.4

6 months ago

3.7.3

6 months ago

3.7.2

6 months ago

3.7.8

6 months ago

3.7.7

6 months ago

3.7.6

6 months ago

3.6.2

7 months ago

3.6.1

7 months ago

3.6.0

7 months ago

3.6.4

7 months ago

3.6.3

7 months ago

3.7.1

6 months ago

3.7.0

6 months ago

3.5.2

1 year ago

3.5.1

1 year ago

3.5.0

1 year ago

3.4.0

1 year ago

3.2.0

1 year ago

3.4.2

1 year ago

3.4.1

1 year ago

3.3.0

1 year ago

1.2.0

2 years ago

1.1.1

2 years ago

1.0.2

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.9.1

1 year ago

1.8.2

1 year ago

1.9.0

1 year ago

1.8.1

1 year ago

1.8.0

1 year ago

1.7.0

1 year ago

1.6.0

1 year ago

1.5.0

2 years ago

1.4.0

2 years ago

1.3.0

2 years ago

1.0.3

2 years ago

2.2.1

1 year ago

2.2.0

1 year ago

2.0.2

1 year ago

2.2.3

1 year ago

2.2.2

1 year ago

2.2.5

1 year ago

2.2.4

1 year ago

2.2.7

1 year ago

2.2.6

1 year ago

2.2.10

1 year ago

2.1.0

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

3.1.2

1 year ago

3.1.1

1 year ago

3.1.0

1 year ago

2.2.9

1 year ago

2.2.8

1 year ago

3.0.0

1 year ago

1.10.0

1 year ago

0.1.0

2 years ago

1.0.0

2 years ago

0.3.0

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.3.1

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago