Task: Implement a pre-filter that detects JavaScript-like object key identifiers
What to implement
Create a CommonJS module at /app/filters/entropy.meter/pre.filters/object.keys.identifiers.js that exports a single function. The function should take one argument (a string) and return a boolean.
Behavior:
Return false for strings that look like valid JavaScript object keys/identifiers.
Return true for strings that do not look like object keys/identifiers.
If the input is not a string, return true.
Whitespace around the string should be ignored (trim before evaluation).
Do not attempt to detect secrets; the function should only decide whether the string “looks like an object key” and not treat secrets as keys.
Identification rule:
Consider a string to look like an object key if it matches the pattern of a valid JavaScript identifier: starts with a letter, underscore, or dollar sign, followed by letters, digits, underscores, or dollar signs.
Implement this using a regex similar to /^[A-Za-z_$][A-Za-z0-9_$]*$/.
Example:
"name" -> false (looks like a key)
"_id" -> false (looks like a key)
"$value" -> false (looks like a key)
"first-name" -> true (does not look like a key)
"123abc" -> true (does not look like a key)
Code organization:
Place the new file under the app folder as specified.
Ensure it uses CommonJS module.exports to be compatible with the test environment.
Acceptance criteria
The tests provided (pre.filters/object.keys.identifiers.js) pass:
All strings in fixtures.objectKeys return false.
All strings in fixtures.notObjectKeys return true.
All strings in fixtures.randomSecrets return true.
The implementation is self-contained, does not rely on external state, and handles non-string inputs gracefully.