Socket
Socket
Sign inDemoInstall

@types/convert-source-map

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/convert-source-map

TypeScript definitions for convert-source-map


Version published
Weekly downloads
123K
increased by3.05%
Maintainers
1
Weekly downloads
 
Created

What is @types/convert-source-map?

@types/convert-source-map provides TypeScript type definitions for the convert-source-map package, which is used to convert between different formats of source maps, such as from inline to external and vice versa.

What are @types/convert-source-map's main functionalities?

Converting Inline Source Map to Object

This feature allows you to convert an inline source map (embedded in a comment) to a source map object.

const convert = require('convert-source-map');
const inlineSourceMap = '//# sourceMappingURL=data:application/json;base64,...';
const sm = convert.fromComment(inlineSourceMap);
console.log(sm.toObject());

Converting Source Map Object to JSON

This feature allows you to convert a source map object to a JSON string.

const convert = require('convert-source-map');
const sm = convert.fromObject({ version: 3, file: 'out.js', sources: ['foo.js'], names: [], mappings: 'AAAA' });
console.log(sm.toJSON());

Adding Source Map Comment to File

This feature allows you to add a source map comment to a file's content.

const convert = require('convert-source-map');
const sm = convert.fromObject({ version: 3, file: 'out.js', sources: ['foo.js'], names: [], mappings: 'AAAA' });
const fileContent = 'console.log("Hello World");';
const fileWithSourceMap = fileContent + '\n' + sm.toComment();
console.log(fileWithSourceMap);

Other packages similar to @types/convert-source-map

FAQs

Package last updated on 07 Nov 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc