Extends TypeScript/Javascript with basic classes and functions


320.8.44 years ago5 years agoMinified + gzip package size for @cashfarm/lang in KB


The lang package

Languages are awesome! Well... most of them are. And that's the case for TypeScript.

Sometimes there are a couple things we miss though...

And, when that happens, instead of complaining about it, we create a lang package :)

Check the API documentation at http://cashfarm.github.io/lang



  • Add deserializeArray method for use with JSON array strings


  • [BREAKING CHANGE] Removes the ExtendedObject class
  • New (de)serialization methods: serialize, deserialize, primitify and classify
  • Decorators for controlling serialization


  • Add FQN decorator and decorate package's classes
  • Move symbols into Symbols object
  • Add default value ({}) for ConcreteType type parameter


  • Add FQN support (parseFQN() and requireByFQN())
  • Add StringWrapper and NumberWrapper classes for easy primitive subclassing
  • Add Exception class which properly extends native Error
  • Add Constructor type
  • Add tests for Decimal, FQN and Guid
  • Improve code documentation and add API documentation
  • Refactor Decimal and Guid classes to extend wrappers
  • Deprecated ExtendedObject and serialization decorators

Breaking Changes

  • OrderDirection enum values are now 'ASC' and 'DESC' (previously 1 and -1 respectivelly)
  • Removed IEnumerable and Iterator interfaces
  • Sortable class is now a mixin

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.