Skip to content
Permalink
Browse files

Move select helper

  • Loading branch information...
antonmedv committed Apr 3, 2019
1 parent 5c228cc commit 35526cc4d3d74f08b3be4637a1934885d2ed7ab6
Showing with 10 additions and 12 deletions.
  1. +10 −12 index.js
@@ -4,6 +4,16 @@ const os = require('os')
const fs = require('fs')
const path = require('path')

const skip = Symbol('skip')
global.select = function select(cb) {
return json => {
if (!cb(json)) {
throw skip
}
return json
}
}

try {
require(path.join(os.homedir(), '.fxrc')) // Should be required before config.js usage.
} catch (err) {
@@ -43,8 +53,6 @@ const usage = `

const {stdin, stdout, stderr} = process
const args = process.argv.slice(2)
const skip = Symbol('skip')
global.select = select


void function main() {
@@ -121,13 +129,3 @@ function apply(json) {
console.log(text)
}
}


function select(cb) {
return json => {
if (!cb(json)) {
throw skip
}
return json
}
}

0 comments on commit 35526cc

Please sign in to comment.
You can’t perform that action at this time.