Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add views #113

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions index.js
Expand Up @@ -177,6 +177,15 @@
}
}

export default function dotProp(object) {
return new Proxy(object, {
get: (target, property, receiver) => getProperty(object, property),

Check failure on line 182 in index.js

View workflow job for this annotation

GitHub Actions / Node.js 20

'receiver' is defined but never used. Allowed unused args must match /^_/u.

Check failure on line 182 in index.js

View workflow job for this annotation

GitHub Actions / Node.js 18

'receiver' is defined but never used. Allowed unused args must match /^_/u.

Check failure on line 182 in index.js

View workflow job for this annotation

GitHub Actions / Node.js 16

'receiver' is defined but never used. Allowed unused args must match /^_/u.
set: (target, property, value, receiver) => setProperty(object, property, value),

Check failure on line 183 in index.js

View workflow job for this annotation

GitHub Actions / Node.js 20

'receiver' is defined but never used. Allowed unused args must match /^_/u.

Check failure on line 183 in index.js

View workflow job for this annotation

GitHub Actions / Node.js 18

'receiver' is defined but never used. Allowed unused args must match /^_/u.

Check failure on line 183 in index.js

View workflow job for this annotation

GitHub Actions / Node.js 16

'receiver' is defined but never used. Allowed unused args must match /^_/u.
deleteProperty: (target, property) => deleteProperty(object, property),
has: (target, property) => hasProperty(object, property),
});
}

export function getProperty(object, path, value) {
if (!isObject(object) || typeof path !== 'string') {
return value === undefined ? object : value;
Expand Down