initial commit of actions
This commit is contained in:
commit
949ece5785
44660 changed files with 12034344 additions and 0 deletions
48
github/codeql-action-v2/node_modules/load-json-file/index.d.ts
generated
vendored
Normal file
48
github/codeql-action-v2/node_modules/load-json-file/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
// From https://github.com/sindresorhus/type-fest
|
||||
export type JsonValue = string | number | boolean | null | {[Key in string]?: JsonValue} | JsonValue[];
|
||||
|
||||
export type Reviver = (this: unknown, key: string, value: unknown) => unknown;
|
||||
export type BeforeParse = (data: string) => string;
|
||||
|
||||
export interface Options {
|
||||
/**
|
||||
Applies a function to the JSON string before parsing.
|
||||
*/
|
||||
readonly beforeParse?: BeforeParse;
|
||||
|
||||
/**
|
||||
Prescribes how the value originally produced by parsing is transformed, before being returned.
|
||||
See the [`JSON.parse` docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Using_the_reviver_parameter) for more.
|
||||
*/
|
||||
readonly reviver?: Reviver;
|
||||
}
|
||||
|
||||
/**
|
||||
Read and parse a JSON file.
|
||||
|
||||
It also strips UTF-8 BOM.
|
||||
|
||||
@example
|
||||
```
|
||||
import {loadJsonFile} from 'load-json-file';
|
||||
|
||||
const json = await loadJsonFile('foo.json');
|
||||
//=> {foo: true}
|
||||
```
|
||||
*/
|
||||
export function loadJsonFile<ReturnValueType = JsonValue>(filePath: string, options?: Options): Promise<ReturnValueType>;
|
||||
|
||||
/**
|
||||
Read and parse a JSON file.
|
||||
|
||||
It also strips UTF-8 BOM.
|
||||
|
||||
@example
|
||||
```
|
||||
import {loadJsonFileSync} from 'load-json-file';
|
||||
|
||||
const json = loadJsonFileSync('foo.json');
|
||||
//=> {foo: true}
|
||||
```
|
||||
*/
|
||||
export function loadJsonFileSync<ReturnValueType = JsonValue>(filePath: string, options?: Options): ReturnValueType;
|
||||
24
github/codeql-action-v2/node_modules/load-json-file/index.js
generated
vendored
Normal file
24
github/codeql-action-v2/node_modules/load-json-file/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import {readFileSync, promises as fs} from 'node:fs';
|
||||
|
||||
const {readFile} = fs;
|
||||
|
||||
const parse = (buffer, {beforeParse, reviver} = {}) => {
|
||||
// Unlike `buffer.toString()` and `fs.readFile(path, 'utf8')`, `TextDecoder`` will remove BOM.
|
||||
let data = new TextDecoder().decode(buffer);
|
||||
|
||||
if (typeof beforeParse === 'function') {
|
||||
data = beforeParse(data);
|
||||
}
|
||||
|
||||
return JSON.parse(data, reviver);
|
||||
};
|
||||
|
||||
export async function loadJsonFile(filePath, options) {
|
||||
const buffer = await readFile(filePath);
|
||||
return parse(buffer, options);
|
||||
}
|
||||
|
||||
export function loadJsonFileSync(filePath, options) {
|
||||
const buffer = readFileSync(filePath);
|
||||
return parse(buffer, options);
|
||||
}
|
||||
9
github/codeql-action-v2/node_modules/load-json-file/license
generated
vendored
Normal file
9
github/codeql-action-v2/node_modules/load-json-file/license
generated
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
38
github/codeql-action-v2/node_modules/load-json-file/package.json
generated
vendored
Normal file
38
github/codeql-action-v2/node_modules/load-json-file/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
"name": "load-json-file",
|
||||
"version": "7.0.1",
|
||||
"description": "Read and parse a JSON file",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/load-json-file",
|
||||
"funding": "https://github.com/sponsors/sindresorhus",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "https://sindresorhus.com"
|
||||
},
|
||||
"type": "module",
|
||||
"exports": "./index.js",
|
||||
"engines": {
|
||||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"read",
|
||||
"json",
|
||||
"parse",
|
||||
"file",
|
||||
"fs",
|
||||
"load"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "^3.15.0",
|
||||
"tsd": "^0.17.0",
|
||||
"xo": "^0.44.0"
|
||||
}
|
||||
}
|
||||
56
github/codeql-action-v2/node_modules/load-json-file/readme.md
generated
vendored
Normal file
56
github/codeql-action-v2/node_modules/load-json-file/readme.md
generated
vendored
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
# load-json-file
|
||||
|
||||
> Read and parse a JSON file
|
||||
|
||||
It also [strips UTF-8 BOM](https://github.com/sindresorhus/strip-bom).
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install load-json-file
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
import {loadJsonFile} from 'load-json-file';
|
||||
|
||||
console.log(await loadJsonFile('foo.json'));
|
||||
//=> {foo: true}
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### loadJsonFile(filePath, options?)
|
||||
|
||||
Returns a `Promise<unknown>` with the parsed JSON.
|
||||
|
||||
### loadJsonFileSync(filepath, options?)
|
||||
|
||||
Returns the parsed JSON.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
##### beforeParse
|
||||
|
||||
Type: `Function`
|
||||
|
||||
Applies a function to the JSON string before parsing.
|
||||
|
||||
##### reviver
|
||||
|
||||
Type: `Function`
|
||||
|
||||
Prescribes how the value originally produced by parsing is transformed, before being returned. See the [`JSON.parse` docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Using_the_reviver_parameter) for more.
|
||||
|
||||
## load-json-file for enterprise
|
||||
|
||||
Available as part of the Tidelift Subscription.
|
||||
|
||||
The maintainers of load-json-file and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-load-json-file?utm_source=npm-load-json-file&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
||||
|
||||
## Related
|
||||
|
||||
- [write-json-file](https://github.com/sindresorhus/write-json-file) - Stringify and write JSON to a file atomically
|
||||
Loading…
Add table
Add a link
Reference in a new issue