open-index/open-npm huggingface dataset:
npm package: @laserswap/sdk
Description: 🛠 An SDK for building applications on top of Laserswap.
Latest version: 2.4.5

# Pancakeswap SDK

Forked from the [Uniswap SDK](https://github.com/Uniswap/uniswap-v2-sdk/commit/a88048e9c4198a5bdaea00883ca00c8c8e582605).

You can refer to the Uniswap SDK documentation [uniswap.org](https://uniswap.org/docs/v2/SDK/getting-started/).

## Running tests

To run the tests, follow these steps. You must have at least node v10 and [yarn](https://yarnpkg.com/) installed.

First clone the repository:

```sh
git clone https://github.com/pancakeswap/pancake-swap-sdk.git
```

Move into the pancakeswap-sdk working directory

```sh
cd pancakeswap-sdk/
```

Install dependencies

```sh
yarn install
```

Run tests

```sh
yarn test
```

You should see output like the following:

```sh
yarn run v1.22.4
$ tsdx test
 PASS  test/constants.test.ts
 PASS  test/pair.test.ts
 PASS  test/fraction.test.ts
 PASS  test/miscellaneous.test.ts
 PASS  test/entities.test.ts
 PASS  test/trade.test.ts

Test Suites: 1 skipped, 6 passed, 6 of 7 total
Tests:       3 skipped, 82 passed, 85 total
Snapshots:   0 total
Time:        5.091s
Ran all test suites.
✨  Done in 6.61s.
```
npm package: @laserware/arcade
Description: Miscellaneous utility functions.
Author: Mike Rourke
Latest version: 3.21.2

# Arcade

Miscellaneous utility functions. Check out the [documentation site](https://laserware.github.io/arcade/) for available functions.

## Overview

This is a collection of utility functions commonly used in other `@laserware` (and non-`@laserware`) projects.
It's essentially a combination of "Diet Lodash", TypeScript helpers, and helper functions for performing certain tasks based on the execution environment (i.e. Node.js versus the browser).

The package contains a lot of random utilities that are often required in most projects once they hit a certain size.
It goes against the whole _small self-contained package that perform a single operation well_ approach prevalent in the npm universe and opts to include a jubilee of utilities.

How many times have you needed to do the following in a project?

- Turn an array into a keyed object
- Check whether your code is running in Node.js or the browser
- Check which platform your code is running on
- Use colors and extra styles when logging to the terminal
- Check if two objects or arrays contain the same values (i.e. value equality)
- Deeply merge two objects or arrays
- Format a date

This library can do all that and more! All utilities can be safely used in Node.js or the browser.
It's fully tree-shakeable, so any functions you don't use will be excluded from the bundle (if you're using ESM).

Rather than install dependencies and forward the exports, the code from the following libraries was vendored and refactored to match a common coding style:

- [camelcase](https://github.com/sindresorhus/camelcase)
- [dedent](https://github.com/dmnd/dedent)
- [deepmerge](https://github.com/TehShrike/deepmerge)
- [fast-deep-equal](https://github.com/epoberezkin/fast-deep-equal)
- [is-mergeable-object](https://github.com/TehShrike/is-mergeable-object)
- [kebab-case](https://github.com/joakimbeng/kebab-case)
- [lodash/clamp](https://github.com/lodash/lodash/blob/11eb817cdfacf56c02d7005cbe520ffbeb0fe59a/clamp.js)
- [lodash/round](https://github.com/lodash/lodash/blob/11eb817cdfacf56c02d7005cbe520ffbeb0fe59a/round.js)
- [node-dateformat](https://github.com/felixge/node-dateformat)
- [typescript-event-target](https://github.com/DerZade/typescript-event-target)
npm package: @laserware/keytar
Description: Handle keyboard and mouse events in the browser.
Author: Mike Rourke
Latest version: 3.1.3

# Keytar

Handle keyboard and mouse events using bitflags.
Check out the [documentation](https://laserware.github.io/keytar/) for the API.

## Overview

This library uses bitflags to check for mouse and keyboard event conditions.
If you're interested in how I implemented it and the reasoning behind it, check out [this blog post I wrote](https://mikerourke.dev/blog/bitwisdom-keyboard-shortcuts/).

Here's what this looks like in practice:

```ts
import { handleChords, Key, Modifier } from "@laserware/keytar";

function handleKeyDown(event: KeyboardEvent): void {
  const isShiftDown = (event: KeyboardEvent): boolean => {
    return event.shiftKey;
  };
  
  const isCtrlDown = (event: KeyboardEvent): boolean => {
    return event.ctrlKey;
  };
  
  handleChords(event, (handler) => {
    handler
      .on(Key.LetterE, () => {
        // This is fired _only_ when the letter "E" is pressed.
        // If Shift + E is pressed, this condition won't be hit.
      })
      .on(Modifier.Ctrl | Key.LetterK, () => {
        // This is fired _only_ when Ctrl + K is pressed.
      })
      .on([Modifier.Ctrl | Key.LetterP, Modifier.Ctrl | Key.LetterQ], () => {
        // This is fired _only_ when Ctrl + P _or_ Ctrl + Q is pressed.
      })
      // Pass a function reference that returns a boolean
      // (first arg is the Event):
      .when(isShiftDown, () => {
        // This is fired whenever the Shift key is pressed.
      })
      // Call the function directly and return a boolean:
      .when(isCtrlDown(event), () => {
        // This is fired whenever the Ctrl key is pressed.
      })
      // Or just specify a boolean condition:
      .when(event.altKey, () => {
        // This is fired whenever the Alt key is pressed.
      })
  });
}
```

## Glossary

The following terms are used throughout the codebase to describe operations that can be performed with either the keyboard or mouse.

- A `Key` is any non-modifier keyboard key (e.g. the letter `a` or the `Delete` key).
- A `Modifier` is the modifier key that can be used in combination with a `Key` (e.g. `Shift` or `Alt`).
- A `MouseButton` represents the clicked button that corresponds to the [MouseEvent.buttons](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons) property.
- A `Token` can be a `Key`, `Modifier`, or `MouseButton` (i.e. a union type).
- A `Chord` is a `Token` or `number` that represents a combination of `Token` values combined using the [bitwise OR (`|`) operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_OR).
npm package: @laserware/monaco-editor-core
Description: A browser based code editor
Author: Microsoft Corporation
Latest version: 0.0.3

# monaco-editor-core

> This npm module is a building block for the [monaco-editor](https://www.npmjs.com/package/monaco-editor)
npm module and unless you are doing something special (e.g. authoring a monaco editor language that can be shipped
and consumed independently), it is best to consume the [monaco-editor](https://www.npmjs.com/package/monaco-editor) module
that contains this module and adds languages supports.

The Monaco Editor is the code editor that powers [VS Code](https://github.com/microsoft/vscode). Here is a good page describing some [editor features](https://code.visualstudio.com/docs/editor/editingevolved).

This npm module contains the core editor functionality, as it comes from the [vscode repository](https://github.com/microsoft/vscode).

## License

[MIT](https://github.com/microsoft/vscode/blob/main/LICENSE.txt)
npm package: @laserware/sword
Description: Svelte wrapper over Redux.
Author: Mike Rourke
Latest version: 3.2.2

# Sword

Svelte wrapper over Redux.

> [!IMPORTANT]
> Version 3 of this library only works with Svelte v5!

## Usage

Install the dependency. Note that `svelte` is required and `@laserware/stasis` *or* `@reduxjs/toolkit` are required as peer dependencies:

```bash
npm install @laserware/sword @laserware/stasis svelte
```

Or

```bash
npm install @laserware/sword @reduxjs/toolkit svelte
```

Wrap your Svelte entry point component with `<Provider>`:

**Entry File (`src/main.ts`)**

```ts
import { Provider } from "@laserware/sword";
import { mount } from "svelte";

import App from "./App.svelte";

const app = mount(App, { target: document.body });

export default app();
```

**Svelte Component (`src/App.svelte`)**

```html
<script lang="ts">
  import { Provider } from "@laserware/sword";

  import { createStore } from "./my-redux-store";

  import MyComponent from "./MyComponent.svelte"

  const store = createStore();
</script>

<Provider {store}>
  <MyComponent />
</Provider>
```

If you don't want to create another component file just to add Redux context, you can use the `provide` function:

**Entry File (`src/main.ts`)**

```ts
import { provide } from "@laserware/sword";
import { mount } from "svelte";

import { createStore } from "./my-redux-store";

import App from "./App.svelte";

const store = createStore();

const app = mount(App, { 
  target: document.body,
  context: provide(store),
});

export default app();
```

Import the `useDispatch` or `useSelect` functions in components that need to dispatch Redux actions or access Redux state:

```html
<!-- MyComponent.svelte -->
<script lang="ts">
  import { useDispatch, useSelector } from "@laserware/sword";

  import { someAction } from "./my-redux-actions";
  import { selectSomeValue } from "./my-redux-selectors";

  const dispatch = useDispatch();

  const someValue = useSelector(selectSomeValue);

  function handleClick(): void {
    dispatch(someAction(someValue.value));
  }
</script>

<button onclick={handleClick}>Click me</button>
```