Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/node-test.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
node-version:
- 0.10.x
- 0.12.x
- 4.x
- 6.x
- 8.x
# - 10.x
# - 12.x
# - 14.x
# - 16.x
# - 18.x
# - 20.x

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
# TODO: Enable cache when checking in package lockfile to git
# cache: 'npm'
- run: npm install
- run: npm run test
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# inline-source-map [![build status](https://secure.travis-ci.org/thlorenz/inline-source-map.png)](http://travis-ci.org/thlorenz/inline-source-map)
# inline-source-map [![build status](https://github.com/thlorenz/inline-source-map/actions/workflows/node-test.js.yml/badge.svg)](https://github.com/thlorenz/inline-source-map/actions/workflows/node-test.js.yml/badge.svg)

Adds source mappings and base64 encodes them, so they can be inlined in your generated file.

```js
var generator = require('inline-source-map');

// default charset 'utf-8' is configurable
var gen = generator({ charset: 'utf-8' })
var gen = generator({ charset: 'utf-8' })
.addMappings('foo.js', [{ original: { line: 2, column: 3 } , generated: { line: 5, column: 10 } }], { line: 5 })
.addGeneratedMappings('bar.js', 'var a = 2;\nconsole.log(a)', { line: 23, column: 22 });

Expand All @@ -25,7 +25,7 @@ inline mapping url: //# sourceMappingURL=data:application/json;charset=utf-8;bas

```
/**
* Adds the given mappings to the generator and offsets them if offset is given
* Adds the given mappings to the generator and offsets them if offset is given
*
* @name addMappings
* @function
Expand Down Expand Up @@ -56,7 +56,7 @@ inline mapping url: //# sourceMappingURL=data:application/json;charset=utf-8;bas
```
/**
* Adds source content for the given source file.
*
*
* @name addSourceContent
* @function
* @param sourceFile {String} The source file for which a mapping is included
Expand Down Expand Up @@ -84,6 +84,6 @@ If source contents were added, this will be included in the encoded mappings.
/**
* @name inlineMappingUrl
* @function
* @return {String} comment with base64 encoded representation of the added mappings. Can be inlined at the end of the generated file.
* @return {String} comment with base64 encoded representation of the added mappings. Can be inlined at the end of the generated file.
*/
```
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"test-0.8": "nave use 0.8 npm run test-main",
"test-0.10": "nave use 0.10 npm run test-main",
"test-0.12": "nave use 0.12 npm run test-main",
"test-all": "npm run test-main && npm run test-0.8 && npm run test-0.10 && npm run test-0.12",
"test": "if [ -e $TRAVIS ]; then npm run test-all; else npm run test-main; fi"
"test": "npm run test-main"
},
"repository": {
"type": "git",
Expand Down