Fangdun Tsai
Fangdun Tsai
* **#8192** * **#8169** 👈 * `canary` This stack of pull requests is managed by Graphite. Learn more about stacking. Join @fundon and the rest of your teammates on Graphite
* **#8192** 👈 * **#8169** * `canary` This stack of pull requests is managed by Graphite. Learn more about stacking. Join @fundon and the rest of your teammates on Graphite
Current, I use a dirty way: ```js User.virtual('password').set(function(v) { this.encryptedPassword = v }) User.pre('validate', function preValidate(next) { return this.encryptPassword().then(next) }) User.method('encryptPassword', async function encryptPassword() { this.passwordSalt = await encryptor.salt() this.encryptedPassword...
Below code is very bad idea! Why set password includes `save` operation? ```js User.methods.setPassword = async function (password) { const hashedPassword = await hashPassword(password); this.password = hashedPassword; await this.save(); return...
@heisian Plz see https://github.com/Automattic/mongoose/blob/master/lib/virtualtype.js. Currently, In Mongoose IMPL, `getter` or `setter` just register a function then calling, it's not https://tc39.github.io/ecma262/#sec-assignment-operators-runtime-semantics-evaluation and https://github.com/tc39/ecmascript-asyncawait/issues/82. That's different. So plz open this request.
Your example is not a good way for me. I want ```js await new User({ password }).save() ``` Hash the password in the mode that more simple, more elegant.
I don't agree with @heisian. Mongoose has too many old things. Mongoose needs refactor! Mongoose needs modern. If this issue is closed. I will fork Mongoose, refactor it! Bye!
* **#8230** : 2 dependent PRs ([#8253](https://github.com/toeverything/AFFiNE/pull/8253) , [#8269](https://github.com/toeverything/AFFiNE/pull/8269) ) 👈 * **#8227** * `canary` This stack of pull requests is managed by Graphite. Learn more about stacking. Join @fundon...
> can you please also add a new e2e test? 👌
It may be caused by this: https://github.com/toeverything/blocksuite/blob/3b62f7a91e89e364342764c7f9d941ccda8ac331/packages/blocks/src/_common/components/button.ts#L103-L104 But it is not reasonable to set svg itself to 32x32.