-
Notifications
You must be signed in to change notification settings - Fork 1
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
revert: remove getByDocId
optional parameter
#968
Conversation
This reverts commit 56f7e18 and replaces it with an internal-only function, `getByDocIdIfExists`.
34a250a
to
1a0af6d
Compare
src/datatype/index.d.ts
Outdated
getByDocId( | ||
docId: string, | ||
opts?: { mustBeFound?: true; lang?: string } | ||
opts?: { lang?: string } | ||
): Promise<TDoc & { forks: string[] }> | ||
getByDocId( | ||
docId: string, | ||
opts?: { mustBeFound?: boolean; lang?: string } | ||
): Promise<null | (TDoc & { forks: string[] })> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is part of the revert.
src/datatype/index.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All changes to this file are just reversions.
src/roles.js
Outdated
mustBeFound: false, | ||
}) | ||
if (!roleAssignment) { | ||
const roleRecord = await getByDocIdIfExists(this.#dataType, deviceId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not strictly related, but I renamed this to make the diff for #188 a little smaller.
test/data-type/index.js
Outdated
* @param {object} [opts={}] | ||
* @param {Buffer} [opts.projectKey] | ||
*/ | ||
async function testenv(opts = {}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was moved into a helper (see below).
This reverts commit 56f7e18 and replaces it with an internal-only function,
nullIfNotFound
.