From 751cc54f977deb52081ea28ed3e52808fdf82fec Mon Sep 17 00:00:00 2001 From: zhl Date: Fri, 28 May 2021 11:30:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E7=BB=84=E6=89=A9?= =?UTF-8?q?=E5=B1=95=E6=96=B9=E6=B3=95=E4=B8=AD=E7=9A=84remove=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E5=90=8D,=20=E9=81=BF=E5=85=8D=E5=92=8Cmongoose?= =?UTF-8?q?=E4=B8=AD=E7=9B=B8=E5=90=8C=E6=96=B9=E6=B3=95=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/Extend.ts | 4 ++-- typings/extend.d.ts | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/Extend.ts b/src/common/Extend.ts index 20f6ab5..a8bbef5 100644 --- a/src/common/Extend.ts +++ b/src/common/Extend.ts @@ -522,7 +522,7 @@ interface Array { * @returns {boolean} true 有这个数据并且删除成功 * false 没有这个数据 */ - remove?(t: T): boolean + zremove?(t: T): boolean /** * 排序 支持多重排序 @@ -671,7 +671,7 @@ Object.defineProperties(Array.prototype, { }, writable: true, }, - remove: { + zremove: { value: function (this: T[], t: T) { let idx = this.indexOf(t) if (~idx) { diff --git a/typings/extend.d.ts b/typings/extend.d.ts index a6803c1..f417a2e 100644 --- a/typings/extend.d.ts +++ b/typings/extend.d.ts @@ -1,3 +1,5 @@ +import fastify from 'fastify' + declare module 'fastify' { interface FastifyRequest { roles?: string[]