https://github.com/koala-framework/sourcemaps
Source Maps Utilities Php Library
https://github.com/koala-framework/sourcemaps
koala-framework kwf php sourcemap sourcemaps
Last synced: 6 months ago
JSON representation
Source Maps Utilities Php Library
- Host: GitHub
- URL: https://github.com/koala-framework/sourcemaps
- Owner: koala-framework
- License: bsd-2-clause
- Created: 2014-10-19T18:48:45.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-02-14T09:25:24.000Z (about 8 years ago)
- Last Synced: 2024-11-07T01:49:53.539Z (6 months ago)
- Topics: koala-framework, kwf, php, sourcemap, sourcemaps
- Language: PHP
- Homepage:
- Size: 68.4 KB
- Stars: 14
- Watchers: 19
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
## Source Maps Utilities Php Library[](https://travis-ci.org/koala-framework/sourcemaps)
### Features
* creating mappings
* reading mappings
* source map aware string replace for existing mapping
* concat maps (optimized for best performance)### Requirements
* Php 5.2+
### Installation
Install using composer:composer require koala-framework/sourcemaps
### Example Usage
//read
$map = new Kwf_SourceMaps_SourceMap($mapContents, $minimiedFileContents);
$map->getMappings()//create new map
$map = Kwf_SourceMaps_SourceMap::createEmptyMap($minimiedFileContents);
$map->addMapping(2, 3, 10, 12, 'foo.js'); //$generatedLine, $generatedColumn, $originalLine, $originalColumn, $originalSource, $originalName = null)
$map->getMapContents();//merge two maps
$map1->concat($map2);//perform string replacement
$map->stringReplace('foo', 'bar');