first commit

This commit is contained in:
2026-08-06 12:00:39 +10:00
commit 91221f5a8e
3259 changed files with 569069 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
'use strict';
const index = require('../tokenizer/index.cjs');
const FUNCTION_TYPE = 'function';
/**
* Gets the tokenizer function from the configuration object or returns the default tokenizer
*
* @param config Configuration object
* @returns Corresponding tokenizer function
*/
function getTokenizer(config) {
if (config && typeof config.tokenize === FUNCTION_TYPE) {
return config.tokenize;
}
// Fallback to the default tokenizer
return index.tokenize;
}
exports.getTokenizer = getTokenizer;