activityspam-filter
Advanced tools
Comparing version 0.1.0 to 0.1.1
export class Tokenizer { | ||
constructor(options?: TokenizerOptions | undefined); | ||
tokenize(obj: object | unknown[], previous?: string | undefined): string[]; | ||
tokenize(obj: unknown, previous?: string | undefined): string[]; | ||
#private; | ||
@@ -5,0 +5,0 @@ } |
@@ -39,6 +39,6 @@ // Tokenizer for activity spam filter | ||
constructor (options = {}) { | ||
this.#useBare = options.useBare || true; | ||
this.#useDigrams = options.useDigrams || true; | ||
this.#usePrefixes = options.usePrefixes || true; | ||
this.#useArrayLength = options.useArrayLength || true; | ||
this.#useBare = options.useBare ?? true; | ||
this.#useDigrams = options.useDigrams ?? true; | ||
this.#usePrefixes = options.usePrefixes ?? true; | ||
this.#useArrayLength = options.useArrayLength ?? true; | ||
} | ||
@@ -77,3 +77,3 @@ | ||
/** | ||
* @param {object | unknown[]} obj | ||
* @param {unknown} obj | ||
* @param {string} [previous] | ||
@@ -91,2 +91,6 @@ * @returns {string[]} | ||
if (typeof obj !== 'object' || obj === null) { | ||
return tokens; | ||
} | ||
for (const prop in obj) { | ||
@@ -135,3 +139,4 @@ /** @type {unknown} */ | ||
} else { | ||
// XXX: loggit | ||
// eslint-disable-next-line no-console | ||
console.warn('Unexpected data type in the tokenizer'); | ||
} | ||
@@ -138,0 +143,0 @@ } |
{ | ||
"name": "activityspam-filter", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Extraction and modernization of the filters in activityspam", | ||
@@ -5,0 +5,0 @@ "homepage": "http://github.com/voxpelli/activityspam-filter", |
Sorry, the diff of this file is not supported yet
46295
851