Skip to content

Commit

Permalink
chore(deps-dev): bump @types/node from 20.14.11 to 22.0.0 (#55)
Browse files Browse the repository at this point in the history
* chore(deps-dev): bump @types/node from 20.14.11 to 22.0.0

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.14.11 to 22.0.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: linting fixes

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kudakwashe Mupeni <terrencemupeni@gmail.com>
  • Loading branch information
dependabot[bot] and 2wce authored Jul 31, 2024
1 parent cfdeac9 commit 5b260e8
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 105 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/auto-merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
github-token: '${{ secrets.GITHUB_TOKEN }}'
- name: Approve a PR
run: gh pr review --approve "$PR_URL"
env:
Expand Down
169 changes: 74 additions & 95 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@changesets/cli": "2.27.7",
"@rollup/plugin-typescript": "11.1.6",
"@types/jest": "^29.5.12",
"@types/node": "20.14.11",
"@types/node": "22.0.0",
"@typescript-eslint/eslint-plugin": "7.18.0",
"@typescript-eslint/parser": "7.17.0",
"eslint": "^8.0.0",
Expand Down
15 changes: 7 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import pluginUtils from '@rollup/pluginutils';
import fs from 'fs';
import { ExistingRawSourceMap, Plugin } from 'rollup';
import { ExistingRawSourceMap, Plugin, PluginContext } from 'rollup';
import { promisify } from 'util';
import { resolveSourceMap, resolveSources } from './source-map-resolve';
import { SourcemapsPluginOptions } from './types';

const { createFilter } = pluginUtils;

export default function sourcemaps({
include,
exclude,
readFile = fs.readFile,
}: SourcemapsPluginOptions = {}): Plugin {
export default function sourcemaps(
// eslint-disable-next-line @typescript-eslint/unbound-method
{ include, exclude, readFile = fs.readFile }: SourcemapsPluginOptions = {},
): Plugin {
// Create a filter function based on the include and exclude options
const filter = createFilter(include, exclude);

Expand All @@ -21,7 +20,7 @@ export default function sourcemaps({
return {
name: 'sourcemaps',

async load(id: string) {
load: async function (this: PluginContext, id: string) {
let code: string;
// If the id does not pass the filter, return null
if (!filter(id)) {
Expand Down Expand Up @@ -66,7 +65,7 @@ export default function sourcemaps({
const { sourcesContent } = await resolveSources(map, id, promisifiedReadFile);
// If all sources are strings, assign them to map.sourcesContent
if (sourcesContent.every(item => typeof item === 'string')) {
map.sourcesContent = sourcesContent as string[];
map.sourcesContent = sourcesContent;
}
} catch {
// If resolving the sources fails, warn
Expand Down

0 comments on commit 5b260e8

Please sign in to comment.