Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: hexojs/hexo-util
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.1.0
Choose a base ref
...
head repository: hexojs/hexo-util
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 4,151 additions and 1,174 deletions.
  1. +3 −0 .c8rc.json
  2. +6 −2 .eslintrc.json
  3. +11 −0 .github/dependabot.yml
  4. +20 −0 .github/workflows/linter.yml
  5. +46 −0 .github/workflows/tester.yml
  6. +3 −0 .gitignore
  7. +0 −6 .mocharc.json
  8. +3 −0 .mocharc.yml
  9. +0 −21 .travis.yml
  10. +523 −44 README.md
  11. +5 −0 SECURITY.md
  12. +0 −36 appveyor.yml
  13. +44 −0 lib/cache.ts
  14. +0 −29 lib/cache_stream.js
  15. +24 −0 lib/cache_stream.ts
  16. +8 −12 lib/{camel_case_keys.js → camel_case_keys.ts}
  17. +24 −13 lib/{color.js → color.ts}
  18. +18 −0 lib/decode_url.ts
  19. +22 −0 lib/deep_merge.ts
  20. +0 −17 lib/encode_url.js
  21. +20 −0 lib/encode_url.ts
  22. +6 −8 lib/{escape_diacritic.js → escape_diacritic.ts}
  23. +0 −19 lib/escape_html.js
  24. +25 −0 lib/escape_html.ts
  25. +2 −4 lib/{escape_regexp.js → escape_regexp.ts}
  26. +31 −0 lib/full_url_for.ts
  27. +27 −0 lib/gravatar.ts
  28. +0 −40 lib/hash.js
  29. +15 −0 lib/hash.ts
  30. +0 −142 lib/highlight.js
  31. +157 −0 lib/highlight.ts
  32. +0 −17 lib/html_tag.js
  33. +49 −0 lib/html_tag.ts
  34. +0 −23 lib/index.js
  35. +30 −0 lib/index.ts
  36. +52 −0 lib/is_external_link.ts
  37. +25 −23 lib/{pattern.js → pattern.ts}
  38. +0 −58 lib/permalink.js
  39. +63 −0 lib/permalink.ts
  40. +21 −0 lib/pretty_urls.ts
  41. +144 −0 lib/prism.ts
  42. +33 −0 lib/relative_url.ts
  43. +9 −6 lib/{slugize.js → slugize.ts}
  44. +21 −14 lib/{spawn.js → spawn.ts}
  45. +0 −3 lib/strip_html.js
  46. +124 −0 lib/strip_html.ts
  47. +1 −0 lib/strip_indent.ts
  48. +70 −0 lib/toc_obj.ts
  49. +8 −6 lib/{truncate.js → truncate.ts}
  50. +20 −0 lib/unescape_html.ts
  51. +77 −0 lib/url_for.ts
  52. +5 −3 lib/{word_wrap.js → word_wrap.ts}
  53. +42 −28 package.json
  54. +2 −5 scripts/build_highlight_alias.js
  55. +11 −1 test/.eslintrc.json
  56. +62 −0 test/cache.spec.ts
  57. +4 −14 test/{cache_stream.spec.js → cache_stream.spec.ts}
  58. +3 −5 test/{camel_case_keys.spec.js → camel_case_keys.spec.ts}
  59. +52 −5 test/{color.spec.js → color.spec.ts}
  60. +90 −0 test/decode_url.spec.ts
  61. +79 −0 test/deep_merge.spec.ts
  62. +0 −42 test/encode_url.spec.js
  63. +109 −0 test/encode_url.spec.ts
  64. +3 −5 test/{escape_diacritic.spec.js → escape_diacritic.spec.ts}
  65. +0 −15 test/escape_html.spec.js
  66. +21 −0 test/escape_html.spec.ts
  67. +3 −5 test/{escape_regexp.spec.js → escape_regexp.spec.ts}
  68. +92 −0 test/full_url_for.spec.ts
  69. +27 −0 test/gravatar.spec.ts
  70. +6 −20 test/{hash.spec.js → hash.spec.ts}
  71. +0 −298 test/highlight.spec.js
  72. +460 −0 test/highlight.spec.ts
  73. +0 −65 test/html_tag.spec.js
  74. +160 −0 test/html_tag.spec.ts
  75. +64 −0 test/is_external_link.spec.ts
  76. +17 −5 test/{pattern.spec.js → pattern.spec.ts}
  77. +39 −4 test/{permalink.spec.js → permalink.spec.ts}
  78. +29 −0 test/pretty_utls.spec.ts
  79. +354 −0 test/prism.spec.ts
  80. +32 −0 test/relative_url.spec.ts
  81. +3 −5 test/{slugize.spec.js → slugize.spec.ts}
  82. +0 −96 test/spawn.spec.js
  83. +154 −0 test/spawn.spec.ts
  84. +59 −0 test/strip_html.spec.ts
  85. +9 −0 test/strip_indent.spec.ts
  86. +181 −0 test/toc_obj.spec.ts
  87. +3 −5 test/{truncate.spec.js → truncate.spec.ts}
  88. +13 −0 test/unescape_html.spec.ts
  89. +156 −0 test/url_for.spec.ts
  90. +3 −5 test/{word_wrap.spec.js → word_wrap.spec.ts}
  91. +14 −0 tsconfig.json
3 changes: 3 additions & 0 deletions .c8rc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"all": "true"
}
8 changes: 6 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"extends": "hexo",
"root": true
"root": true,
"extends": "hexo/ts.js",
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2020
}
}
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: monthly
ignore:
- dependency-name: "@types/node"
- dependency-name: "*"
update-types: ["version-update:semver-patch"]
open-pull-requests-limit: 3
20 changes: 20 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Linter

on: [push, pull_request]

jobs:
linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v2
with:
node-version: '14.x'
- name: Install Dependencies
run: npm install
- name: Lint
run: |
npm run eslint
env:
CI: true
46 changes: 46 additions & 0 deletions .github/workflows/tester.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Tester

on: [push, pull_request]

jobs:
tester:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: ['14.x', '16.x', '18.x']
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
run: npm install
- name: Test
run: npm run test
env:
CI: true
coverage:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node-version: ['14.x']
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
run: npm install
- name: Coverage
run: npm run test-cov
env:
CI: true
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -5,3 +5,6 @@ tmp/
.idea/
.nyc_output/
highlight_alias.json
coverage/
dist/
package-lock.json
6 changes: 0 additions & 6 deletions .mocharc.json

This file was deleted.

3 changes: 3 additions & 0 deletions .mocharc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
reporter: spec
opts: false
spec: "test/*.spec.ts"
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

Loading