FCF 2.0 development in progress...
> > > >
[News] [Packages API] [Downloads] [Donate to the project] [Contacts]

Configuration parameter tokenize

Configuration parameter: tokenize

Package: fcf-framework-core

Available from version: 2.0.2

Type: object

An object describing the list of available objects and functions in the server-side tokenizer used in the fcf.tokenize, fcf.pattern and fcf.inlineExecution functions.

You can read more details on the tokenization description page: Tokenization

An object can have the following fields:

  • object objects - An object of global objects whose data is available in the tokenizer on the server side. The key is the path to the variable accessible from the tokenizer, and the value is the path to the global variable whose data will be used.

    Example:

    fcf.getConfiguration().append({ tokenize: { objects: { "Date": "Date", } } });
  • [object] functions - An array with objects describing the functions that are allowed to be called in the server-side tokenizer

    An array element can have the following fields:

    • string object - The object on which the function call is allowed. The empty string corresponds to the global object. The string "*" matches any object

    • string class -If the property is set, then the function call is allowed only for objects with the class specified in the property or inherited from it

    • [string] allow - An array with the names of functions that are allowed to be called. If the nested string is equal to "*", then it is allowed to call any function that satisfies the conditions object and class

    An example of calling the getDate method on all Date objects:

    fcf.getConfiguration().append({ tokenize: { functions: { "object": "*", "class": "Date", "allow": ["getDate"], }, } });

    An example of adding call permission for the isArray method from an Array object

    fcf.getConfiguration().append({ tokenize: { functions: { object: "Array", allow: ["isArray"], }, } });

    An example of adding permission to call the global function parseFloat

    fcf.getConfiguration().append({ tokenize: { functions: { object: "", allow: ["parseFloat"], }, } });

    Example of adding permission to call all methods of the RegExp object

    fcf.getConfiguration().append({ tokenize: { functions: { object: "RegExp", allow: ["*"], }, } });