
Security News
Risky Biz Podcast: AI Agents Are Raising the Stakes for Software Supply Chain Security
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.
npm i map2d
// 基本类型
// IPosition 2d坐标 {x:number,y:number}
// Direction 方向枚举,上右下左
// SlashDirection 斜向方向枚举,东北 东南 西南 西北
// 1 以posiSoure为原点,获取dire方向(直线)的dist个格子的坐标数组
lineRange(posiSource: IPosition, dist: number, dire: number): IPosition[];
// 2 以posiSoure为原点,获取dire方向(斜线)的dist个格子的坐标数组
slashRange(posiSource: IPosition, dist: number, dire: number): IPosition[];
// 3 周围直线4格(不包括自己)
nearRange(posiSource: IPosition, dist: Direction): IPosition[];
// 4 周围斜线4格(不包括自己)
nearSlashRange(posiSource: IPosition, dist: Direction): IPosition[];
// 5 周围一圈(不包括自己)
circleRange(posiSource: IPosition, radius: number): IPosition[];
// 6 曼哈顿距离(不包括自己)
manhattanRange(posiSource: IPosition, radius: number): IPosition[];
// 7 获取两点之间坐标
getBetween(pa: IPosition, pb: IPosition): IPosition[];
// 8 坐标去重
unique(posiList: IPosition[]): IPosition[];
// 9 差集运算
sub(posiListSource: IPosition[], posiListTarget: IPosition[]): IPosition[];
// 10 获取sourcePosi相对于targetPosi的直线方向
getDirection(sourcePosi: IPosition, targetPosi: IPosition): Direction;
// 11 获取sourcePosi相对于targetPosi的斜线方向
getSlashDirection(sourcePosi: IPosition, targetPosi: IPosition): SlashDirection;
编译ts代码
测试
FAQs
map2d
The npm package map2d receives a total of 14 weekly downloads. As such, map2d popularity was classified as not popular.
We found that map2d demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.

Research
/Security News
Malicious Chrome and Firefox extensions posed as free VPNs while stealing clipboard data through later extension updates.

Research
/Security News
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.