feat: init
This commit is contained in:
23
node_modules/on-change/source/ignore-property.js
generated
vendored
Normal file
23
node_modules/on-change/source/ignore-property.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
import isSymbol from './is-symbol.js';
|
||||
|
||||
export default function ignoreProperty(cache, options, property) {
|
||||
if (cache.isUnsubscribed) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (options.ignoreSymbols && isSymbol(property)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Only strings can be prefixed with "_"
|
||||
if (options.ignoreUnderscores && typeof property === 'string' && property.charAt(0) === '_') {
|
||||
return true;
|
||||
}
|
||||
|
||||
const keys = options.ignoreKeys;
|
||||
if (keys) {
|
||||
return Array.isArray(keys) ? keys.includes(property) : (keys instanceof Set ? keys.has(property) : false);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
Reference in New Issue
Block a user