hexo-adsense 1.1.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -0
- package/LICENSE +0 -0
- package/dist/index.cjs +12799 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +12782 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +12782 -0
- package/dist/index.mjs.map +1 -0
- package/dist/source/adblock.css +2 -0
- package/dist/source/adblock.js +1 -0
- package/{lib → dist}/source/article-ads.css +0 -0
- package/dist/source/article-ads.js +1 -0
- package/dist/source/article-ads.old.js +1 -0
- package/{lib → dist}/source/blogger-redirect.html +0 -0
- package/dist/source/https.js +1 -0
- package/{lib → dist}/source/in_article_ads_test.html +0 -0
- package/package.json +122 -38
- package/{README.md → readme.md} +27 -8
- package/gulpfile.ts +0 -100
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -91
- package/lib/packages/hexo-cli-extras/lib/env.d.ts +0 -3
- package/lib/packages/hexo-cli-extras/lib/env.js +0 -49
- package/lib/packages/hexo-extend-injector2/index.d.ts +0 -2
- package/lib/packages/hexo-extend-injector2/index.js +0 -12
- package/lib/packages/hexo-extend-injector2/lib/bundle/css-bundle.d.ts +0 -2
- package/lib/packages/hexo-extend-injector2/lib/bundle/css-bundle.js +0 -64
- package/lib/packages/hexo-extend-injector2/lib/bundle/css-generator.d.ts +0 -2
- package/lib/packages/hexo-extend-injector2/lib/bundle/css-generator.js +0 -12
- package/lib/packages/hexo-extend-injector2/lib/bundle/handle-data-pre.d.ts +0 -2
- package/lib/packages/hexo-extend-injector2/lib/bundle/handle-data-pre.js +0 -28
- package/lib/packages/hexo-extend-injector2/lib/bundle/js-bundle.d.ts +0 -2
- package/lib/packages/hexo-extend-injector2/lib/bundle/js-bundle.js +0 -32
- package/lib/packages/hexo-extend-injector2/lib/bundle/js-generator.d.ts +0 -2
- package/lib/packages/hexo-extend-injector2/lib/bundle/js-generator.js +0 -8
- package/lib/packages/hexo-extend-injector2/lib/default-config.d.ts +0 -39
- package/lib/packages/hexo-extend-injector2/lib/default-config.js +0 -46
- package/lib/packages/hexo-extend-injector2/lib/filter.d.ts +0 -2
- package/lib/packages/hexo-extend-injector2/lib/filter.js +0 -22
- package/lib/packages/hexo-extend-injector2/lib/helper/injector.d.ts +0 -2
- package/lib/packages/hexo-extend-injector2/lib/helper/injector.js +0 -5
- package/lib/packages/hexo-extend-injector2/lib/helper/next-inject.d.ts +0 -2
- package/lib/packages/hexo-extend-injector2/lib/helper/next-inject.js +0 -12
- package/lib/packages/hexo-extend-injector2/lib/injector.d.ts +0 -29
- package/lib/packages/hexo-extend-injector2/lib/injector.js +0 -125
- package/lib/packages/hexo-extend-injector2/lib/load.d.ts +0 -3
- package/lib/packages/hexo-extend-injector2/lib/load.js +0 -37
- package/lib/packages/hexo-extend-injector2/lib/next-point.d.ts +0 -2
- package/lib/packages/hexo-extend-injector2/lib/next-point.js +0 -18
- package/lib/packages/hexo-extend-injector2/lib/next.d.ts +0 -2
- package/lib/packages/hexo-extend-injector2/lib/next.js +0 -99
- package/lib/packages/hexo-extend-injector2/lib/order.d.ts +0 -5
- package/lib/packages/hexo-extend-injector2/lib/order.js +0 -8
- package/lib/source/adblock.css +0 -2
- package/lib/source/adblock.js +0 -1
- package/lib/source/article-ads.js +0 -1
- package/lib/source/article-ads.old.js +0 -1
- package/lib/source/https.js +0 -1
- package/lib/src/article-ads.d.ts +0 -20
- package/lib/src/article-ads.js +0 -310
- package/lib/src/checkLocalHost.d.ts +0 -10
- package/lib/src/checkLocalHost.js +0 -37
- package/lib/src/config.d.ts +0 -14
- package/lib/src/config.js +0 -50
- package/lib/src/html-parser.d.ts +0 -8
- package/lib/src/html-parser.js +0 -26
- package/lib/src/log.d.ts +0 -1
- package/lib/src/log.js +0 -11
- package/lib/src/logger.d.ts +0 -3
- package/lib/src/logger.js +0 -25
- package/lib/src/md5.d.ts +0 -7
- package/lib/src/md5.js +0 -30
- package/lib/src/safestringify.d.ts +0 -2
- package/lib/src/safestringify.js +0 -125
- package/lib/src/utils.d.ts +0 -31
- package/lib/src/utils.js +0 -160
- package/lib/src/versionParser.d.ts +0 -27
- package/lib/src/versionParser.js +0 -40
- package/packages/@types/.gitmodules +0 -8
- package/packages/@types/LICENSE +0 -21
- package/packages/@types/README.md +0 -27
- package/packages/@types/hexo/HexoConfig.d.ts +0 -216
- package/packages/@types/hexo/LICENSE +0 -21
- package/packages/@types/hexo/README.md +0 -16
- package/packages/@types/hexo/index.d.ts +0 -849
- package/packages/@types/hexo/package.json +0 -34
- package/packages/@types/hexo-bunyan/LICENSE +0 -21
- package/packages/@types/hexo-bunyan/README.md +0 -16
- package/packages/@types/hexo-bunyan/index.d.ts +0 -9
- package/packages/@types/hexo-bunyan/package.json +0 -24
- package/packages/@types/hexo-log/LICENSE +0 -21
- package/packages/@types/hexo-log/README.md +0 -16
- package/packages/@types/hexo-log/index.d.ts +0 -159
- package/packages/@types/hexo-log/package.json +0 -28
- package/packages/@types/index.js +0 -2
- package/packages/@types/package.json +0 -30
- package/packages/@types/test/package.json +0 -15
- package/packages/@types/test/through2.ts +0 -6
- package/packages/@types/tsconfig.json +0 -14
- package/packages/@types/typings/index.d.ts +0 -7
- package/packages/@types/typings/kill-port.d.ts +0 -3
- package/packages/@types/typings/markdown-it-abbr.d.ts +0 -4
- package/packages/@types/typings/markdown-it-footnote.d.ts +0 -4
- package/packages/@types/typings/markdown-it-image-figures.d.ts +0 -4
- package/packages/@types/typings/markdown-it-mark.d.ts +0 -4
- package/packages/@types/typings/markdown-it-sub.d.ts +0 -7
- package/packages/@types/typings/markdown-it-sup.d.ts +0 -7
- package/packages/hexo-cli-extras/.eslintrc +0 -13
- package/packages/hexo-cli-extras/LICENSE.md +0 -20
- package/packages/hexo-cli-extras/README.md +0 -146
- package/packages/hexo-cli-extras/docs/basic.gif +0 -0
- package/packages/hexo-cli-extras/docs/gui.gif +0 -0
- package/packages/hexo-cli-extras/docs/remove.png +0 -0
- package/packages/hexo-cli-extras/docs/rename.png +0 -0
- package/packages/hexo-cli-extras/index.js +0 -48
- package/packages/hexo-cli-extras/lib/edit.js +0 -209
- package/packages/hexo-cli-extras/lib/env.js +0 -52
- package/packages/hexo-cli-extras/lib/extensions.js +0 -23
- package/packages/hexo-cli-extras/lib/integrate.js +0 -87
- package/packages/hexo-cli-extras/lib/isolate.js +0 -179
- package/packages/hexo-cli-extras/lib/remove.js +0 -145
- package/packages/hexo-cli-extras/lib/rename.js +0 -171
- package/packages/hexo-cli-extras/package.json +0 -34
- package/packages/hexo-extend-injector2/.eslintrc +0 -4
- package/packages/hexo-extend-injector2/.github/workflows/linter.yml +0 -27
- package/packages/hexo-extend-injector2/.github/workflows/tester.yml +0 -24
- package/packages/hexo-extend-injector2/.vscode/settings.json +0 -10
- package/packages/hexo-extend-injector2/LICENSE +0 -165
- package/packages/hexo-extend-injector2/README-ZH.md +0 -189
- package/packages/hexo-extend-injector2/README.md +0 -191
- package/packages/hexo-extend-injector2/USAGE.md +0 -38
- package/packages/hexo-extend-injector2/index.js +0 -14
- package/packages/hexo-extend-injector2/lib/bundle/css-bundle.js +0 -79
- package/packages/hexo-extend-injector2/lib/bundle/css-generator.js +0 -13
- package/packages/hexo-extend-injector2/lib/bundle/handle-data-pre.js +0 -29
- package/packages/hexo-extend-injector2/lib/bundle/js-bundle.js +0 -42
- package/packages/hexo-extend-injector2/lib/bundle/js-generator.js +0 -10
- package/packages/hexo-extend-injector2/lib/default-config.js +0 -52
- package/packages/hexo-extend-injector2/lib/filter.js +0 -24
- package/packages/hexo-extend-injector2/lib/helper/injector.js +0 -6
- package/packages/hexo-extend-injector2/lib/helper/next-inject.js +0 -14
- package/packages/hexo-extend-injector2/lib/injector.js +0 -128
- package/packages/hexo-extend-injector2/lib/load.js +0 -45
- package/packages/hexo-extend-injector2/lib/next-point.js +0 -19
- package/packages/hexo-extend-injector2/lib/next.js +0 -87
- package/packages/hexo-extend-injector2/lib/order.js +0 -9
- package/packages/hexo-extend-injector2/package.json +0 -49
- package/packages/hexo-extend-injector2/renovate.json +0 -6
- package/packages/hexo-extend-injector2/test/.eslintrc +0 -3
- package/packages/hexo-extend-injector2/test/index.js +0 -18
- package/packages/hexo-extend-injector2/test/lib/bundle/bundle-css.js +0 -86
- package/packages/hexo-extend-injector2/test/lib/bundle/bundle-js.js +0 -36
- package/packages/hexo-extend-injector2/test/lib/bundle/test.css +0 -3
- package/packages/hexo-extend-injector2/test/lib/bundle/test.js +0 -5
- package/packages/hexo-extend-injector2/test/lib/helper/injector.js +0 -45
- package/packages/hexo-extend-injector2/test/lib/helper/next-inject.js +0 -69
- package/packages/hexo-extend-injector2/test/lib/hexo-compatible.js +0 -250
- package/packages/hexo-extend-injector2/test/lib/hexo-injector.js +0 -37
- package/packages/hexo-extend-injector2/test/lib/injector.js +0 -93
- package/packages/memoize/CHANGELOG.md +0 -82
- package/packages/memoize/CHANGES +0 -124
- package/packages/memoize/LICENSE +0 -15
- package/packages/memoize/README.md +0 -503
- package/packages/memoize/ext/async.js +0 -154
- package/packages/memoize/ext/dispose.js +0 -33
- package/packages/memoize/ext/max-age.js +0 -90
- package/packages/memoize/ext/max.js +0 -27
- package/packages/memoize/ext/promise.js +0 -147
- package/packages/memoize/ext/ref-counter.js +0 -48
- package/packages/memoize/index.js +0 -34
- package/packages/memoize/lib/configure-map.js +0 -182
- package/packages/memoize/lib/methods.js +0 -32
- package/packages/memoize/lib/registered-extensions.js +0 -1
- package/packages/memoize/lib/resolve-length.js +0 -15
- package/packages/memoize/lib/resolve-normalize.js +0 -17
- package/packages/memoize/lib/resolve-resolve.js +0 -21
- package/packages/memoize/lib/weak.js +0 -134
- package/packages/memoize/methods-plain.js +0 -3
- package/packages/memoize/methods.js +0 -3
- package/packages/memoize/normalizers/get-1.js +0 -29
- package/packages/memoize/normalizers/get-fixed.js +0 -71
- package/packages/memoize/normalizers/get-primitive-fixed.js +0 -16
- package/packages/memoize/normalizers/get.js +0 -90
- package/packages/memoize/normalizers/primitive.js +0 -9
- package/packages/memoize/package.json +0 -60
- package/packages/memoize/plain.js +0 -37
- package/packages/memoize/profile.js +0 -107
- package/packages/memoize/repository.md +0 -1
- package/packages/memoize/weak-plain.js +0 -3
- package/packages/memoize/weak.js +0 -3
- package/tsconfig.json +0 -39
- package/unused.md +0 -11
package/lib/src/utils.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Memorize cache
|
|
3
|
-
*
|
|
4
|
-
* @param {any} fn
|
|
5
|
-
* @see {@link https://www.freecodecamp.org/news/understanding-memoize-in-javascript-51d07d19430e/}
|
|
6
|
-
* @returns {typeof import('underscore').memoize}
|
|
7
|
-
*/
|
|
8
|
-
export function memoize(fn: any, debug: any): typeof import('underscore').memoize;
|
|
9
|
-
/**
|
|
10
|
-
* Dump large objects
|
|
11
|
-
* @param {string} filename
|
|
12
|
-
* @param {any} obj
|
|
13
|
-
*/
|
|
14
|
-
export function dump(filename: string, ...obj: any): any;
|
|
15
|
-
/**
|
|
16
|
-
*
|
|
17
|
-
* @param {string} path0
|
|
18
|
-
* @param {string[]|string} exclude
|
|
19
|
-
* @param {Hexo} hexo
|
|
20
|
-
* @returns
|
|
21
|
-
*/
|
|
22
|
-
export function isIgnore(path0: string, exclude: string[] | string, hexo: Hexo): boolean;
|
|
23
|
-
declare function randomInt(min: any, max: any): number;
|
|
24
|
-
export function streamToString(stream: any): Promise<any>;
|
|
25
|
-
export function isFileChanged(filePath: any): globalThis.Promise<boolean>;
|
|
26
|
-
export function getFileCache(filePath: any, defaultData: any): any;
|
|
27
|
-
export function setFileCache(filePath: any, newData: any): void;
|
|
28
|
-
export function setHexo(inHexo: any): void;
|
|
29
|
-
import Hexo = require("hexo");
|
|
30
|
-
import Promise = require("bluebird");
|
|
31
|
-
export { randomInt as randInt };
|
package/lib/src/utils.js
DELETED
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-global-assign */
|
|
2
|
-
/* global hexo */
|
|
3
|
-
"use strict";
|
|
4
|
-
var minimatch = require("minimatch");
|
|
5
|
-
var Promise = require("bluebird");
|
|
6
|
-
var md5File = require("md5-file");
|
|
7
|
-
var underscore = require("underscore");
|
|
8
|
-
var Hexo = require("hexo");
|
|
9
|
-
var md5Cache = {};
|
|
10
|
-
var fileCache = {};
|
|
11
|
-
var log = require("./log");
|
|
12
|
-
var path = require("path");
|
|
13
|
-
var util = require("util");
|
|
14
|
-
var fs = require("fs");
|
|
15
|
-
var rimraf = require("rimraf");
|
|
16
|
-
if (typeof hexo == "undefined") {
|
|
17
|
-
/**
|
|
18
|
-
* @type {Hexo}
|
|
19
|
-
*/
|
|
20
|
-
var hexo_1;
|
|
21
|
-
}
|
|
22
|
-
function setHexo(inHexo) {
|
|
23
|
-
hexo = inHexo;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
* @param {string} path0
|
|
28
|
-
* @param {string[]|string} exclude
|
|
29
|
-
* @param {Hexo} hexo
|
|
30
|
-
* @returns
|
|
31
|
-
*/
|
|
32
|
-
var isIgnore = function (path0, exclude, hexo) {
|
|
33
|
-
if (exclude && !Array.isArray(exclude))
|
|
34
|
-
exclude = [exclude];
|
|
35
|
-
if (path0 && exclude && exclude.length) {
|
|
36
|
-
for (var i = 0, len = exclude.length; i < len; i++) {
|
|
37
|
-
var excludePattern = exclude[i];
|
|
38
|
-
if (hexo) {
|
|
39
|
-
var fromBase = path.join(hexo.base_dir, excludePattern);
|
|
40
|
-
var fromSource = path.join(hexo.source_dir, excludePattern);
|
|
41
|
-
//log.log([path0, fromBase, fromSource, excludePattern]);
|
|
42
|
-
if (minimatch(path0, fromSource))
|
|
43
|
-
return true;
|
|
44
|
-
if (minimatch(path0, fromBase))
|
|
45
|
-
return true;
|
|
46
|
-
}
|
|
47
|
-
if (minimatch(path0, excludePattern))
|
|
48
|
-
return true;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return false;
|
|
52
|
-
};
|
|
53
|
-
function streamToString(stream) {
|
|
54
|
-
return new Promise(function (resolve, reject) {
|
|
55
|
-
var chunks = [];
|
|
56
|
-
stream.on("data", function (chunk) {
|
|
57
|
-
chunks.push(chunk.toString());
|
|
58
|
-
});
|
|
59
|
-
stream.on("end", function () {
|
|
60
|
-
resolve(chunks.join(""));
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
function isFileChanged(filePath) {
|
|
65
|
-
return md5File(filePath)
|
|
66
|
-
.then(function (hash1) {
|
|
67
|
-
var hash = md5Cache[filePath];
|
|
68
|
-
md5Cache[filePath] = hash1;
|
|
69
|
-
if (!hash) {
|
|
70
|
-
return true;
|
|
71
|
-
}
|
|
72
|
-
if (hash === hash1) {
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
|
-
return true;
|
|
76
|
-
})["catch"](function (err) {
|
|
77
|
-
return true;
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
function getFileCache(filePath, defaultData) {
|
|
81
|
-
var cache = fileCache[filePath] || defaultData;
|
|
82
|
-
return cache;
|
|
83
|
-
}
|
|
84
|
-
function setFileCache(filePath, newData) {
|
|
85
|
-
fileCache[filePath] = newData;
|
|
86
|
-
}
|
|
87
|
-
function randomInt(min, max) {
|
|
88
|
-
if (!min)
|
|
89
|
-
min = 0;
|
|
90
|
-
if (!max)
|
|
91
|
-
throw "max range number required";
|
|
92
|
-
// min and max included
|
|
93
|
-
return Math.floor(Math.random() * (max - min + 1) + min);
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Memorize cache
|
|
97
|
-
*
|
|
98
|
-
* @param {any} fn
|
|
99
|
-
* @see {@link https://www.freecodecamp.org/news/understanding-memoize-in-javascript-51d07d19430e/}
|
|
100
|
-
* @returns {typeof import('underscore').memoize}
|
|
101
|
-
*/
|
|
102
|
-
var memoize = function (fn, debug) {
|
|
103
|
-
var cache = {};
|
|
104
|
-
return function () {
|
|
105
|
-
var args = [];
|
|
106
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
107
|
-
args[_i] = arguments[_i];
|
|
108
|
-
}
|
|
109
|
-
var n = args[0];
|
|
110
|
-
if (n in cache) {
|
|
111
|
-
if (debug)
|
|
112
|
-
console.log("Fetching from cache", n);
|
|
113
|
-
//console.log(cache);
|
|
114
|
-
return cache[n];
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
if (debug)
|
|
118
|
-
console.log("Calculating result", n);
|
|
119
|
-
var result = fn(n);
|
|
120
|
-
cache[n] = result;
|
|
121
|
-
return result;
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
|
-
var isFirst = true;
|
|
126
|
-
/**
|
|
127
|
-
* Dump large objects
|
|
128
|
-
* @param {string} filename
|
|
129
|
-
* @param {any} obj
|
|
130
|
-
*/
|
|
131
|
-
function dump(filename) {
|
|
132
|
-
var obj = [];
|
|
133
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
134
|
-
obj[_i - 1] = arguments[_i];
|
|
135
|
-
}
|
|
136
|
-
var loc = path.join(__dirname, "../tmp", filename);
|
|
137
|
-
if (!fs.existsSync(path.dirname(loc))) {
|
|
138
|
-
fs.mkdirSync(path.dirname(loc));
|
|
139
|
-
}
|
|
140
|
-
else if (isFirst) {
|
|
141
|
-
isFirst = false;
|
|
142
|
-
rimraf(loc, function (err) {
|
|
143
|
-
console.log(loc, "deleted", err ? "fail" : "success");
|
|
144
|
-
});
|
|
145
|
-
return dump(filename, obj);
|
|
146
|
-
}
|
|
147
|
-
fs.writeFileSync(loc, util.inspect(obj));
|
|
148
|
-
console.log("dump results saved to ".concat(loc));
|
|
149
|
-
}
|
|
150
|
-
module.exports = {
|
|
151
|
-
memoize: memoize,
|
|
152
|
-
dump: dump,
|
|
153
|
-
isIgnore: isIgnore,
|
|
154
|
-
randInt: randomInt,
|
|
155
|
-
streamToString: streamToString,
|
|
156
|
-
isFileChanged: isFileChanged,
|
|
157
|
-
getFileCache: getFileCache,
|
|
158
|
-
setFileCache: setFileCache,
|
|
159
|
-
setHexo: setHexo
|
|
160
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export = versionParser;
|
|
2
|
-
/**
|
|
3
|
-
* Version Parser
|
|
4
|
-
*/
|
|
5
|
-
declare class versionParser {
|
|
6
|
-
/**
|
|
7
|
-
* Version Parser Constructor
|
|
8
|
-
* @param {string} str
|
|
9
|
-
*/
|
|
10
|
-
constructor(str: string);
|
|
11
|
-
result: {
|
|
12
|
-
major: number;
|
|
13
|
-
minor: number;
|
|
14
|
-
build: number;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Parse Version String
|
|
18
|
-
* @param {string} str
|
|
19
|
-
* @returns
|
|
20
|
-
*/
|
|
21
|
-
parseVersion(str: string): {
|
|
22
|
-
major: number;
|
|
23
|
-
minor: number;
|
|
24
|
-
build: number;
|
|
25
|
-
};
|
|
26
|
-
toString(): string;
|
|
27
|
-
}
|
package/lib/src/versionParser.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Version Parser
|
|
3
|
-
*/
|
|
4
|
-
var versionParser = /** @class */ (function () {
|
|
5
|
-
/**
|
|
6
|
-
* Version Parser Constructor
|
|
7
|
-
* @param {string} str
|
|
8
|
-
*/
|
|
9
|
-
function versionParser(str) {
|
|
10
|
-
this.result = {
|
|
11
|
-
major: 0,
|
|
12
|
-
minor: 0,
|
|
13
|
-
build: 0
|
|
14
|
-
};
|
|
15
|
-
if (typeof str == "string")
|
|
16
|
-
this.parseVersion(str);
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Parse Version String
|
|
20
|
-
* @param {string} str
|
|
21
|
-
* @returns
|
|
22
|
-
*/
|
|
23
|
-
versionParser.prototype.parseVersion = function (str) {
|
|
24
|
-
if (typeof str != "string") {
|
|
25
|
-
//return false;
|
|
26
|
-
throw "argument required string, found " + typeof str;
|
|
27
|
-
}
|
|
28
|
-
var arr = str.split(".");
|
|
29
|
-
// parse int or default to 0
|
|
30
|
-
this.result.major = parseInt(arr[0]) || 0;
|
|
31
|
-
this.result.minor = parseInt(arr[1]) || 0;
|
|
32
|
-
this.result.build = parseInt(arr[2]) || 0;
|
|
33
|
-
return this.result;
|
|
34
|
-
};
|
|
35
|
-
versionParser.prototype.toString = function () {
|
|
36
|
-
return "".concat(this.result.major, ".").concat(this.result.minor, ".").concat(this.result.build);
|
|
37
|
-
};
|
|
38
|
-
return versionParser;
|
|
39
|
-
}());
|
|
40
|
-
module.exports = versionParser;
|
package/packages/@types/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2021 Dimas Lanjaka
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# nodejs-package-types
|
|
2
|
-
Customized Package Types
|
|
3
|
-
- @types/through2
|
|
4
|
-
- @types/kill-port
|
|
5
|
-
- @types/markdown-it-abbr
|
|
6
|
-
- @types/markdown-it-footnote
|
|
7
|
-
- @types/markdown-it-image-figures
|
|
8
|
-
- @types/markdown-it-mark
|
|
9
|
-
- @types/markdown-it-sub
|
|
10
|
-
- @types/markdown-it-sup
|
|
11
|
-
|
|
12
|
-
Installation
|
|
13
|
-
```bash
|
|
14
|
-
yarn add https://github.com/dimaslanjaka/nodejs-package-types.git --dev
|
|
15
|
-
# or
|
|
16
|
-
npm i https://github.com/dimaslanjaka/nodejs-package-types.git -D
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
or you can visit [GitPkg](https://gitpkg.vercel.app/) and insert which branch or subfolder you want to install
|
|
20
|
-
|
|
21
|
-
Development
|
|
22
|
-
```shell
|
|
23
|
-
git submodule add https://github.com/dimaslanjaka/nodejs-package-types.git packages/@types
|
|
24
|
-
npm i -D ./packages/@types/hexo
|
|
25
|
-
npm i -D ./packages/@types/hexo-bunyan
|
|
26
|
-
npm i -D ./packages/@types/hexo-log
|
|
27
|
-
```
|
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
import Hexo from "./index";
|
|
2
|
-
|
|
3
|
-
interface HexoConfig {
|
|
4
|
-
[key: string]: any;
|
|
5
|
-
/**
|
|
6
|
-
* The title of your website
|
|
7
|
-
*/
|
|
8
|
-
readonly title: string;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* The subtitle of your website
|
|
12
|
-
*/
|
|
13
|
-
readonly subtitle: string;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* The description of your website
|
|
17
|
-
*/
|
|
18
|
-
readonly description: string;
|
|
19
|
-
|
|
20
|
-
/*
|
|
21
|
-
* Your name
|
|
22
|
-
*/
|
|
23
|
-
readonly author: string;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* The language of your website. Use a 2-lettter ISO-639-1 code. Default is en.
|
|
27
|
-
*/
|
|
28
|
-
readonly language: string | string[];
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* The timezone of your website. Hexo uses the setting on your computer by default.
|
|
32
|
-
* You can find the list of available timezones [here]{@link https://en.wikipedia.org/wiki/List_of_tz_database_time_zones} .
|
|
33
|
-
* Some examples are `America/New_York` , `Japan` , and `UTC` .
|
|
34
|
-
*/
|
|
35
|
-
readonly timezone: string;
|
|
36
|
-
|
|
37
|
-
/*
|
|
38
|
-
* The URL of your website
|
|
39
|
-
*/
|
|
40
|
-
readonly url: string;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* The root directory of your website
|
|
44
|
-
*/
|
|
45
|
-
readonly root: string;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* The permalink format of articles
|
|
49
|
-
*/
|
|
50
|
-
readonly permalink: string;
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Default values of each segment in permalink
|
|
54
|
-
*/
|
|
55
|
-
readonly permalink_defaults: string | null;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Source folder. Where your content is stored
|
|
59
|
-
*/
|
|
60
|
-
readonly source_dir: string;
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Public folder. Where the static site will be generated
|
|
64
|
-
*/
|
|
65
|
-
readonly public_dir: string;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Tag directory
|
|
69
|
-
*/
|
|
70
|
-
readonly tag_dir: string;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Archive directory
|
|
74
|
-
*/
|
|
75
|
-
readonly archive_dir: string;
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Category directory
|
|
79
|
-
*/
|
|
80
|
-
readonly category_dir: string;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Include code directory (subdirectory of source_dir)
|
|
84
|
-
*/
|
|
85
|
-
readonly code_dir: string;
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* i18n directory
|
|
89
|
-
*/
|
|
90
|
-
readonly i18n_dir: string;
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Paths that will be copied to public raw, without being rendered. You can use glob expressions for path matching.
|
|
94
|
-
*/
|
|
95
|
-
readonly skip_render: string | string[] | null;
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* The filename format for new posts
|
|
99
|
-
*/
|
|
100
|
-
readonly new_post_name: string;
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Default layout
|
|
104
|
-
*/
|
|
105
|
-
readonly default_layout: string;
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Transform titles into title case?
|
|
109
|
-
*/
|
|
110
|
-
readonly titlecase: boolean;
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Open external links in a new tab?
|
|
114
|
-
*/
|
|
115
|
-
readonly external_link: boolean;
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Transform filenames to 1 lower case; 2 upper case
|
|
119
|
-
*/
|
|
120
|
-
readonly filename_case: number;
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Display drafts?
|
|
124
|
-
*/
|
|
125
|
-
readonly render_drafts: boolean;
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Enable the Asset Folder?
|
|
129
|
-
*/
|
|
130
|
-
readonly post_asset_folder: boolean;
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Make links relative to the root folder?
|
|
134
|
-
*/
|
|
135
|
-
readonly relative_link: boolean;
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Display future posts?
|
|
139
|
-
*/
|
|
140
|
-
readonly future: boolean;
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Code block settings
|
|
144
|
-
*/
|
|
145
|
-
readonly highlight: {
|
|
146
|
-
readonly enable: boolean;
|
|
147
|
-
readonly line_number: boolean;
|
|
148
|
-
readonly auto_detect: boolean;
|
|
149
|
-
readonly tab_replace: string | null;
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Default category
|
|
154
|
-
*/
|
|
155
|
-
readonly default_category: string;
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Category slugs
|
|
159
|
-
*/
|
|
160
|
-
readonly category_map: { [key: string]: string | number };
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Tag slugs
|
|
164
|
-
*/
|
|
165
|
-
readonly tag_map: { [key: string]: string | number };
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Date format
|
|
169
|
-
* https://momentjs.com/
|
|
170
|
-
*/
|
|
171
|
-
readonly date_format: string;
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Time format
|
|
175
|
-
* https://momentjs.com/
|
|
176
|
-
*/
|
|
177
|
-
readonly time_format: string;
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* The amount of posts displayed on a single page. 0 disables pagination
|
|
181
|
-
*/
|
|
182
|
-
readonly per_page: number;
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* Pagination directory
|
|
186
|
-
*/
|
|
187
|
-
readonly pagination_dir: string;
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* Theme name. false disables theming
|
|
191
|
-
*/
|
|
192
|
-
readonly theme: string | false;
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* Theme configuration. Include any custom theme settings under this key to override theme defaults.
|
|
196
|
-
*/
|
|
197
|
-
readonly theme_config: { [key: string]: string | number };
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* Deployment settings
|
|
201
|
-
*/
|
|
202
|
-
readonly deploy: Hexo.extend.Deployer.Config | Hexo.extend.Deployer.Config | null;
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* Hexo by default ignores hidden files and folders, but setting this field will make Hexo process them
|
|
206
|
-
*/
|
|
207
|
-
readonly include?: string[] | undefined;
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Hexo process will ignore files list under this field
|
|
211
|
-
*/
|
|
212
|
-
readonly exclude?: string[] | undefined;
|
|
213
|
-
readonly ignore: string[];
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
export = HexoConfig;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# Installation
|
|
2
|
-
> `npm install --save @types/hexo`
|
|
3
|
-
|
|
4
|
-
# Summary
|
|
5
|
-
This package contains type definitions for hexo (https://hexo.io/).
|
|
6
|
-
|
|
7
|
-
# Details
|
|
8
|
-
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/hexo.
|
|
9
|
-
|
|
10
|
-
### Additional Details
|
|
11
|
-
* Last updated: Sat, 14 Aug 2021 23:01:21 GMT
|
|
12
|
-
* Dependencies: [@types/moment](https://npmjs.com/package/@types/moment), [@types/minimist](https://npmjs.com/package/@types/minimist), [@types/bunyan](https://npmjs.com/package/@types/bunyan), [@types/underscore](https://npmjs.com/package/@types/underscore), [@types/connect](https://npmjs.com/package/@types/connect), [@types/hexo-util](https://npmjs.com/package/@types/hexo-util), [@types/bluebird](https://npmjs.com/package/@types/bluebird)
|
|
13
|
-
* Global values: none
|
|
14
|
-
|
|
15
|
-
# Credits
|
|
16
|
-
These definitions were written by [KentarouTakeda](https://github.com/kentarouTakeda).
|