"use strict";

// Third Party
const curry = require("lodash/fp/curry");
const find = require("lodash/fp/find");
const flow = require("lodash/fp/flow");
const get = require("lodash/fp/get");
const startsWith = require("lodash/fp/startsWith");

module.exports = curry((fields, name) => startsWith("customField_", name) ?
  flow(find({ id: name }), get("name"))(fields) :
  name
);

"use strict";

// Third Party
const curry = require("lodash/fp/curry");
const find = require("lodash/fp/find");
const flow = require("lodash/fp/flow");
const get = require("lodash/fp/get");
const startsWith = require("lodash/fp/startsWith");
const toLower = require("lodash/fp/toLower");

module.exports = curry((fields, name) => startsWith("customfield_", toLower(name)) ?
  flow(find({ id: name }), get("name"))(fields) :
  name
);

Fix issue where customfield prefix could contain variable letters
Issue-5: Fix issue where customfield prefix could contain variable letters

Closes #5
bug
SemVer:Patch
