0
0

增加了git功能,但是还未完善

This commit is contained in:
xubing
2025-11-24 17:53:48 +08:00
parent 925024bce1
commit fa1e291bed
682 changed files with 131314 additions and 157 deletions

22
node_modules/clean-git-ref/README.md generated vendored Normal file
View File

@@ -0,0 +1,22 @@
# clean-git-ref
[![Build Status](https://travis-ci.org/TheSavior/clean-git-ref.svg)](https://travis-ci.org/TheSavior/clean-git-ref)
Clean an input string into a usable git ref.
For more reference, read https://git-scm.com/docs/git-check-ref-format
## Installation
```sh
$ npm install clean-git-ref --save-dev
```
## API Usage
### clean(string input) -> string output
```
var cleanGitRef = require('clean-git-ref');
assert.strictEqual(cleanGitRef.clean('bad git ref formats/'), 'bad-git-ref-formats');
```

33
node_modules/clean-git-ref/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,33 @@
'use strict';
function escapeRegExp(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
}
function replaceAll(str, search, replacement) {
search = search instanceof RegExp ? search : new RegExp(escapeRegExp(search), 'g');
return str.replace(search, replacement);
}
var CleanGitRef = {
clean: function clean(value) {
if (typeof value !== 'string') {
throw new Error('Expected a string, received: ' + value);
}
value = replaceAll(value, './', '/');
value = replaceAll(value, '..', '.');
value = replaceAll(value, ' ', '-');
value = replaceAll(value, /^[~^:?*\\\-]/g, '');
value = replaceAll(value, /[~^:?*\\]/g, '-');
value = replaceAll(value, /[~^:?*\\\-]$/g, '');
value = replaceAll(value, '@{', '-');
value = replaceAll(value, /\.$/g, '');
value = replaceAll(value, /\/$/g, '');
value = replaceAll(value, /\.lock$/g, '');
return value;
}
};
module.exports = CleanGitRef;

33
node_modules/clean-git-ref/package.json generated vendored Normal file
View File

@@ -0,0 +1,33 @@
{
"name": "clean-git-ref",
"description": "Clean an input string into a usable git ref",
"version": "2.0.1",
"license": "Apache-2.0",
"author": "Eli White <github@eli-white.com>",
"files": [
"lib"
],
"main": "lib/index.js",
"scripts": {
"build": "babel src -d lib",
"style": "eslint src test && jscs src test",
"pretest": "npm run style",
"test": "mocha",
"posttest": "npm run build"
},
"devDependencies": {
"babel-cli": "^6.6.5",
"babel-eslint": "^6.0.2",
"babel-preset-es2015": "^6.6.0",
"babel-register": "^6.7.2",
"chai": "^3.5.0",
"eslint": "^3.0.0",
"jscs": "^3.0.6",
"mocha": "^3.0.1",
"wealthfront-javascript": "^3.0.1"
},
"repository": {
"type": "git",
"url": "https://github.com/TheSavior/clean-git-ref.git"
}
}