New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@safs.io/match

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@safs.io/match

Gale/Shapely deferred acceptance algorithm

latest
Source
npmnpm
Version
1.0.5
Version published
Maintainers
1
Created
Source

match

usage

import { match, LeftEl, RightEl } from "@safs.io/match";
import { match } from "@safs.io/match/match";
import { LeftEl } from "@safs.io/match/left-element";
import { RightEl } from "@safs.io/match/right-element";

publish pnpm publish --tag next --access=public

API

constraints:

  • Left elements
  • MUST HAVE a unique id. (e.g. `new Left({ idKey: 'uuid'}))
  • Right elements
  • MUST HAVE a unique id. (e.g. `new Right({ idKey: 'uuid'}))
  • MUST HAVE a capacity set.
                                after rank hook can be used to build up stats(reason for exclusion, reason for rank, etc...).      
  LEFT                            |
  Object -> Rankable(Object)      |         Rankable(Object) with rankedCounterparts -> Matchable(Object)      
                            \     |       /                                                              \     
                              -> Rank ->                                                                  -> Match -> Matches
                            /             \                                                              /     |   
  Object -> Rankable(Object)                Rankable(Object) with rankedCounterparts -> Matchable(Object)      |
  RIGHT                                                                                                        |  
                                                                                                         after match hook used to build up stats (score, ???)

POST /match REQUEST

  {
    "left": [
      { "id": 1, "attrs": { "color": "blue", "fruit": "banana" } },
      { "id": 2, "attrs": { "color": "red", "fruit": "peach" } },
    ],

    "right": [
      { "id": "a23db", "capacity": 1, "attrs": { "color": "blue", "fruit": "peach" } }
    ]
  }

STATUS 201 RESPONSE

  {
    "meta": {
      "maxPossibleScore": 30,
      "totalMatches": 1,
      "totalUnmatched": {
        "left": 1,
        "right": 0
      }
    },
    "matched": [
      { "left": 1, "right": "a23db", "score": 20 },
    ],
    "unmatched": {
      "left": [{"id": 2}],
      "right": []
    }
  }

Keywords

match

FAQs

Package last updated on 08 Apr 2021

Did you know?

Socket

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.

Install

Related posts