Explore Enterprise Education Gitee Premium Gitee AI AI teammates
Fetch the repository succeeded.
Open Source > Database Related > DB Development Package &&
Donate
Please sign in before you donate.
Scan WeChat QR to Pay
Cancel
Complete
Prompt
Switch to Alipay.
OK
Cancel
86 Star 362 Fork 122

wxd_tony1984/DevelopAssistant

Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
Already have an account? Sign in
文件
master
Branches (1)
Tags (3)
master
V5.0.2
V4.8.32
V4.3.31
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
The license selected for the repository is subject to the license used by the main branch of the repository.
master
Branches (1)
Tags (3)
master
V5.0.2
V4.8.32
V4.3.31
Clone or Download
Clone/Download
Prompt
To download the code, please copy the following command and execute it in the terminal
To ensure that your submitted code identity is correctly recognized by Gitee, please execute the following command.
When using the SSH protocol for the first time to clone or push code, follow the prompts below to complete the SSH configuration.
1 Generate RSA keys.
2 Obtain the content of the RSA public key and configure it in SSH Public Keys
To use SVN on Gitee, please visit the usage guide
When using the HTTPS protocol, the command line will prompt for account and password verification as follows. For security reasons, Gitee recommends configure and use personal access tokens instead of login passwords for cloning, pushing, and other operations.
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # Private Token
master
Branches (1)
Tags (3)
master
V5.0.2
V4.8.32
V4.3.31
JavaScriptFormat.cs 11.57 KB
Copy Edit Raw Blame History
wxd_tony1984 authored 2017年12月01日 11:28 +08:00 . 一些修改
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace DevelopAssistant.Format
{
/// <summary>
/// 功能描述:js 格式化
/// 版本号:v 1.0.0
/// 创建作者:王晓东
/// 更新时间:2016年02月17日
/// </summary>
public class JavaScriptFormatHelper
{
//public static string FormatToJavaScript(string strjs)
//{
// string result = string.Empty;
// try
// {
// if (string.IsNullOrEmpty(strjs))
// return strjs;
// int temp_index = 0; //临时记数
// int space_index = 0; //空格计数
// int break_index = 0; //换行计数
// strjs = strjs.Replace('\r', ' ');
// char[] chr_array = strjs.ToCharArray();
// List<char> chr_list = new List<char>();
// #region 处理换行,去除空格
// for (int i = 0, len = chr_array.Length; i < len; i++)
// {
// char chr = chr_array[i];
// if (chr == '\n')
// {
// break_index++;
// if (break_index == 1)
// {
// chr_list.Add(chr);
// }
// }
// if (chr != '\n')
// {
// break_index = 0;
// if (chr == ' ')
// {
// space_index++;
// if (space_index == 1)
// {
// chr_list.Add(chr);
// }
// }
// if (chr != ' ')
// {
// space_index = 0;
// if (chr == '{')
// {
// chr_list.Add(chr);
// chr_list.Add('\n');
// }
// if (chr == '}')
// {
// int j = i;
// char prechr = ' ';
// while (j > 0)
// {
// j = j - 1;
// char ch = chr_array[j];
// if (ch != ' ')
// {
// j = 0;
// prechr = ch;
// break;
// }
// }
// if (prechr != ';')
// {
// chr_list.Add('\n');
// }
// chr_list.Add(chr);
// if (i + 1 < len && chr_array[i + 1] != ';' && chr_array[i + 1] != ')'
// && chr_array[i + 1] != ',')
// {
// chr_list.Add('\n');
// }
// }
// if (chr == ',')
// {
// int j = i;
// char prechr = ' ';
// while (j > 0)
// {
// j = j - 1;
// char ch = chr_array[j];
// if (ch != ' ')
// {
// j = 0;
// prechr = ch;
// break;
// }
// }
// chr_list.Add(chr);
// if (prechr == '}')
// {
// chr_list.Add('\n');
// }
// }
// if (chr == ';')
// {
// chr_list.Add(chr);
// chr_list.Add('\n');
// }
// if (chr == '*')
// {
// if (i > 0 && chr_array[i - 1] == '/')
// {
// chr_list.Insert(i - 1, '\n');
// chr_list.Add(chr);
// }
// else
// {
// chr_list.Add(chr);
// }
// }
// if (chr == '/')
// {
// if (i > 1 && chr_array[i - 1] == '*')
// {
// chr_list.Add(chr);
// chr_list.Add('\n');
// }
// else
// {
// chr_list.Add(chr);
// }
// }
// if (chr != '{' && chr != '}' && chr != ';'
// && chr != '*' && chr != '/' && chr != ',')
// {
// chr_list.Add(chr);
// }
// }
// }
// }
// #endregion
// string temp_str = string.Concat(chr_list.ToArray());
// #region 处理缩进,格式化样式
// string tab = " ";
// string[] lines_array = temp_str.Split('\n');
// List<string> result_list = new List<string>();
// foreach (string line in lines_array)
// {
// if (!string.IsNullOrEmpty(line.Trim()))
// {
// string temp_line = line.ToString().Trim();
// if (temp_line.TrimStart().StartsWith("})."))
// {
// temp_index = temp_index - 1;
// }
// if (temp_line == "{" || temp_line.EndsWith("{") )
// {
// if (temp_line.Contains("("))
// {
// temp_line = temp_line.Replace(") {", "){");
// }
// for (int i = 0; i < temp_index; i++)
// {
// temp_line = tab + temp_line;
// }
// temp_index = temp_index + 1;
// }
// if (!temp_line.Contains("{") && temp_line != "}"
// && !temp_line.EndsWith("});")
// && !temp_line.EndsWith("})(jQuery);")
// && !temp_line.TrimStart().StartsWith("})."))
// {
// if (temp_line.EndsWith("};") || temp_line.EndsWith("},"))
// {
// temp_index = temp_index - 1;
// }
// if (temp_line.EndsWith("/*") && temp_line != "/*")
// {
// for (int i = 0; i < temp_index; i++)
// {
// temp_line = tab + temp_line;
// }
// temp_line = temp_line.Replace("/*", "\r\n");
// string temp_nline = string.Empty;
// for (int i = 0; i < temp_index; i++)
// {
// temp_nline = tab + temp_nline;
// }
// temp_line = temp_line + temp_nline + "/*";
// }
// else
// {
// for (int i = 0; i < temp_index; i++)
// {
// temp_line = tab + temp_line;
// }
// }
// }
// if (temp_line == "}" || temp_line.EndsWith("});")
// || temp_line.EndsWith("})(jQuery);"))
// {
// temp_index = temp_index - 1;
// for (int i = 0; i < temp_index; i++)
// {
// temp_line = tab + temp_line;
// }
// }
// result_list.Add(temp_line);
// result = result + temp_line + "\r\n";
// }
// }
// #endregion
// temp_str = null;
// chr_list.Clear();
// result_list.Clear();
// chr_list = null;
// result_list = null;
// }
// catch (Exception ex)
// {
// result = strjs;
// }
// return result;
//}
public static string FormatToJavaScript(string strjs)
{
JSBeautifyOptions opts = new JSBeautifyOptions();
string result = string.Empty;
try
{
result = new JSBeautify(strjs, opts).GetResult();
}
catch (Exception ex)
{
result = ex.Message;
}
return result;
}
public static string FormatToString(string strjs)
{
return FormatToJavaScript(strjs);
}
public static string CompressToString(string strjs)
{
string result = string.Empty;
Regex regex = new Regex(@"//.*\n");
Match match = regex.Match(strjs);
while (match.Success)
{
string matchstr = match.Groups[0].Value;
strjs = strjs.Replace(matchstr, matchstr.Replace("//", "/*").Replace("\r\n", "*/\r\n"));
match = match.NextMatch();
}
strjs = strjs.Replace('\r', ' ');
strjs = strjs.Replace('\n', ' ');
strjs = Regex.Replace(strjs, " {1,}", "\n", RegexOptions.IgnoreCase)
.Replace("('\n", "('").Replace("\n')", "')")
.Replace("(\"\n", "(\"").Replace("\n\")", "\")")
.Replace("\"\n", "\"").Replace("\n\"", "\"");
strjs = strjs.Replace('\n', ' ');
//string[] lines_array = strjs.Split('\n');
result = strjs;
return result;
}
}
}
Loading...
Report
Report success
We will send you the feedback within 2 working days through the letter!
Please fill in the reason for the report carefully. Provide as detailed a description as possible.
Please select a report type
Cancel
Send
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

