Skip to content

Bug report: "Find / Replace" Operation not importable from Web -> Node #956

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
DBHeise opened this issue Feb 7, 2020 · 0 comments · May be fixed by #1040
Open

Bug report: "Find / Replace" Operation not importable from Web -> Node #956

DBHeise opened this issue Feb 7, 2020 · 0 comments · May be fixed by #1040

Comments

@DBHeise
Copy link

DBHeise commented Feb 7, 2020

Describe the bug
When a recipe is loaded in node using the "Find / Replace" operation, it is not found!

To Reproduce

  1. In the Web UI generate a recipe using the "Find / Replace" operation
  2. Save the recipe (as JSON, clean or compact does not matter)
  3. in Node load the saved recipe
const recipe = [
    {"op": "Find / Replace","args": [{"option": "Simple string","string": "test"},"good",true,false,true,false]}
];

chef.bake("I'll have the test salmon.", recipe);

Expected behaviour
output: "I'll have the good salmon"

Additional context
The problem appears to be in the difference of how the generateNodeIndex.mjs creates the list of operations and how the apiUtils.mjs::sanatise function cleans the operation names. Obviously the decapatialize function used in generateNodeIndex.mjs outputs a name that is not a valid variable name in node ("find/Replace"), but it appears that gets fixed somewhere (perhaps manually?? idk)

One possible simple solution is to change the sanatise function to also include the "/" character as follows:

export function sanitise(str) {    
    return str.replace(/[\/ ]/g, "").toLowerCase();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants