
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
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
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
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.