About

开发助手是一款面向开发人员的辅助助手,它集数据库管理(目前支持sqlserver,sqlite,mysql,postgresql),代码生成(支持从数据库生成实体映射类,数据库操作DAL中间层),数据库文档生成,代码收藏夹(支持C#,SQL,Javascrip,Html,XML,Python语法高亮),富文本编辑,插件管理等功能模块。自2015年到如今,它已经历过4个重大版本的升级,径过不断修复和完善,目前已成为一款堪称得心应手的开发辅助工具。
Cancel

Releases (3)

All

The Open Source Evaluation Index is derived from the OSS Compass evaluation system, which evaluates projects around the following three dimensions

1. Open source ecosystem

  • Productivity: To evaluate the ability of open-source projects to output software artifacts and open-source value.
  • Innovation: Used to evaluate the degree of diversity of open source software and its ecosystem.
  • Robustness: Used to evaluate the ability of open-source projects to resist internal and external interference and self recover in the face of changing development environments.

2. Collaboration, People, Software

  • Collaboration: represents the degree and depth of collaboration in open source development behavior.
  • Observe the influence of core personnel in open source projects, and examine the evaluations of users and developers on open source projects from a third-party perspective.
  • Software: Evaluate the value of products exported from open-source projects and their ultimate destination. It is also a concrete manifestation of "open source software", one of the oldest mainstream directions in open source evaluation.

3. Evaluation model

    Based on the dimensions of "open source ecosystem" and "collaboration, people, and software", identify quantifiable indicators directly or indirectly related to this goal, quantitatively evaluate the health and ecology of open source projects, and ultimately form an open source evaluation index.

Contributors

All

Activities

can not load any more
Edit
About
Homepage
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/sqlorm/DevelopAssistant.git
git@gitee.com:sqlorm/DevelopAssistant.git
sqlorm
DevelopAssistant
DevelopAssistant
master
Going to Help Center

Search

Comment
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register

AltStyle によって変換されたページ (->オリジナル) /