Inist-CNRS/ezs

plugin wrongly detected in a statement

parmentf opened this issue · 0 comments

Using the [plugin:statement] syntax, where plugin is basics and statement is JSONParse does not work:

  throw new Error(`'${plugin}' is not loaded. It's not a valid statement function.`);
  ^

Error: 'basics:JSONParse' is not loaded. It's not a valid statement function.
    at Object.get (/home/parmentf/prog/co-aff-align/node_modules/@ezs/core/lib/statement.js:73:9)
    at ezs (/home/parmentf/prog/co-aff-align/node_modules/@ezs/core/lib/index.js:35:89)

Here is the program:

#!/usr/bin/env node

const ezs = require('@ezs/core');
const basics = require('@ezs/basics');
const affAlign = require('../lib');

ezs.use(affAlign);
ezs.use(basics);

process.stdin
    .pipe(ezs('basics:JSONParse'))
    .pipe(ezs('affAlign'))
    .pipe(ezs('JSONString', { indent: true }))
    .pipe(process.stdout);

@ezs/basics is installed, but it should look for @ezs/basics, and not basics:JSONParse as a plugin.
The error was: 'basics:JSONParse' is not loaded. It's not a valid statement function.