# @types/sourcemap-validator

> TypeScript definitions for sourcemap-validator

Latest version **2.1.2** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/sourcemap-validator
pnpm add @types/sourcemap-validator
yarn add @types/sourcemap-validator
bun add @types/sourcemap-validator
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.1.2 |
| Published | 2023-11-07 |
| First published | 2023-01-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51443 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/sourcemap-validator
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sourcemap-validator
- npm.io page: https://npm.io/package/@types/sourcemap-validator

## Recent versions

- 2.1.2 (latest) — 2023-11-07
- 2.1.0 (ts4.2) — 2023-01-12
- 2.1.1 — 2023-10-18

## README

# Installation
> `npm install --save @types/sourcemap-validator`

# Summary
This package contains type definitions for sourcemap-validator (https://github.com/ben-ng/sourcemap-validator#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sourcemap-validator.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sourcemap-validator/index.d.ts)
````ts
export = validate;

/**
 * Validate source maps.
 *
 * @param minifiedCode Your minified code.
 * @param sourceMap Your sourcemap as a JSON string. If left empty, the inline sourcemap in `minifiedCode` will be used.
 * @param sourceContent A map to the raw source files. If left empty, the inline `sourceContent` in `sourceMap` will be used.
 *
 * @example
 * import validate = require('sourcemap-validator');
 * import * as fs from 'fs';
 * import * as assert from 'assert';
 *
 * const min = fs.readFileSync('jquery.min.js', 'utf-8');
 * const map = fs.readFileSync('jquery.min.map', 'utf-8');
 * const raw = fs.readFileSync('jquery.js', 'utf-8');
 *
 * assert.doesNotThrow(() => {
 *   validate(min, map, {'jquery.js': raw});
 * }, 'The sourcemap is not valid');
 *
 * const browserifyBundleMin = fs.readFileSync('bundle.min.js', 'utf-8');
 * const browserifyBundleMap = fs.readFileSync('bundle.min.map', 'utf-8');
 *
 * // Browserify bundles have inline sourceContent in their maps
 * // so no need to pass a `sourceContent` object.
 * assert.doesNotThrow(() => {
 *   validate(browserifyBundleMin, browserifyBundleMap);
 * }, 'The sourcemap is not valid');
 */
declare function validate(minifiedCode: string, sourceMap?: string, sourceContent?: Record<string, string>): void;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
 * Dependencies: none

# Credits
These definitions were written by [BendingBender](https://github.com/BendingBender).

---
_Source: https://npm.io/package/@types/sourcemap-validator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
