purelogic-ts

PureLogic for TypeScript

Usage no npm install needed!

<script type="module">
  import purelogicTs from 'https://cdn.skypack.dev/purelogic-ts';
</script>

README

purelogic-ts

PureLogic-TS is an embedded DSL for describing map-reduce logic on TypeScript.

npm version Build Status

Bag Types

  • Input
  • One
  • FlatMap
  • DisjointUnion
  • GroupBy. The key is always a string. ES6 Map shouldn't be used because some back-ends may serialize objects.
  • Product

Bag Methods

See iterable-ts, lazy.js, lodash and underscore.

Back-ends

  • Sync Memory
  • Async Memory
  • Event-based in Memory

Data And Data Operation Requirements

  • Serializable. All data should be serializable.
  • Immutable. All data operations (functions) should not change input data.

Serialazable Data

Use TypeScript interfaces instead of classes. The interface should contain properties and no functions.

Serialazible Union Type

interface MyUnion
{
    numberValue: number|undefined;
    stringValue: string|undefined;
}

For Developers

Required

Optional

Getting Started

  • install dependencies npm install.
  • run unit test and coverage npm test.

Cloud9

Run nvm install 6.7.0 && nvm use 6.7.0 in Cloud9 workspace.

Conventions And Rules

ES6

The project targets "ES6" because TypeScript 2.0 supports async only for "ES6" and above. According to ES6 Compatibility Table, we can use ES6 for

  • Edge 14+ (Windows 10, Windows 10 Mobile, Xbox One),
  • FireFox 48+,
  • Chrome 53+ (including Android 4.2+),
  • Node 6+,
  • Safari 10 (OS X 10.12 Sierra, iOS 10 iPhone 5+).