🚀 Launch Week Day 3:Introducing Supply Chain Attack Campaigns Tracking.Learn More →
Socket
Book a DemoInstallSign in
Socket

@reasonableconsulting/compare

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@reasonableconsulting/compare

ReasonML helpers for generating cmp functions.

latest
Source
npmnpm
Version
0.0.0
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

compare

ReasonML helpers for generating cmp functions.

Usage

module Comparator =
  Belt.Id.MakeComparable({
    type t = string;

    let cmp =
      Compare.concat([
        Compare.by(key => key),
        Compare.by(key => String.length(key)),
      ]);
  });

type t = Belt.Map.t(Comparator.t, int, Comparator.identity);

let ourMap = Belt.Map.fromArray(~id=(module Comparator), [|
  ("a", 1), ("b", 2), ("ab", 3)
|]);

Belt.Map.forEach(ourMap, Js.log2);

License

MPL-2.0

Keywords

BuckleScript

FAQs

Package last updated on 30 Jul 2018

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