This file contains 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 compose = (...funcs) => | |
funcs.reduce((a, b) => (...args) => a(b(...args)), arg => arg) |
This file contains 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 getValue = (form, fieldName) => form[fieldName] | |
const form = { | |
firstName: 'dima', | |
lastName: 'shelomanov' | |
} | |
const curry = (fn, ...args) => | |
(...currentArgs) => { | |
const allArgs = [...args, ...currentArgs] |
This file contains 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
it.only('counter COUNTER_PLUS state', () => { | |
const store = global.mockStore(INITIAL_STATE) | |
const actions = store.dispatch(plus(1)) | |
const testFn = counter(store.getState(), actions) | |
expect(testFn).toEqual({ | |
number: 1 | |
}) | |
expect(store.getActions()[0]).toEqual({ | |
type: types.COUNTER_PLUS, | |
payload: 1 |
This file contains 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 debug = require('debug')('banner:uploadBanner') | |
const fs = require('mz/fs') | |
const path = require('path') | |
const { | |
isZipFile, | |
notEmptyFile, | |
uuid, | |
decompress, | |
folderTree | |
} = require('../../helpers') |
This file contains 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
componentDidUpdate() { | |
if (this.cloneImage && this.originalWrap) { | |
this.originalImage = this.originalWrap.querySelector('img') | |
this.addEventListener() | |
this.clearStyles() | |
} | |
} | |
componentWillUnmount() { | |
this.removeListeners() |
This file contains 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 React, { Component } from 'react' | |
import styled from 'styled-components' | |
import PropTypes from 'prop-types' | |
import { | |
FlexWrap, | |
} from '../' | |
import { api } from '../../helpers/api' | |
class GifChangeContainer extends Component { |
This file contains 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 React, { Component } from 'react' | |
import styled from 'styled-components' | |
import PropTypes from 'prop-types' | |
import { connect } from 'react-redux' | |
import { | |
FlexWrap, | |
RangeVertical, | |
} from '../' | |
import { api } from '../../helpers/api' |
This file contains 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
let props | |
let withInfo | |
let withoutInfo | |
beforeEach(() => { | |
withInfo = { | |
url: 'path_to_image', | |
info: { | |
percentCompress: 0, | |
}, |
This file contains 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 test from 'ava' | |
import { stub } from 'sinon' | |
import { Ctx } from '../../../../__TESTS__/koa-ctx' | |
import isZipFile from './is-zip-file' | |
/* eslint-disable prefer-destructuring */ | |
/* eslint-disable no-param-reassign */ | |
test.beforeEach((t) => { | |
t.context.ctx = new Ctx() | |
t.context.nextReturns = Math.random() |
This file contains 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 debug = require('debug')('banner:update-color-bg') | |
const fs = require('fs-extra') | |
const cheerio = require('cheerio') | |
const { | |
tempPath, | |
folderExists, | |
} = require('../utils') | |
const data = function data(color) { | |
return ` |
OlderNewer