Jesus sucks
This commit is contained in:
349
backend/frontend/node_modules/tcomb/CHANGELOG.md
generated
vendored
Normal file
349
backend/frontend/node_modules/tcomb/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,349 @@
|
||||
# Changelog
|
||||
|
||||
> **Tags:**
|
||||
> - [New Feature]
|
||||
> - [Bug Fix]
|
||||
> - [Breaking Change]
|
||||
> - [Documentation]
|
||||
> - [Internal]
|
||||
> - [Polish]
|
||||
> - [Experimental]
|
||||
|
||||
**Note**: Gaps between patch versions are faulty/broken releases.
|
||||
**Note**: A feature tagged as Experimental is in a high state of flux, you're at risk of it changing without notice.
|
||||
|
||||
# v3.2.29
|
||||
|
||||
- **Bug Fix**
|
||||
- [typescript] fix `interface`'s `extend` signature, #329 (@apepper)
|
||||
|
||||
# v3.2.28
|
||||
|
||||
- **Bug Fix**
|
||||
- Enums.is() with an array value should always be false, #327 (@phorsuedzie)
|
||||
|
||||
# v3.2.27
|
||||
|
||||
- **Bug Fix**
|
||||
- struct typescript extend signature, #317 (@lramel)
|
||||
- defaultProps missing from StructOptions, #317 (@lramel)
|
||||
|
||||
# v3.2.25
|
||||
|
||||
- **Bug Fix**
|
||||
- fromJSON makes use of defaultProps while deserializing a struct, fix #312 (@rkmax)
|
||||
|
||||
# v3.2.24
|
||||
|
||||
- **Bug Fix**
|
||||
- Struct extension of a refinement of a struct now use the correct displayName, fix #297 (@gcanti)
|
||||
|
||||
# v3.2.23
|
||||
|
||||
- **Bug Fix**
|
||||
- declare: remove unnecessary limitation, fix #291 (@gcanti)
|
||||
|
||||
# v3.2.22
|
||||
|
||||
- **Polish**
|
||||
- Update TypeScript definitions to allow module augmentation (@RedRoserade)
|
||||
|
||||
# v3.2.21
|
||||
|
||||
- **Bug Fix**
|
||||
- TypeScript definition file: `Nil` should be `void | null` (@francescogior)
|
||||
|
||||
# v3.2.20
|
||||
|
||||
- **Polish**
|
||||
- add `options` (struct, interface) to typescript definition (@gcanti)
|
||||
|
||||
# v3.2.19
|
||||
|
||||
- **Polish**
|
||||
- add `strict` (struct, interface) to typescript definition (@gcanti)
|
||||
|
||||
# v3.2.18
|
||||
|
||||
- **Bug Fix**
|
||||
- fix `define` in typescript definition (@gcanti)
|
||||
|
||||
# v3.2.17
|
||||
|
||||
- **Bug Fix**
|
||||
- add missing `t.Integer` to typescript definition (@gcanti)
|
||||
|
||||
# v3.2.16
|
||||
|
||||
- **Bug Fix**
|
||||
- strict structs with additional methods should not throw on updating, fix #267 (@gcanti)
|
||||
|
||||
# v3.2.15
|
||||
|
||||
- **New Feature**
|
||||
- Added support for overwriting `defaultProps` in `t.struct.extend`, fix #257 (@tehnomaag)
|
||||
|
||||
# v3.2.14
|
||||
|
||||
- **Bug Fix**
|
||||
- replace `instanceof Array` with `Array.isArray`, fix #255 (@ewnd9)
|
||||
|
||||
# v3.2.13
|
||||
|
||||
- **Bug Fix**
|
||||
- fromJSON: typecasting of values inside `t.intersection`, fix #250 (@gcanti)
|
||||
|
||||
# v3.2.12
|
||||
|
||||
- **Bug Fix**
|
||||
- now `interface` doesn't filter additional props when props contain a struct, fix #245 (@gcanti)
|
||||
|
||||
# v3.2.11
|
||||
|
||||
- **Bug Fix**
|
||||
- allow declare'd unions with custom dispatch, fix #242 (@gcanti)
|
||||
|
||||
# v3.2.10
|
||||
|
||||
- **Bug Fix**
|
||||
- handle nully values in interface `is` function (@gcanti)
|
||||
|
||||
# v3.2.9
|
||||
|
||||
- **New Feature**
|
||||
- fromJSON: track error path, fix #235 (@gcanti)
|
||||
- **Internal**
|
||||
- change shallow copy in order to improve perfs (@gcanti)
|
||||
|
||||
# v3.2.8
|
||||
|
||||
- **Bug Fix**
|
||||
- mixing types and classes in a union throws, fix #232 (@gcanti)
|
||||
|
||||
# v3.2.7
|
||||
|
||||
- **Bug Fix**
|
||||
- add support for class constructors, `fromJSON` module (@gcanti)
|
||||
- type-check the value returned by a custom reviver, `fromJSON` module (@gcanti)
|
||||
|
||||
# v3.2.6
|
||||
|
||||
- **Bug Fix**
|
||||
- null Maybes should stringify to null, fix #227 (@gcanti)
|
||||
|
||||
# v3.2.5
|
||||
|
||||
- **Polish**
|
||||
- prevent bugs when enums are defined through `t.declare` (@gcanti)
|
||||
|
||||
# v3.2.4
|
||||
|
||||
- **Polish**
|
||||
- decouple usage of new operator in create() function, fix #223 (@gcanti)
|
||||
|
||||
# v3.2.3
|
||||
|
||||
- **Polish**
|
||||
- add `isNil` check in interface constructor
|
||||
- **Experimental**
|
||||
- add support for [babel-plugin-tcomb](https://github.com/gcanti/babel-plugin-tcomb), fix #218 (@gcanti)
|
||||
|
||||
# v3.2.2
|
||||
|
||||
- **Bug Fix**
|
||||
- relax `isObject` contraint in interface combinator, fix #214
|
||||
|
||||
# v3.2.1
|
||||
|
||||
- **Bug Fix**
|
||||
- fix missing path argument in FuncType
|
||||
- **Polish**
|
||||
- better stringify serialization for functions
|
||||
|
||||
# v3.2.0
|
||||
|
||||
- **New Feature**
|
||||
- `isSubsetOf` module, function for determining whether one type is compatible with another type (@R3D4C73D)
|
||||
- default props for structs (thanks @timoxley)
|
||||
- **Documentation**
|
||||
- global strict settings are deprecated (see https://github.com/gcanti/tcomb/issues/168#issuecomment-222422999)
|
||||
|
||||
# v3.1.0
|
||||
|
||||
- **New Feature**
|
||||
- add `t.Integer` to standard types
|
||||
- add `t.Type` to standard types
|
||||
- `interface` combinator, fix #195, [docs](https://github.com/gcanti/tcomb/blob/master/docs/API.md#the-interface-combinator) (thanks @ctrlplusb)
|
||||
- add interface support to fromJSON (@minedeljkovic)
|
||||
- add support for extending refinements, fix #179, [docs](https://github.com/gcanti/tcomb/blob/master/docs/API.md#extending-structs)
|
||||
- local and global `strict` option for structs and interfaces, fix #203, [docs](https://github.com/gcanti/tcomb/blob/master/docs/API.md#strictness)
|
||||
- Chrome Dev Tools custom formatter for tcomb types [docs](https://github.com/gcanti/tcomb/blob/master/docs/API.md#the-libinstalltypeformatter-module)
|
||||
- **Bug Fix**
|
||||
- More intelligent immutability update handling, fix #199 (thanks @ctrlplusb)
|
||||
- func combinator: support optional arguments, fix #198 (thanks @ivan-kleshnin)
|
||||
- **Internal**
|
||||
- add "Struct" prefix to structs default name
|
||||
- `mixin()` now allows identical references for overlapping properties
|
||||
|
||||
# v3.0.0
|
||||
|
||||
**Warning**. If you don't rely in your codebase on the property `maybe(MyType)(undefined) === null` this **is not a breaking change** for you.
|
||||
|
||||
- **Breaking Change**
|
||||
- prevent `Maybe` constructor from altering the value when `Nil`, fix #183 (thanks @gabro)
|
||||
|
||||
# v2.7.0
|
||||
|
||||
- **New Feature**
|
||||
- `lib/fromJSON` module: generic deserialize, fix #169
|
||||
- `lib/fromJSON` TypeScript definition file
|
||||
- **Bug Fix**
|
||||
- t.update module: $apply doesn't play well with dates and regexps, fix #172
|
||||
- t.update: cannot $merge and $remove at once, fix #170 (thanks @grahamlyus)
|
||||
- TypeScript: fix Exported external package typings file '...' is not a module
|
||||
- misleading error message in `Struct.extend` functions, fix #177 (thanks @Firfi)
|
||||
|
||||
# v2.6.0
|
||||
|
||||
- **New Feature**
|
||||
- `declare` API: recursive and mutually recursive types (thanks @utaal)
|
||||
- typescript definition file, fix #160 (thanks @DanielRosenwasser)
|
||||
- `t.struct.extend`, fix #164 (thanks @dzdrazil)
|
||||
- **Internal**
|
||||
- split main file to separate modules, fix #158
|
||||
- add "typings" field to package.json (TypeScript)
|
||||
- add `predicate` field to irreducibles meta objects
|
||||
- **Documentation**
|
||||
- revamp [API.md](https://github.com/gcanti/tcomb/blob/master/docs/API.md)
|
||||
- add ["A little guide to runtime type checking and runtime type introspection"](https://github.com/gcanti/tcomb/blob/master/docs/GUIDE.md) (WIP)
|
||||
|
||||
## v2.5.2
|
||||
|
||||
- **Bug Fix**
|
||||
- remove the assert checking if the type returned by a union dispatch function is correct (was causing issues with unions of unions or unions of intersections)
|
||||
|
||||
## v2.5.1
|
||||
|
||||
- **Internal**
|
||||
- `t.update` should not change the reference when no changes occur, fix #153
|
||||
|
||||
# v2.5.0
|
||||
|
||||
- **New Feature**
|
||||
- check if the type returned by a union dispatch function is correct, fix #136 (thanks @fcracker79)
|
||||
- added `refinement` alias to `subtype` (which is deprecated), fix #140
|
||||
- **Internal**
|
||||
- optimisations: for identity types return early in production, fix #135 (thanks @fcracker79)
|
||||
- exposed `getDefaultName` on combinator constructors
|
||||
|
||||
## v2.4.1
|
||||
|
||||
- **New Feature**
|
||||
- added struct multiple inheritance, fix #143
|
||||
|
||||
# v2.4.0
|
||||
|
||||
- **New Feature**
|
||||
- unions
|
||||
- added `update` function, #127
|
||||
- the default `dispatch` implementation now handles unions of unions, #126
|
||||
- show the offended union type in error messages
|
||||
|
||||
# v2.3.0
|
||||
|
||||
- **New Feature**
|
||||
- Add support for lazy messages in asserts, fix #124
|
||||
- Better error messages for assert failures, fix #120
|
||||
|
||||
The messages now have the following general form:
|
||||
|
||||
```
|
||||
Invalid value <value> supplied to <context>
|
||||
```
|
||||
|
||||
where context is a slash-separated string with the following properties:
|
||||
|
||||
- the first element is the name of the "root"
|
||||
- the following elements have the form: `<field name>: <field type>`
|
||||
|
||||
Note: for more readable messages remember to give types a name
|
||||
|
||||
Example:
|
||||
|
||||
```js
|
||||
var Person = t.struct({
|
||||
name: t.String
|
||||
}, 'Person'); // <- remember to give types a name
|
||||
|
||||
var User = t.struct({
|
||||
email: t.String,
|
||||
profile: Person
|
||||
}, 'User');
|
||||
|
||||
var mynumber = t.Number('a');
|
||||
// => Invalid value "a" supplied to Number
|
||||
|
||||
var myuser = User({ email: 1 });
|
||||
// => Invalid value 1 supplied to User/email: String
|
||||
|
||||
myuser = User({ email: 'email', profile: { name: 2 } });
|
||||
// => Invalid value 2 supplied to User/profile: Person/name: String
|
||||
```
|
||||
|
||||
|
||||
## v2.2.1
|
||||
|
||||
- **Experimental**
|
||||
- pattern matching #121
|
||||
|
||||
# v2.2.0
|
||||
|
||||
- **New Feature**
|
||||
- added `intersection` combinator fix #111
|
||||
|
||||
**Example**
|
||||
|
||||
```js
|
||||
const Min = t.subtype(t.String, function (s) { return s.length > 2; }, 'Min');
|
||||
const Max = t.subtype(t.String, function (s) { return s.length < 5; }, 'Max');
|
||||
const MinMax = t.intersection([Min, Max], 'MinMax');
|
||||
|
||||
MinMax.is('abc'); // => true
|
||||
MinMax.is('a'); // => false
|
||||
MinMax.is('abcde'); // => false
|
||||
```
|
||||
|
||||
- **Internal**
|
||||
- optimised the generation of default names for types
|
||||
|
||||
# v2.1.0
|
||||
|
||||
- **New Feature**
|
||||
- added aliases for pre-defined irreducible types fix #112
|
||||
- added overridable `stringify` function to handle error messages and improve performances in development (replaces the experimental `options.verbose`)
|
||||
|
||||
## v2.0.1
|
||||
|
||||
- **Experimental**
|
||||
- added `options.verbose` (default `true`) to handle messages (set `options.verbose = false` to improve performances in development)
|
||||
|
||||
# v2.0.0
|
||||
|
||||
- **New Feature**
|
||||
- add support to types defined as ES6 classes #99
|
||||
- optimized for production code: asserts and freeze only in development mode
|
||||
- add `is(x, type)` function
|
||||
- add `isType(x)` function
|
||||
- add `stringify(x)` function
|
||||
- **Breaking change**
|
||||
- numeric types on enums #93 (thanks @m0x72)
|
||||
- remove asserts when process.env.NODE_ENV === 'production' #100
|
||||
- do not freeze if process.env.NODE_ENV === 'production' #103
|
||||
- func without currying #96 (thanks @tmcw)
|
||||
- remove useless exports #104
|
||||
- drop bower support #101
|
||||
- remove useless exports
|
||||
* Type
|
||||
* slice
|
||||
* shallowCopy
|
||||
* getFunctionName
|
||||
21
backend/frontend/node_modules/tcomb/LICENSE
generated
vendored
Normal file
21
backend/frontend/node_modules/tcomb/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Giulio Canti
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
248
backend/frontend/node_modules/tcomb/README.md
generated
vendored
Normal file
248
backend/frontend/node_modules/tcomb/README.md
generated
vendored
Normal file
@@ -0,0 +1,248 @@
|
||||
[](https://travis-ci.org/gcanti/tcomb)
|
||||
[](https://david-dm.org/gcanti/tcomb)
|
||||

|
||||
|
||||
> "Si vis pacem, para bellum" - (Vegetius 5th century)
|
||||
|
||||
tcomb is a library for Node.js and the browser which allows you to **check the types** of JavaScript values at runtime with a simple and concise syntax. It's great for **Domain Driven Design** and for adding safety to your internal code.
|
||||
|
||||
# TypeScript / Flowtype users
|
||||
|
||||
You may want to check out [io-ts](https://github.com/gcanti/io-ts)
|
||||
|
||||
# IMPORTANT: Running in production
|
||||
|
||||
tcomb is supposed to be used in **development** and is **disabled in production**.
|
||||
If you want type checks in production you may use
|
||||
- [tcomb-validation](https://github.com/gcanti/tcomb-validation)
|
||||
- [io-ts](https://github.com/gcanti/io-ts)
|
||||
|
||||
# Setup
|
||||
|
||||
```sh
|
||||
npm install tcomb --save
|
||||
```
|
||||
|
||||
**Code example**
|
||||
|
||||
A type-checked function:
|
||||
|
||||
```js
|
||||
import t from 'tcomb';
|
||||
|
||||
function sum(a, b) {
|
||||
t.Number(a);
|
||||
t.Number(b);
|
||||
return a + b;
|
||||
}
|
||||
|
||||
sum(1, 's'); // throws '[tcomb] Invalid value "s" supplied to Number'
|
||||
|
||||
// using babel-plugin-tcomb
|
||||
function sum(a: number, b: number) {
|
||||
return a + b;
|
||||
}
|
||||
```
|
||||
|
||||
A user defined type:
|
||||
|
||||
```js
|
||||
const Integer = t.refinement(t.Number, (n) => n % 1 === 0, 'Integer');
|
||||
```
|
||||
|
||||
A type-checked class:
|
||||
|
||||
```js
|
||||
const Person = t.struct({
|
||||
name: t.String, // required string
|
||||
surname: t.maybe(t.String), // optional string
|
||||
age: t.Integer, // required integer
|
||||
tags: t.list(t.String) // a list of strings
|
||||
}, 'Person');
|
||||
|
||||
// methods are defined as usual
|
||||
Person.prototype.getFullName = function () {
|
||||
return `${this.name} ${this.surname}`;
|
||||
};
|
||||
|
||||
const person = Person({
|
||||
surname: 'Canti'
|
||||
}); // throws '[tcomb] Invalid value undefined supplied to Person/name: String'
|
||||
```
|
||||
|
||||
Chrome DevTools:
|
||||
|
||||

|
||||
|
||||
# Docs
|
||||
|
||||
- [API](docs/API.md)
|
||||
- [A little guide to runtime type checking and runtime type introspection](docs/GUIDE.md) (Work in progress)
|
||||
|
||||
# Features
|
||||
|
||||
**Lightweight**
|
||||
|
||||
3KB gzipped, no dependencies.
|
||||
|
||||
**Type safety**
|
||||
|
||||
All models defined with `tcomb` are type-checked.
|
||||
|
||||
**Note**. Instances *are not boxed*, this means that `tcomb` works great with lodash, Ramda, etc. And you can of course use them as props to React components.
|
||||
|
||||
**Based on set theory**
|
||||
|
||||
- Blog post: [JavaScript, Types and Sets - Part I](https://gcanti.github.io/2014/09/29/javascript-types-and-sets.html)
|
||||
- Blog post: [JavaScript, Types and Sets - Part II](https://gcanti.github.io/2014/10/07/javascript-types-and-sets-part-II.html)
|
||||
|
||||
**Domain Driven Design**
|
||||
|
||||
Write complex domain models in a breeze and with a small code footprint. Supported types / combinators:
|
||||
|
||||
* user defined types
|
||||
* structs
|
||||
* lists
|
||||
* enums
|
||||
* refinements
|
||||
* unions
|
||||
* intersections
|
||||
* the option type
|
||||
* tuples
|
||||
* dictionaries
|
||||
* functions
|
||||
* recursive and mutually recursive types
|
||||
* interfaces
|
||||
|
||||
**Immutability and immutability helpers**
|
||||
|
||||
Instances are immutable using `Object.freeze`. This means you can use standard JavaScript objects and arrays. You don't have to change how you normally code. You can update an immutable instance with the provided `update(instance, spec)` function:
|
||||
|
||||
```js
|
||||
const person2 = Person.update(person, {
|
||||
name: { $set: 'Guido' }
|
||||
});
|
||||
```
|
||||
|
||||
where `spec` is an object containing *commands*. The following commands are compatible with the [Facebook Immutability Helpers](http://facebook.github.io/react/docs/update.html):
|
||||
|
||||
* `$push`
|
||||
* `$unshift`
|
||||
* `$splice`
|
||||
* `$set`
|
||||
* `$apply`
|
||||
* `$merge`
|
||||
|
||||
See [Updating immutable instances](docs/API.md#updating-immutable-instances) for details.
|
||||
|
||||
**Speed**
|
||||
|
||||
`Object.freeze` calls and asserts are executed only in development and stripped out in production (using `process.env.NODE_ENV !== 'production'` tests).
|
||||
|
||||
**Runtime type introspection**
|
||||
|
||||
All models are inspectable at runtime. You can read and reuse the information stored in your types (in the `meta` static member). See [The meta object](docs/GUIDE.md#the-meta-object) in the docs for details.
|
||||
|
||||
Libraries exploiting tcomb's RTI:
|
||||
|
||||
- [tcomb-validation](https://github.com/gcanti/tcomb-validation)
|
||||
- [tcomb-form](https://github.com/gcanti/tcomb-form)
|
||||
- Blog post: [JSON API Validation In Node.js](https://gcanti.github.io/2014/09/15/json-api-validation-in-node.html)
|
||||
|
||||
**Easy JSON serialization / deserialization**
|
||||
|
||||
Encodes / decodes your domain models to / from JSON for free.
|
||||
- Blog post: [JSON Deserialization Into An Object Model](https://gcanti.github.io/2014/09/12/json-deserialization-into-an-object-model.html)
|
||||
|
||||
**Debugging with Chrome DevTools**
|
||||
|
||||
You can customize the behavior when an assert fails leveraging the power of Chrome DevTools.
|
||||
|
||||
```js
|
||||
// use the default...
|
||||
t.fail = function fail(message) {
|
||||
throw new TypeError('[tcomb] ' + message); // set "Pause on exceptions" on the "Sources" panel for a great DX
|
||||
};
|
||||
|
||||
// .. or define your own behavior
|
||||
t.fail = function fail(message) {
|
||||
console.error(message);
|
||||
};
|
||||
```
|
||||
|
||||
**Pattern matching**
|
||||
|
||||
```js
|
||||
const result = t.match(1,
|
||||
t.String, () => 'a string',
|
||||
t.Number, () => 'a number'
|
||||
);
|
||||
|
||||
console.log(result); // => 'a number'
|
||||
```
|
||||
|
||||
**Babel plugin**
|
||||
|
||||
Using [babel-plugin-tcomb](https://github.com/gcanti/babel-plugin-tcomb) you can also write (Flow compatible) type annotations:
|
||||
|
||||
```js
|
||||
function sum(a: number, b: number): number {
|
||||
return a + b;
|
||||
}
|
||||
```
|
||||
|
||||
**TypeScript definition file**
|
||||
|
||||
[index.d.ts](index.d.ts)
|
||||
|
||||
# Contributors
|
||||
|
||||
- [Giulio Canti](https://github.com/gcanti) maintainer
|
||||
- [Becky Conning](https://github.com/beckyconning) `func` combinator ideas and documentation
|
||||
- [Andrea Lattuada](https://github.com/utaal) `declare` combinator
|
||||
|
||||
# How to Build a standalone bundle
|
||||
|
||||
```sh
|
||||
git clone git@github.com:gcanti/tcomb.git
|
||||
cd tcomb
|
||||
npm install
|
||||
npm run dist
|
||||
```
|
||||
|
||||
Will output 2 files:
|
||||
|
||||
- `dist/tcomb.js` (development)
|
||||
- `dist/tcomb.min.js` (production) `Object.freeze` calls and asserts stripped out
|
||||
|
||||
# Related libraries
|
||||
|
||||
* [tcomb-doc](https://github.com/gcanti/tcomb-doc) Documentation tool for tcomb
|
||||
* [tcomb-validation](https://github.com/gcanti/tcomb-validation) Validation library based on type combinators
|
||||
* [tcomb-json-schema](https://github.com/gcanti/tcomb-json-schema) Transforms a JSON Schema to a tcomb type
|
||||
* [reactuate](https://github.com/reactuate/reactuate) React/Redux stack (not a boilerplate kit)
|
||||
* [tcomb-react](https://github.com/gcanti/tcomb-react) Alternative syntax for PropTypes
|
||||
* [mongorito-tcomb](https://github.com/xouabita/mongorito-tcomb) Bring schema validation to Mongorito thanks to tcomb
|
||||
* [tcomb-form](https://github.com/gcanti/tcomb-form) Forms library for react
|
||||
* [tcomb-form-types](https://github.com/Industrial/tcomb-form-types) Adds Types/Validations to tcomb-form
|
||||
* [tcomb-form-native](https://github.com/gcanti/tcomb-form-native) Forms library for react-native
|
||||
* [tcomb-generate](https://github.com/typeetfunc/tcomb-generate) Generates random data by tcomb type for property-based testing
|
||||
* [tcomb-additional-types](http://github.com/eserozvataf/tcomb-additional-types) Provides additional predefined types for your existing tcomb setup
|
||||
* [tcomb-builder](https://github.com/cadre/tcomb-builder) An immutable syntax for defining tcomb types and forms
|
||||
|
||||
# Similar projects
|
||||
|
||||
* [typed-immutable](https://github.com/Gozala/typed-immutable)
|
||||
* [immu](https://github.com/scottcorgan/immu)
|
||||
* [immutable](https://github.com/facebook/immutable-js)
|
||||
* [mori](https://github.com/swannodette/mori)
|
||||
* [seamless-immutable](https://github.com/rtfeldman/seamless-immutable)
|
||||
* [deep-freeze](https://www.npmjs.com/package/deep-freeze)
|
||||
* [freezer](https://github.com/arqex/freezer)
|
||||
* [icedam](https://github.com/winkler1/icedam)
|
||||
* [ObjectModel](https://github.com/sylvainpolletvillard/ObjectModel)
|
||||
* [rfx](https://github.com/ericelliott/rfx)
|
||||
|
||||
# License
|
||||
|
||||
The MIT License (MIT)
|
||||
270
backend/frontend/node_modules/tcomb/index.d.ts
generated
vendored
Normal file
270
backend/frontend/node_modules/tcomb/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,270 @@
|
||||
type Predicate<T> = (x: T) => boolean;
|
||||
type TypeGuardPredicate<T> = (x: any) => x is T;
|
||||
|
||||
interface Type<T> extends Function {
|
||||
(value: T): T;
|
||||
is: TypeGuardPredicate<T>;
|
||||
displayName: string;
|
||||
meta: {
|
||||
kind: string;
|
||||
name: string;
|
||||
identity: boolean;
|
||||
};
|
||||
t: T;
|
||||
}
|
||||
|
||||
//
|
||||
// irreducible
|
||||
//
|
||||
|
||||
interface Irreducible<T> extends Type<T> {
|
||||
meta: {
|
||||
kind: string;
|
||||
name: string;
|
||||
identity: boolean;
|
||||
predicate: TypeGuardPredicate<T>;
|
||||
};
|
||||
}
|
||||
|
||||
export function irreducible<T>(name: string, predicate: Predicate<any>): Irreducible<T>;
|
||||
|
||||
//
|
||||
// basic types
|
||||
//
|
||||
|
||||
export var Any: Irreducible<any>;
|
||||
export var Nil: Irreducible<void | null>;
|
||||
export var String: Irreducible<string>;
|
||||
export var Number: Irreducible<number>;
|
||||
export var Integer: Irreducible<number>;
|
||||
export var Boolean: Irreducible<boolean>;
|
||||
export var Array: Irreducible<Array<any>>;
|
||||
export var Object: Irreducible<Object>; // FIXME restrict to POJOs
|
||||
export var Function: Irreducible<Function>;
|
||||
export var Error: Irreducible<Error>;
|
||||
export var RegExp: Irreducible<RegExp>;
|
||||
export var Date: Irreducible<Date>;
|
||||
|
||||
interface ApplyCommand { $apply: Function; }
|
||||
interface PushCommand { $push: Array<any>; }
|
||||
interface RemoveCommand { $remove: Array<string>; }
|
||||
interface SetCommand { $set: any; }
|
||||
interface SpliceCommand { $splice: Array<Array<any>>; }
|
||||
interface SwapCommand { $swap: { from: number; to: number; }; }
|
||||
interface UnshiftCommand { $unshift: Array<any>; }
|
||||
interface MergeCommand { $merge: Object; }
|
||||
type Command = ApplyCommand | PushCommand | RemoveCommand | SetCommand | SpliceCommand | SwapCommand | UnshiftCommand | MergeCommand;
|
||||
type UpdatePatch = Command | { [key: string]: UpdatePatch };
|
||||
type Update<T> = (instance: T, spec: UpdatePatch) => T;
|
||||
|
||||
type Constructor<T> = Type<T> | Function;
|
||||
|
||||
//
|
||||
// refinement
|
||||
//
|
||||
|
||||
interface Refinement<T> extends Type<T> {
|
||||
meta: {
|
||||
kind: string;
|
||||
name: string;
|
||||
identity: boolean;
|
||||
type: Constructor<T>;
|
||||
predicate: TypeGuardPredicate<T>;
|
||||
};
|
||||
update: Update<T>;
|
||||
}
|
||||
|
||||
export function refinement<T>(type: Constructor<T>, predicate: Predicate<T>, name?: string): Refinement<T>;
|
||||
|
||||
//
|
||||
// struct
|
||||
//
|
||||
|
||||
type StructProps = { [key: string]: Constructor<any> };
|
||||
type StructMixin = StructProps | Struct<any> | Interface<any>;
|
||||
|
||||
interface Struct<T> extends Type<T> {
|
||||
new(value: T): T;
|
||||
meta: {
|
||||
kind: string;
|
||||
name: string;
|
||||
identity: boolean;
|
||||
props: StructProps;
|
||||
strict: boolean;
|
||||
defaultProps: object;
|
||||
};
|
||||
update: Update<T>;
|
||||
extend<E extends T>(mixins: StructMixin | Array<StructMixin>, name?: string | StructOptions): Struct<E>;
|
||||
}
|
||||
|
||||
type StructOptions = {
|
||||
name?: string,
|
||||
strict?: boolean,
|
||||
defaultProps?: object
|
||||
};
|
||||
|
||||
export function struct<T>(props: StructProps, name?: string | StructOptions): Struct<T>;
|
||||
|
||||
//
|
||||
// interface
|
||||
//
|
||||
|
||||
interface Interface<T> extends Type<T> {
|
||||
meta: {
|
||||
kind: string;
|
||||
name: string;
|
||||
identity: boolean;
|
||||
props: StructProps;
|
||||
strict: boolean;
|
||||
};
|
||||
update: Update<T>;
|
||||
extend<E extends T>(mixins: StructMixin | Array<StructMixin>, name?: string | StructOptions): Struct<E>;
|
||||
}
|
||||
|
||||
export function interface<T>(props: StructProps, name?: string | StructOptions): Interface<T>;
|
||||
|
||||
//
|
||||
// list
|
||||
//
|
||||
|
||||
interface List<T> extends Type<Array<T>> {
|
||||
meta: {
|
||||
kind: string;
|
||||
name: string;
|
||||
identity: boolean;
|
||||
type: Constructor<T>;
|
||||
};
|
||||
update: Update<Array<T>>;
|
||||
}
|
||||
|
||||
export function list<T>(type: Constructor<T>, name?: string): List<T>;
|
||||
|
||||
//
|
||||
// dict combinator
|
||||
//
|
||||
|
||||
interface Dict<T> extends Type<{ [key: string]: T; }> {
|
||||
meta: {
|
||||
kind: string;
|
||||
name: string;
|
||||
identity: boolean;
|
||||
domain: Constructor<string>;
|
||||
codomain: T;
|
||||
};
|
||||
update: Update<{ [key: string]: T; }>;
|
||||
}
|
||||
|
||||
export function dict<T>(domain: Constructor<string>, codomain: Constructor<T>, name?: string): Dict<T>;
|
||||
|
||||
//
|
||||
// enums combinator
|
||||
//
|
||||
|
||||
interface Enums extends Type<string> {
|
||||
meta: {
|
||||
kind: string;
|
||||
name: string;
|
||||
identity: boolean;
|
||||
map: Object;
|
||||
};
|
||||
}
|
||||
|
||||
interface EnumsFunction extends Function {
|
||||
(map: Object, name?: string): Enums;
|
||||
of(enums: string, name?: string): Enums;
|
||||
of(enums: Array<string>, name?: string): Enums;
|
||||
}
|
||||
|
||||
export var enums: EnumsFunction;
|
||||
|
||||
//
|
||||
// maybe combinator
|
||||
//
|
||||
|
||||
interface Maybe<T> extends Type<void | T> {
|
||||
meta: {
|
||||
kind: string;
|
||||
name: string;
|
||||
identity: boolean;
|
||||
type: Constructor<T>;
|
||||
};
|
||||
update: Update<void | T>;
|
||||
}
|
||||
|
||||
export function maybe<T>(type: Constructor<T>, name?: string): Maybe<T>;
|
||||
|
||||
//
|
||||
// tuple combinator
|
||||
//
|
||||
|
||||
interface Tuple<T> extends Type<T> {
|
||||
meta: {
|
||||
kind: string;
|
||||
name: string;
|
||||
identity: boolean;
|
||||
types: Array<Constructor<any>>;
|
||||
};
|
||||
update: Update<T>;
|
||||
}
|
||||
|
||||
export function tuple<T>(types: Array<Constructor<any>>, name?: string): Tuple<T>;
|
||||
|
||||
//
|
||||
// union combinator
|
||||
//
|
||||
|
||||
interface Union<T> extends Type<T> {
|
||||
meta: {
|
||||
kind: string;
|
||||
name: string;
|
||||
identity: boolean;
|
||||
types: Array<Constructor<T>>;
|
||||
};
|
||||
update: Update<T>;
|
||||
dispatch(x: any): Constructor<T>;
|
||||
}
|
||||
|
||||
export function union<T>(types: Array<Constructor<T>>, name?: string): Union<T>;
|
||||
|
||||
//
|
||||
// intersection combinator
|
||||
//
|
||||
|
||||
interface Intersection<T> extends Type<T> {
|
||||
meta: {
|
||||
kind: string;
|
||||
name: string;
|
||||
identity: boolean;
|
||||
types: Array<Constructor<any>>;
|
||||
};
|
||||
update: Update<T>;
|
||||
}
|
||||
|
||||
export function intersection<T>(types: Array<Constructor<any>>, name?: string): Intersection<T>;
|
||||
|
||||
//
|
||||
// declare combinator
|
||||
//
|
||||
|
||||
interface Declare<T> extends Type<T> {
|
||||
update: Update<T>;
|
||||
define(type: Type<any>): void;
|
||||
}
|
||||
|
||||
export function declare<T>(name?: string): Declare<T>;
|
||||
|
||||
//
|
||||
// other exports
|
||||
//
|
||||
|
||||
export function is<T>(x: any, type: Constructor<T>): boolean;
|
||||
type LazyMessage = () => string;
|
||||
export function assert(guard: boolean, message?: string | LazyMessage): void;
|
||||
export function fail(message: string): void;
|
||||
export function isType<T>(x: Constructor<T>): boolean;
|
||||
export function getTypeName<T>(x: Constructor<T>): string;
|
||||
export function mixin<T, S>(target: T, source: S, overwrite?: boolean): T & S;
|
||||
type Function1 = (x: any) => any;
|
||||
type Clause = Constructor<any> | Function1;
|
||||
export function match(x: any, ...clauses: Array<Clause>): any; // FIXME
|
||||
export var update: Update<Object>;
|
||||
68
backend/frontend/node_modules/tcomb/index.js
generated
vendored
Normal file
68
backend/frontend/node_modules/tcomb/index.js
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
/*! @preserve
|
||||
*
|
||||
* tcomb.js - Type checking and DDD for JavaScript
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2014-2016 Giulio Canti
|
||||
*
|
||||
*/
|
||||
|
||||
// core
|
||||
var t = require('./lib/assert');
|
||||
|
||||
// types
|
||||
t.Any = require('./lib/Any');
|
||||
t.Array = require('./lib/Array');
|
||||
t.Boolean = require('./lib/Boolean');
|
||||
t.Date = require('./lib/Date');
|
||||
t.Error = require('./lib/Error');
|
||||
t.Function = require('./lib/Function');
|
||||
t.Nil = require('./lib/Nil');
|
||||
t.Number = require('./lib/Number');
|
||||
t.Integer = require('./lib/Integer');
|
||||
t.IntegerT = t.Integer;
|
||||
t.Object = require('./lib/Object');
|
||||
t.RegExp = require('./lib/RegExp');
|
||||
t.String = require('./lib/String');
|
||||
t.Type = require('./lib/Type');
|
||||
t.TypeT = t.Type;
|
||||
|
||||
// short alias are deprecated
|
||||
t.Arr = t.Array;
|
||||
t.Bool = t.Boolean;
|
||||
t.Dat = t.Date;
|
||||
t.Err = t.Error;
|
||||
t.Func = t.Function;
|
||||
t.Num = t.Number;
|
||||
t.Obj = t.Object;
|
||||
t.Re = t.RegExp;
|
||||
t.Str = t.String;
|
||||
|
||||
// combinators
|
||||
t.dict = require('./lib/dict');
|
||||
t.declare = require('./lib/declare');
|
||||
t.enums = require('./lib/enums');
|
||||
t.irreducible = require('./lib/irreducible');
|
||||
t.list = require('./lib/list');
|
||||
t.maybe = require('./lib/maybe');
|
||||
t.refinement = require('./lib/refinement');
|
||||
t.struct = require('./lib/struct');
|
||||
t.tuple = require('./lib/tuple');
|
||||
t.union = require('./lib/union');
|
||||
t.func = require('./lib/func');
|
||||
t.intersection = require('./lib/intersection');
|
||||
t.subtype = t.refinement;
|
||||
t.inter = require('./lib/interface'); // IE8 alias
|
||||
t['interface'] = t.inter;
|
||||
|
||||
// functions
|
||||
t.assert = t;
|
||||
t.update = require('./lib/update');
|
||||
t.mixin = require('./lib/mixin');
|
||||
t.isType = require('./lib/isType');
|
||||
t.is = require('./lib/is');
|
||||
t.getTypeName = require('./lib/getTypeName');
|
||||
t.match = require('./lib/match');
|
||||
|
||||
module.exports = t;
|
||||
62
backend/frontend/node_modules/tcomb/package.json
generated
vendored
Normal file
62
backend/frontend/node_modules/tcomb/package.json
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"name": "tcomb",
|
||||
"version": "3.2.29",
|
||||
"description": "Type checking and DDD for JavaScript",
|
||||
"main": "index.js",
|
||||
"typings": "index.d.ts",
|
||||
"files": [
|
||||
"index.js",
|
||||
"lib",
|
||||
"index.d.ts"
|
||||
],
|
||||
"scripts": {
|
||||
"lint": "eslint index.js lib test",
|
||||
"test": "npm run lint && mocha && npm run typescript",
|
||||
"typescript": "tsc --noEmit tcomb-tests.ts",
|
||||
"dist": "webpack",
|
||||
"perf": "node ./perf/perf"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/gcanti/tcomb.git"
|
||||
},
|
||||
"author": "Giulio Canti <giulio.canti@gmail.com>",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/gcanti/tcomb/issues"
|
||||
},
|
||||
"homepage": "https://github.com/gcanti/tcomb",
|
||||
"devDependencies": {
|
||||
"benchmark": "2.1.0",
|
||||
"eslint": "1.10.3",
|
||||
"mocha": "2.3.4",
|
||||
"typescript": "3.1.6",
|
||||
"webpack": "1.12.14"
|
||||
},
|
||||
"tags": [
|
||||
"type",
|
||||
"combinators",
|
||||
"checking",
|
||||
"safety",
|
||||
"model",
|
||||
"domain",
|
||||
"debugging",
|
||||
"immutable",
|
||||
"DDD",
|
||||
"JSON",
|
||||
"store"
|
||||
],
|
||||
"keywords": [
|
||||
"type",
|
||||
"combinators",
|
||||
"checking",
|
||||
"safety",
|
||||
"model",
|
||||
"domain",
|
||||
"debugging",
|
||||
"immutable",
|
||||
"DDD",
|
||||
"JSON",
|
||||
"store"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user