functionfoundry
Advanced tools
Comparing version 0.6.3 to 0.6.4
@@ -21,2 +21,7 @@ 'use strict'; | ||
} else if (i === cases.length - 1) { | ||
if (i % 2 === 1) { | ||
return; // nothing found | ||
} | ||
// return the last item | ||
@@ -23,0 +28,0 @@ return b; |
@@ -6,2 +6,3 @@ 'use strict'; | ||
}); | ||
exports.functions = exports.engineeringFunctions = exports.textFunctions = exports.statisticFunctions = exports.financialFunctions = exports.dateTimeFunctions = exports.mathFunctions = exports.dataFunctions = exports.referenceFunctions = exports.informationFunctions = exports.logicalFunctions = undefined; | ||
@@ -84,2 +85,4 @@ var _ABS = require('./ABS'); | ||
var _ISURL = require('./ISURL'); | ||
var _LOOKUP = require('./LOOKUP'); | ||
@@ -137,36 +140,25 @@ | ||
var logicalFunctions = ['if', 'ifna', 'iferror', 'and', 'eq', 'or', 'xor', 'not', 'lt', 'lte', 'gt', 'gte', 'ne', 'switch', 'choose', 'cond']; | ||
var logicalFunctions = exports.logicalFunctions = ['if', 'ifna', 'iferror', 'and', 'eq', 'or', 'xor', 'not', 'lt', 'lte', 'gt', 'gte', 'ne', 'switch', 'choose', 'cond']; | ||
var informationFunctions = ['isarray', 'isblank', 'isemail', 'iserror', 'iseven', 'isformula', 'islogical', 'isna', 'isnontext', 'isnumber', 'isodd', 'istext', 'isrange', 'isref', 'isurl', 'n', 'na', 'precedents', 'sheet', 'sheets', 'type']; | ||
var informationFunctions = exports.informationFunctions = ['isarray', 'isblank', 'isemail', 'iserror', 'iseven', 'isformula', 'islogical', 'isna', 'isnontext', 'isnumber', 'isodd', 'istext', 'isrange', 'isref', 'isurl', 'n', 'na', 'precedents', 'sheet', 'sheets', 'type']; | ||
var referenceFunctions = ['indirect', 'isref', 'rows', 'columns', 'range', 'cell', 'cellindex', 'index2addr', 'index2col', 'index2row']; | ||
var referenceFunctions = exports.referenceFunctions = ['indirect', 'isref', 'rows', 'columns', 'range', 'cell', 'cellindex', 'index2addr', 'index2col', 'index2row']; | ||
var dataFunctions = ['sort', 'filter', 'unique']; | ||
var dataFunctions = exports.dataFunctions = ['sort', 'filter', 'unique']; | ||
var mathFunctions = ['abs', 'acos', 'acosh', 'acot', 'acoth', 'add', 'aggregate', 'arabic', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'base', 'ceiling', 'combin', 'combina', 'cos', 'cosh', 'cot', 'coth', 'csc', 'csch', 'decimal', 'degrees', 'divide', 'even', 'exp', 'fact', 'factdouble', 'floor', 'gcd', 'gt', 'gte', 'int', 'lcm', 'log', 'log10', 'lt', 'lte', 'mdeterm', 'minus', 'minverse', 'mmult', 'mod', 'mround', 'multinomial', 'multiply', 'odd', 'pi', 'tau', 'power', 'product', 'quotient', 'radians', 'rand', 'randbetween', 'roman', 'round', 'rounddown', 'roundup', 'sec', 'sech', 'seriessum', 'sign', 'sin', 'sqrt', 'sqrtpi', 'subtotal', 'sum', 'tan']; | ||
var mathFunctions = exports.mathFunctions = ['abs', 'acos', 'acosh', 'acot', 'acoth', 'add', 'aggregate', 'arabic', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'base', 'ceiling', 'combin', 'combina', 'cos', 'cosh', 'cot', 'coth', 'csc', 'csch', 'decimal', 'degrees', 'divide', 'even', 'exp', 'fact', 'factdouble', 'floor', 'gcd', 'gt', 'gte', 'int', 'lcm', 'log', 'log10', 'lt', 'lte', 'mdeterm', 'minus', 'minverse', 'mmult', 'mod', 'mround', 'multinomial', 'multiply', 'odd', 'pi', 'tau', 'power', 'product', 'quotient', 'radians', 'rand', 'randbetween', 'roman', 'round', 'rounddown', 'roundup', 'sec', 'sech', 'seriessum', 'sign', 'sin', 'sqrt', 'sqrtpi', 'subtotal', 'sum', 'tan']; | ||
var dateTimeFunctions = ['date', 'datevalue', 'datedif', 'day', 'days360', 'edate', 'eomonth', 'hour', 'isleapyear', 'isoweeknum', 'minute', 'month', 'networkdays', 'now', 'second', 'time', 'timevalue', 'today', 'weekday', 'weeknum', 'workday', 'year', 'yearfrac']; | ||
var dateTimeFunctions = exports.dateTimeFunctions = ['date', 'datevalue', 'datedif', 'day', 'days360', 'edate', 'eomonth', 'hour', 'isleapyear', 'isoweeknum', 'minute', 'month', 'networkdays', 'now', 'second', 'time', 'timevalue', 'today', 'weekday', 'weeknum', 'workday', 'year', 'yearfrac']; | ||
var financialFunctions = ['accrintm', 'amorlinc', 'coupdays', 'coupdaysnc', 'coupncd', 'coupnum', 'couppcd', 'cumipmt', 'cumprinc', 'db', 'ddb', 'disc', 'dollarde', 'dollarfr', 'duration', 'effect', 'fv', 'fvschedule', 'intrate', 'irr', 'ipmt', 'mduration', 'mirr', 'nominal', 'nper', 'npv', 'oddfprice', 'oddfyield', 'pmt', 'pv']; | ||
var financialFunctions = exports.financialFunctions = ['accrintm', 'amorlinc', 'coupdays', 'coupdaysnc', 'coupncd', 'coupnum', 'couppcd', 'cumipmt', 'cumprinc', 'db', 'ddb', 'disc', 'dollarde', 'dollarfr', 'duration', 'effect', 'fv', 'fvschedule', 'intrate', 'irr', 'ipmt', 'mduration', 'mirr', 'nominal', 'nper', 'npv', 'oddfprice', 'oddfyield', 'pmt', 'pv']; | ||
var statisticFunctions = ['avedev', 'average', 'averagea', 'averageif', 'averageifs', 'correl', 'count', 'counta', 'countin', 'countblank', 'countif', 'countifs', 'countunique', 'devsq', 'fisher', 'fisherinv', 'forecast', 'frequency', 'gammaln', 'geomean', 'growth', 'harmean', 'intercept', 'kurt', 'large', 'linest', 'logest', 'max', 'maxa', 'median', 'min', 'mina', 'pearson', 'permut', 'permutationa', 'phi', 'prob', 'rsq', 'skew', 'slope', 'small', 'standardize', 'stdeva', 'stdevpa', 'steyx', 'transpose', 'trend', 'trimmean', 'vara', 'varpa']; | ||
var statisticFunctions = exports.statisticFunctions = ['avedev', 'average', 'averagea', 'averageif', 'averageifs', 'correl', 'count', 'counta', 'countin', 'countblank', 'countif', 'countifs', 'countunique', 'devsq', 'fisher', 'fisherinv', 'forecast', 'frequency', 'gammaln', 'geomean', 'growth', 'harmean', 'intercept', 'kurt', 'large', 'linest', 'logest', 'max', 'maxa', 'median', 'min', 'mina', 'pearson', 'permut', 'permutationa', 'phi', 'prob', 'rsq', 'skew', 'slope', 'small', 'standardize', 'stdeva', 'stdevpa', 'steyx', 'transpose', 'trend', 'trimmean', 'vara', 'varpa']; | ||
var textFunctions = ['asc', 'bahttext', 'clean', 'char', 'code', 'concatenate', 'dbcs', 'dollar', 'exact', 'find', 'fixed', 'left', 'len', 'lower', 'join', 'mid', 'numbervalue', 'pronetic', 'proper', 'replace', 'rept', 'right', 'search', 'split', 'substitute', 't', 'text', 'trim', 'upper', 'value']; | ||
var textFunctions = exports.textFunctions = ['asc', 'bahttext', 'clean', 'char', 'code', 'concatenate', 'dbcs', 'dollar', 'exact', 'find', 'fixed', 'left', 'len', 'lower', 'join', 'mid', 'numbervalue', 'pronetic', 'proper', 'replace', 'rept', 'right', 'search', 'split', 'substitute', 't', 'text', 'trim', 'upper', 'value']; | ||
var engineeringFunctions = ['besseli', 'besselj', 'besselk', 'bessely', 'bin2dec', 'bin2hex', 'bin2oct', 'bitand', 'bitlshift', 'bitor', 'bitrshift', 'bitxor', 'complex', 'convert', 'dec2bin', 'dec2hex', 'dec2oct', 'delta', 'erf', 'erfc', 'gestep', 'hex2bin', 'hex2dec', 'hex2oct', 'imabs', 'imaginary', 'imargument', 'imconjugate', 'imcos', 'imcosh', 'imcot', 'imdiv', 'imexp', 'imln', 'imlog19', 'imlog2', 'impower', 'improduct', 'imreal', 'imsec', 'imsech', 'imsin', 'imsinh', 'imsqrt', 'imcsc', 'imcsch', 'imsub', 'imtan', 'oct2bin', 'oct2dec', 'oct2hex']; | ||
var engineeringFunctions = exports.engineeringFunctions = ['besseli', 'besselj', 'besselk', 'bessely', 'bin2dec', 'bin2hex', 'bin2oct', 'bitand', 'bitlshift', 'bitor', 'bitrshift', 'bitxor', 'complex', 'convert', 'dec2bin', 'dec2hex', 'dec2oct', 'delta', 'erf', 'erfc', 'gestep', 'hex2bin', 'hex2dec', 'hex2oct', 'imabs', 'imaginary', 'imargument', 'imconjugate', 'imcos', 'imcosh', 'imcot', 'imdiv', 'imexp', 'imln', 'imlog19', 'imlog2', 'impower', 'improduct', 'imreal', 'imsec', 'imsech', 'imsin', 'imsinh', 'imsqrt', 'imcsc', 'imcsch', 'imsub', 'imtan', 'oct2bin', 'oct2dec', 'oct2hex']; | ||
var allFunctions = (0, _FLATTEN.FLATTEN)([logicalFunctions, informationFunctions, referenceFunctions, dataFunctions, mathFunctions, dateTimeFunctions, financialFunctions, statisticFunctions, textFunctions, engineeringFunctions]).sort(); | ||
var functions = exports.functions = (0, _FLATTEN.FLATTEN)([logicalFunctions, informationFunctions, referenceFunctions, dataFunctions, mathFunctions, dateTimeFunctions, financialFunctions, statisticFunctions, textFunctions, engineeringFunctions]).sort(); | ||
exports.default = { | ||
allFunctions: allFunctions, | ||
logicalFunctions: logicalFunctions, | ||
informationFunctions: informationFunctions, | ||
referenceFunctions: referenceFunctions, | ||
dataFunctions: dataFunctions, | ||
mathFunctions: mathFunctions, | ||
dateTimeFunctions: dateTimeFunctions, | ||
financialFunctions: financialFunctions, | ||
statisticFunctions: statisticFunctions, | ||
textFunctions: textFunctions, | ||
engineeringFunctions: engineeringFunctions, | ||
ABS: _ABS.ABS, | ||
@@ -210,2 +202,3 @@ ACOS: _ACOS.ACOS, | ||
ISTEXT: _ISTEXT.ISTEXT, | ||
ISURL: _ISURL.ISURL, | ||
LOOKUP: _LOOKUP.LOOKUP, | ||
@@ -212,0 +205,0 @@ LOWER: _LOWER.LOWER, |
@@ -1,2 +0,4 @@ | ||
"use strict"; | ||
// Author: Peter Moresi | ||
// based heavily on code from socialcalc | ||
'use strict'; | ||
@@ -8,6 +10,5 @@ Object.defineProperty(exports, "__esModule", { | ||
var _CONSTANTS = require("./CONSTANTS"); | ||
var _CONSTANTS = require('./CONSTANTS'); | ||
var FormatNumber = {}; // Author: Peter Moresi | ||
// based heavily on code from socialcalc | ||
var FormatNumber = {}; | ||
@@ -14,0 +15,0 @@ FormatNumber.format_definitions = {}; // Parsed formats are stored here globally |
{ | ||
"name": "functionfoundry", | ||
"version": "0.6.3", | ||
"version": "0.6.4", | ||
"description": "Functions inspired by the spreadsheets", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -67,3 +67,3 @@ import {ABS} from './ABS' | ||
let logicalFunctions = [ | ||
export let logicalFunctions = [ | ||
'if', | ||
@@ -87,3 +87,3 @@ 'ifna', | ||
let informationFunctions = [ | ||
export let informationFunctions = [ | ||
'isarray', | ||
@@ -112,3 +112,3 @@ 'isblank', | ||
let referenceFunctions = [ | ||
export let referenceFunctions = [ | ||
'indirect', | ||
@@ -126,3 +126,3 @@ 'isref', | ||
let dataFunctions = [ | ||
export let dataFunctions = [ | ||
'sort', | ||
@@ -133,3 +133,3 @@ 'filter', | ||
let mathFunctions = [ | ||
export let mathFunctions = [ | ||
'abs', | ||
@@ -208,3 +208,3 @@ 'acos', | ||
let dateTimeFunctions = [ | ||
export let dateTimeFunctions = [ | ||
'date', | ||
@@ -235,3 +235,3 @@ 'datevalue', | ||
let financialFunctions = [ | ||
export let financialFunctions = [ | ||
'accrintm', | ||
@@ -269,3 +269,3 @@ 'amorlinc', | ||
let statisticFunctions = [ | ||
export let statisticFunctions = [ | ||
'avedev', | ||
@@ -323,3 +323,3 @@ 'average', | ||
let textFunctions = [ | ||
export let textFunctions = [ | ||
'asc', | ||
@@ -357,3 +357,3 @@ 'bahttext', | ||
let engineeringFunctions = [ | ||
export let engineeringFunctions = [ | ||
'besseli', | ||
@@ -412,3 +412,3 @@ 'besselj', | ||
let allFunctions = FLATTEN([ | ||
export let functions = FLATTEN([ | ||
logicalFunctions, | ||
@@ -426,14 +426,4 @@ informationFunctions, | ||
export default { | ||
allFunctions, | ||
logicalFunctions, | ||
informationFunctions, | ||
referenceFunctions, | ||
dataFunctions, | ||
mathFunctions, | ||
dateTimeFunctions, | ||
financialFunctions, | ||
statisticFunctions, | ||
textFunctions, | ||
engineeringFunctions, | ||
ABS, | ||
@@ -440,0 +430,0 @@ ACOS, |
// Author: Peter Moresi | ||
// based heavily on code from socialcalc | ||
'use strict'; | ||
@@ -183,3 +184,3 @@ import { d1900, JulianOffset, MinutesInHour, MinutesInDay, SecondsInMinute, | ||
decimalscale *= 10; | ||
} | ||
} | ||
secs = Math.floor(secs * decimalscale + 0.5); | ||
@@ -186,0 +187,0 @@ secs = secs / decimalscale; |
176014
206
5109