given
const compose = (...functions) =>
(...params) =>
functions
.reduce(
(acc, func) => [func(...acc)],
params,
)[0]
// a reduce function for a generator | |
// the result of the reducer function gets passed into next | |
function reduce( | |
reducer, | |
seed, | |
) { | |
const gen = this(seed); | |
let acc = seed; | |
let results = []; | |
let next = gen.next(); |
"use strict"; | |
/** | |
* @module opcua.server | |
* | |
*/ | |
const assert = require("node-opcua-assert").assert; | |
const _ = require("underscore"); |
// serialises access to an action | |
export default () => { | |
// promise to allow the next action | |
let next = Promise.resolve() | |
return (action) => { | |
let nextResolve | |
const nextNext = () => new Promise( | |
(resolve, reject) => | |
action() | |
.then( |
export default (...functions) => | |
param => | |
functions | |
.reduce( | |
(acc, func) => func(acc), | |
param, | |
) |
given
const compose = (...functions) =>
(...params) =>
functions
.reduce(
(acc, func) => [func(...acc)],
params,
)[0]
import mssql, { Request } from 'mssql' | |
import colors from 'colors' | |
import config from 'config' | |
import squel from 'squel' | |
const squelMssql = squel.useFlavour('mssql') | |
// import configurationStreams from './kafka/configuration' | |
// import runtimeStreams from './kafka/runtime' |