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
| Mocha { | |
| files: [ '/Users/davidfox-powell/dev/sos-server/test/unit/server-middleware-spec.js' ], | |
| options: { reporterOptions: {}, globals: [] }, | |
| suite: | |
| Suite { | |
| title: '', | |
| ctx: {}, | |
| suites: [], | |
| tests: [], | |
| pending: false, |
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 {isJSON} from '../utils/is-json'; | |
| import request from './superagent'; | |
| export async function({method = 'GET', url}) { | |
| method = method.toUpperCase(); | |
| const methods = ['GET', 'POST']; | |
| let [foundMethod] = methods.filter(m => method === m); | |
| if (!foundMethod) { | |
| throw new Error('you specified an unknown method') |
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 reactor from '../modules/bootstrap'; | |
| import serverMod from '@hfa/sos-server/lib/modules/server'; | |
| import formMetaMod from '../modules/form-meta'; | |
| import {Getters as FormGetters, makeActions as makeFormActions} from '@hfa/form-components'; | |
| import {analytics} from '../config'; | |
| import {isFunction} from '../utils/lodash'; | |
| class BootStrap { | |
| constructor() { | |
| const {_reactor = '{}'} = global.hfaGlobals || {}; |
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
| export default [ | |
| {title: 'red', message: 'I\'m red', color: 'red'}, | |
| {title: 'blue', message: 'I\'m blue', color: 'blue'}, | |
| {title: 'green', message: 'I\'m green', color: 'green'} | |
| ] |
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 {get as getFormData} from './form-data.js'; | |
| class FormComp extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.inputs = getFormDate({omit: ['zipcode']}).map((inputData, i) => <Input {...inputData} key={`form_comp_${i}`} required />); | |
| } | |
| render() { | |
| return ( |
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
| @provideReactor(provideContextProps) | |
| class Wrapper extends Component { | |
| static propTypes = { | |
| children: PropTypes.array.isRequired | |
| }; | |
| render() { | |
| <div> | |
| {this.props.children} | |
| </div> |
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
| /* | |
| * Objects | |
| */ | |
| const props = { | |
| 1: 1, | |
| 2: 2, | |
| 3: 3, | |
| 4: 4 | |
| } | |
| const {a,b, ...rest} = props //a = 1, b = 2, rest = {3: 3, 4: 4} |
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
| //colors | |
| /^(?:#?[a-f\d]+|[a-s]{1,4}\s?\([\d%\s,.]+\))$/i | |
| 'hsla(0, 10%, 50%, 0.5)' | |
| '#000000000' | |
| '#11111' | |
| 'argb(1,1,1)' | |
| 'hsl (20,0%, 50%)' | |
| 'hsl(20, 20%, 20%)' | |
| '#6F6F6F' |
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 request from 'superagent'; | |
| import cheerio from 'cheerio'; | |
| import vo from 'vo'; | |
| import {readFile} from 'fs'; | |
| /** | |
| * An example generator | |
| */ | |
| function *gen(init) { | |
| //confusing because what is stored in `first` variables is not what is returned from |