Fix dependabot issues
This commit is contained in:
parent
c89d9bd8b0
commit
531c6ba7c8
705 changed files with 53406 additions and 20466 deletions
44
node_modules/code-excerpt/index.d.ts
generated
vendored
Normal file
44
node_modules/code-excerpt/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
declare namespace codeExcerpt {
|
||||
interface Options {
|
||||
/**
|
||||
* Number of surrounding lines to extract.
|
||||
*
|
||||
* @default 3
|
||||
*/
|
||||
readonly around?: number;
|
||||
}
|
||||
|
||||
interface ExcerptLine {
|
||||
/**
|
||||
* Line number
|
||||
*/
|
||||
readonly line: number;
|
||||
|
||||
/**
|
||||
* Line itself
|
||||
*/
|
||||
readonly value: string;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract code excerpts
|
||||
*/
|
||||
declare function codeExcerpt(
|
||||
/**
|
||||
* Source code
|
||||
*/
|
||||
source: string,
|
||||
|
||||
/**
|
||||
* Line number to extract excerpt for.
|
||||
*/
|
||||
line: number,
|
||||
|
||||
/**
|
||||
* Options
|
||||
*/
|
||||
options?: codeExcerpt.Options
|
||||
): codeExcerpt.ExcerptLine[] | undefined;
|
||||
|
||||
export = codeExcerpt;
|
||||
8
node_modules/code-excerpt/index.js
generated
vendored
8
node_modules/code-excerpt/index.js
generated
vendored
|
|
@ -1,5 +1,4 @@
|
|||
'use strict';
|
||||
|
||||
const tabsToSpaces = require('convert-to-spaces');
|
||||
|
||||
const generateLineNumbers = (line, around) => {
|
||||
|
|
@ -27,10 +26,13 @@ module.exports = (source, line, options) => {
|
|||
source = tabsToSpaces(source).split(/\r?\n/);
|
||||
|
||||
if (line > source.length) {
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
|
||||
options = Object.assign({around: 3}, options);
|
||||
options = {
|
||||
around: 3,
|
||||
...options
|
||||
};
|
||||
|
||||
return generateLineNumbers(line, options.around)
|
||||
.filter(line => source[line - 1] !== undefined)
|
||||
|
|
|
|||
2
node_modules/code-excerpt/license
generated
vendored
2
node_modules/code-excerpt/license
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) vdemedes <vdemedes@gmail.com> (github.com/vdemedes)
|
||||
Copyright (c) Vadim Demedes <vdemedes@gmail.com> (github.com/vadimdemedes)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
|
|||
17
node_modules/code-excerpt/package.json
generated
vendored
17
node_modules/code-excerpt/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "code-excerpt",
|
||||
"version": "2.1.1",
|
||||
"version": "3.0.0",
|
||||
"description": "Extract code excerpts",
|
||||
"license": "MIT",
|
||||
"repository": "vadimdemedes/code-excerpt",
|
||||
|
|
@ -10,22 +10,21 @@
|
|||
"url": "github.com/vadimdemedes"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
"node": ">=10"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
"test": "tsd && xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"dependencies": {
|
||||
"convert-to-spaces": "^1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^0.16.0",
|
||||
"xo": "^0.17.1"
|
||||
},
|
||||
"xo": {
|
||||
"esnext": true
|
||||
"ava": "^3.9.0",
|
||||
"tsd": "^0.11.0",
|
||||
"xo": "^0.32.0"
|
||||
}
|
||||
}
|
||||
10
node_modules/code-excerpt/readme.md
generated
vendored
10
node_modules/code-excerpt/readme.md
generated
vendored
|
|
@ -1,15 +1,13 @@
|
|||
# code-excerpt [](https://travis-ci.org/vadimdemedes/code-excerpt)
|
||||
# code-excerpt 
|
||||
|
||||
> Extract code excerpts
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save code-excerpt
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
|
|
@ -41,7 +39,6 @@ const excerpt = codeExcerpt(source, 5);
|
|||
// ]
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### codeExcerpt(source, line, [options])
|
||||
|
|
@ -66,8 +63,3 @@ Type: `number`<br>
|
|||
Default: `3`
|
||||
|
||||
Number of surrounding lines to extract.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Vadim Demedes](https://github.com/vadimdemedes)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue