mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-05-20 05:14:44 +00:00
.
This commit is contained in:
parent
9fff29ba6c
commit
00c3b50fca
7278 changed files with 0 additions and 1778943 deletions
24
node_modules/detect-newline/index.js
generated
vendored
24
node_modules/detect-newline/index.js
generated
vendored
|
@ -1,24 +0,0 @@
|
|||
'use strict';
|
||||
module.exports = function (str) {
|
||||
if (typeof str !== 'string') {
|
||||
throw new TypeError('Expected a string');
|
||||
}
|
||||
|
||||
var newlines = (str.match(/(?:\r?\n)/g) || []);
|
||||
|
||||
if (newlines.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var crlf = newlines.filter(function (el) {
|
||||
return el === '\r\n';
|
||||
}).length;
|
||||
|
||||
var lf = newlines.length - crlf;
|
||||
|
||||
return crlf > lf ? '\r\n' : '\n';
|
||||
};
|
||||
|
||||
module.exports.graceful = function (str) {
|
||||
return module.exports(str) || '\n';
|
||||
};
|
21
node_modules/detect-newline/license
generated
vendored
21
node_modules/detect-newline/license
generated
vendored
|
@ -1,21 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (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.
|
41
node_modules/detect-newline/package.json
generated
vendored
41
node_modules/detect-newline/package.json
generated
vendored
|
@ -1,41 +0,0 @@
|
|||
{
|
||||
"name": "detect-newline",
|
||||
"version": "2.1.0",
|
||||
"description": "Detect the dominant newline character of a string",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/detect-newline",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"newline",
|
||||
"linebreak",
|
||||
"line-break",
|
||||
"line",
|
||||
"lf",
|
||||
"crlf",
|
||||
"eol",
|
||||
"linefeed",
|
||||
"character",
|
||||
"char"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
}
|
||||
|
||||
,"_resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz"
|
||||
,"_integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I="
|
||||
,"_from": "detect-newline@2.1.0"
|
||||
}
|
42
node_modules/detect-newline/readme.md
generated
vendored
42
node_modules/detect-newline/readme.md
generated
vendored
|
@ -1,42 +0,0 @@
|
|||
# detect-newline [](https://travis-ci.org/sindresorhus/detect-newline)
|
||||
|
||||
> Detect the dominant newline character of a string
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save detect-newline
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const detectNewline = require('detect-newline');
|
||||
|
||||
detectNewline('foo\nbar\nbaz\r\n');
|
||||
//=> '\n'
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### detectNewline(input)
|
||||
|
||||
Returns detected newline or `null` when no newline character is found.
|
||||
|
||||
### detectNewline.graceful(input)
|
||||
|
||||
Returns detected newline or `\n` when no newline character is found.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [detect-newline-cli](https://github.com/sindresorhus/detect-newline-cli) - CLI for this module
|
||||
- [detect-indent](https://github.com/sindresorhus/detect-indent) - Detect the indentation of code
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
Loading…
Add table
Add a link
Reference in a new issue