open-index/open-npm huggingface dataset:
npm package: @giapspzoo/ol-navigation-history
Description: OpenLayers control for navigating backward and forward through map view history.
Author: GIAP sp. z o.o.
Latest version: 1.0.0

# @giapspzoo/ol-navigation-history
OpenLayers control for navigating backward and forward through map view history.

## Installation
```
npm i @giapspzoo/ol-navigation-history
```

## API
### `class NavigationHistoryControl(options?)`
### Parameters
| Name | Type | Description | Default value | Required |
|-|-|-|-|-|
| `options` | `TNavigationHistoryControlOptions` | Configuration object. | `{}` | No |
| `options.nextButtonOptions` | `TNavigationHistoryControlButtonOptions` | The next button configuration object. | - | No |
| `options.nextButtonOptions.label` | `HTMLElement` | The next button content. | `HTMLSpanElement` with `<` symbol. | No |
| `options.nextButtonOptions.tipLabel` | `string` | The next button label (title). | `"Go forward to the next map view."` | No |
| `options.prevButtonOptions` | `TNavigationHistoryControlButtonOptions` | The prev button configuration object. | - | No |
| `options.prevButtonOptions.label` | `HTMLElement` | The prev button content. | `HTMLSpanElement` with `>` symbol. | No |
| `options.prevButtonOptions.tipLabel` | `string` | The prev button label (title). | `"Go back to the previous map view."` | No |
| `options.render` | `(event: MapEvent) => void` | Function called when the control should be re-rendered. This is called in a requestAnimationFrame callback. | - | No |
| `options.target` | `string` \| `HTMLElement` | Specify a target if you want the control to be rendered outside of the map's viewport. | - | No |

## Examples
### Basic usage
```ts
import Map from 'ol';
import { defaults as defaultControls } from 'ol/control';
import NavigationHistoryControl from '@giapspzoo/ol-history-navigation';

const map = new Map({
  controls: defaultControls().extend([
    new NavigationHistoryControl()
  ])
  // other properties...
});
```

### With parameters
```ts
import Map from 'ol';
import { defaults as defaultControls } from 'ol/control';
import NavigationHistoryControl from '@giapspzoo/ol-history-navigation';

const map = new Map({
  controls: defaultControls().extend([
    new NavigationHistoryControl({
      nextButtonOptions: {
        label: getCustomRightIconHtmlElement(),
        tipLabel: 'Custom label for the next button',
      },
      prevButtonOptions: {
        label: getCustomLeftIconHtmlElement(),
        tipLabel: 'Custom label for the prev button'
      },
      target: document.querySelector('.navigation-history-control-container')
    })
  ])
  // other properties...
});
```
npm package: @giapspzoo/save-file
Description: A TypeScript utility for saving files in the browser.
Author: GIAP sp. z o.o.
Latest version: 1.0.0

# @giapspzoo/save-file

A TypeScript utility for saving files in the browser.

## Installation

```bash
npm install @giapspzoo/save-file
```

## Usage

```typescript
import saveFile from "@giapspzoo/save-file";

// Save a file from URL with custom filename
saveFile({
  fileName: "my-document.pdf",
  url: "https://example.com/document.pdf",
});

// Save a file from URL without custom filename (uses original filename)
saveFile({
  url: "https://example.com/document.pdf",
});

// Save a file from Blob
const blob = new Blob(["Hello, World!"], { type: "text/plain" });
const blobUrl = URL.createObjectURL(blob);

saveFile({
  fileName: "hello.txt",
  url: blobUrl,
});

URL.revokeObjectURL(blobUrl); // Don't forget to revoke the blob URL when done

// Save an image from Base64
const imageBase64 =
  "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==";

saveFile({
  fileName: "image.png",
  url: imageBase64,
});
```

## API

### `saveFile(params: TSaveFileParams): void`

Saves a file to the user's device.

#### Parameters

| Parameter  | Type     | Required | Description                                                                                                |
| ---------- | -------- | -------- | ---------------------------------------------------------------------------------------------------------- |
| `url`      | `string` | Yes      | The URL of the file to save                                                                                |
| `fileName` | `string` | No       | The name of the file to be saved. If not provided, the browser will use the original filename from the URL |

## How it works

This utility creates a temporary anchor element with the `download` attribute, triggers a click event, and then removes the element from the DOM. This approach works with:

- Direct file URLs
- Blob URLs
- Data URLs
- Files served with appropriate CORS headers

## License

MIT
npm package: @giapspzoo/uniq-by
Description: Keeps only the first occurrence of each unique key in an array.
Author: GIAP sp. z o.o.
Latest version: 1.0.0

# @giapspzoo/uniq-by

A simple utility function to return a new array containing only the first occurrence of elements with unique values for the specified key.

## Installation

```
npm i @giapspzoo/uniq-by
```

## Example

```ts
import uniqBy from "@giapspzoo/uniq-by";

const data = [
  { id: 1, value: "a" },
  { id: 2, value: "b" },
  { id: 3, value: "a" },
  { id: 4, value: "c" },
  { id: 5, value: "b" },
];

const result = uniqBy(data, "value");
// [
//   { id: 1, value: "a" },
//   { id: 2, value: "b" },
//   { id: 4, value: "c" }
// ]
```

## License

MIT