This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getNames(xs) { | |
| let idx = 0 | |
| let result = [] | |
| while (idx < xs.length) { | |
| result[idx] = xs[idx].name | |
| idx = idx + 1 | |
| } | |
| return result | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const people = [ | |
| { name: 'John', surname: 'Garry' }, | |
| { name: 'Bambi', surname: 'Pinkman' }, | |
| { name: 'Gina', surname: 'JustGina' }, | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function toHexs(xs) { | |
| let idx = 0 | |
| let result = [] | |
| while (idx < xs.length) { | |
| result[idx] = xs[idx].toString(16) | |
| idx = idx + 1 | |
| } | |
| return result | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function toStrings(xs) { | |
| let idx = 0 | |
| let result = [] | |
| while (idx < xs.length) { | |
| result[idx] = xs[idx].toString() | |
| idx = idx + 1 | |
| } | |
| return result | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function add1(xs) { | |
| let idx = 0 | |
| let result = [] | |
| while (idx < xs.length) { | |
| result[idx] = xs[idx] + 1 | |
| idx = idx + 1 | |
| } | |
| return result | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const jsdom = require('jsdom').jsdom | |
| const fs = require('fs') | |
| const path = require('path') | |
| const { | |
| ContentState, | |
| convertToRaw, | |
| convertFromRaw, | |
| } = require('draft-js') | |
| const React = fs.readFileSync(path.join(__dirname, '../node_modules/react/dist/react.js')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type ComposeFn<V0,V1,V2,T1,T2,T3,T4,T5,T6> = | |
| & ( <V0,V1,V2,T1,T2,T3,T4,T5,T6>( fn5:(x: T5) => T6, fn4: (x: T4) => T5, fn3: (x: T3) => T4, fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: (x0: V0, x1: V1, x2: V2) => T1, $?: null) => (x0: V0, x1: V1, x2: V2) => T6 ) | |
| & ( <V0,V1,T1,T2,T3,T4,T5,T6>( fn5:(x: T5) => T6, fn4: (x: T4) => T5, fn3: (x: T3) => T4, fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: (x0: V0, x1: V1) => T1, $?: null) => (x0: V0, x1: V1) => T6 ) | |
| & ( <V0,T1,T2,T3,T4,T5,T6>( fn5:(x: T5) => T6, fn4: (x: T4) => T5, fn3: (x: T3) => T4, fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: (x0: V0) => T1, $?: null) => (x0: V0) => T6 ) | |
| & ( <V0,V1,V2,T1,T2,T3,T4,T5>( fn4: (x: T4) => T5, fn3: (x: T3) => T4, fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: (x0: V0, x1: V1, x2: V2) => T1, $?: null) => (x0: V0, x1: V1, x2: V2) => T5 ) | |
| & ( <V0,V1,T1,T2,T3,T4,T5>( fn4: (x: T4) => T5, fn3: (x: T3) => T4, fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: (x0: V0, x1: V1) => T1, $?: null) => (x0: V0, x1: V1) => T5 ) | |
| & ( <V0,T1,T2,T3,T4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const Color = Type({RGB:[Number, Number, Number], CMYK:[Number, Number, Number, Number]}); | |
| const Color_ = Type({RGB:{Red: Number, Green: Number, Blue: Number}, CMYK:{Cyan: Number, Magenta: Number, Yellow: Number, Black:Number}}); | |
| const {Person} = Type({Person: {name: String, id: Number, leftEyeColor: Color_, rightEyeColor: Color}}); | |
| let person = Person({name: 'John', id: 1, leftEyeColor: Color.RGB(255,100,255), rightEyeColor: Color_.CMYK({Cyan: 50, Magenta: 80, Yellow: 10, Black: 25})}); | |
| let personWithoutEyes = Person('John', 2); | |
| let person2 = personWithoutEyes(Color.RGB(100,100,100), Color.CMYK(30,30,30,0)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {curryN} from 'ramda'; | |
| var _validate = function(){}; | |
| function Constructor(group, name, validators) { | |
| let cons = Object.create(group, { | |
| _ctor: { | |
| value: name | |
| }, | |
| toString: { | |
| value: function(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function webpackUniversalModuleDefinition(root, factory) { | |
| if(typeof exports === 'object' && typeof module === 'object') | |
| module.exports = factory(); | |
| else if(typeof define === 'function' && define.amd) | |
| define(factory); | |
| else if(typeof exports === 'object') | |
| exports["fantasy"] = factory(); | |
| else | |
| root["fantasy"] = factory(); | |
| })(this, function() { |
NewerOlder