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 { ethers } from 'hardhat'; | |
import fs from 'fs'; | |
import path from 'path'; | |
async function main() { | |
const envArgs = process.env.SCRIPT_ARGS | |
? process.env.SCRIPT_ARGS.split(' ') | |
: []; | |
const [contractName, ...args] = envArgs; | |
const contractsDir = path.join(__dirname, '..', 'contracts'); |
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 moment = require('moment'); | |
const { URL_SESSION_HISTORY } = require('../../src/constants/urls'); | |
const { STATUS_OK } = require('../../src/constants/used-http-status-codes'); | |
const mocker = require('../../dev-helpers/testing/mocker'); | |
const handler = mocker((req, res) => | |
res.status(STATUS_OK).send({ | |
sessions: [ | |
{ |
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 R = require('ramda'); | |
const composeMaybe = require('./compose-maybe').composeMaybe; | |
/** | |
* Returns a value of Maybe object after applying set of transformers | |
* default → [(y → z), (x → y), …, (o → p), ((a, b, …, n) → o)] → ((a, b, …, n) → z | default) | |
*/ | |
const composeMaybeWithDefault = R.curry((defaultVal, transformers) => | |
R.memoize(R.o(R.invoker(1, 'withDefault')(defaultVal), composeMaybe(...transformers))) |
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 webpack = require('webpack'); | |
const path = require('path'); | |
const autoprefixer = require('autoprefixer'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
const RollbarSourceMapPlugin = require('rollbar-sourcemap-webpack-plugin'); | |
const envVarStubs = require('./package.json').appSettings.envVarStubs; | |
const envVars = process.env; | |
const isProd = process.argv.includes('-p'); |
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 argsToArray = unapply(identity); | |
argsToArray(1, 3, 5); //-> [1, 3, 5] | |
//////////////////////////////////////////////////////////////// | |
const dropArgs = curryN(2, compose( | |
apply(drop), | |
splitAt(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 getProm = val => new Promise(resolve => resolve(val)); | |
composeP(inc, getProm)(5).then(res => console.log(res)) //-> Promise 6 |
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 fn = obj => key => key => propOr(key, key, obj); | |
const fn = warblerstar(robinstar(propOr)); | |
const src = { | |
some: 22, | |
other: 33 | |
}; | |
fn(src, 'some'); //-> 22 | |
fn(src, 'qqq'); //-> 'qqq' |
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
// var overlaps = (spec, list) => !!find(contains(__, list), spec); | |
var overlaps = useWith(compose(Boolean, call), [flip(find), flip(contains)]); | |
var list = ['node', 'script.js', '-v'] | |
overlaps(['-v', '--verbose'], list) //-> true |
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
// var overlaps = (spec, list) => !!find(contains(__, list), spec); | |
var overlaps = useWith(compose(Boolean, call), [flip(find), flip(contains)]); | |
var list = ['node', 'script.js', '-v'] | |
overlaps(['-v', '--verbose'], list) //-> true |
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
var mapKeys = useWith(compose(fromPairs, call), [o(map, adjust(__, 0)), toPairs]) | |
mapKeys(R.toUpper, { a: 1, b: 2, c: 3 }); //=> {"A": 1, "B": 2, "C": 3} |
NewerOlder