diff --git a/src/function/predefined.js b/src/function/predefined.js index f868ba4..1c38c26 100644 --- a/src/function/predefined.js +++ b/src/function/predefined.js @@ -3,7 +3,7 @@ const h2p = require('html2plaintext'); const namespace = 'http://sti2.at#'; -const toUpperCase = (data) => data[0].toString().toUpperCase(); +const toUpperCase = ([str]) => str.toString().toUpperCase(); const utmToLat = (data) => { const x = data[0]; diff --git a/tests/test.js b/tests/test.js index 4e8589c..43e34ad 100644 --- a/tests/test.js +++ b/tests/test.js @@ -324,7 +324,7 @@ it('Predefined option parameter function mapping', async () => { const options = { functions: { 'http://users.ugent.be/~bjdmeest/function/grel.ttl#toLowerCase': function (data) { - return data[0].toString().toLowerCase(); + return data.toString().toLowerCase(); }, }, }; @@ -846,8 +846,8 @@ it('subjFuncMap 2', async () => { let i = 0; const options = { functions: { - 'http://myfunc.com/getId': function (data) { - return `http://example.com/${i++}/${data[0]}`; + 'http://myfunc.com/getId': function ([str]) { + return `http://example.com/${i++}/${str}`; }, }, };