@ray-js/shared 0.3.0-beta.1c347991
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/README.md +1 -0
- package/lib/file.d.ts +10 -0
- package/lib/file.js +63 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.js +26 -0
- package/lib/log.d.ts +2 -0
- package/lib/log.js +11 -0
- package/lib/path.d.ts +3 -0
- package/lib/path.js +34 -0
- package/lib/regexp/NamedRegexp.d.ts +24 -0
- package/lib/regexp/NamedRegexp.js +35 -0
- package/lib/regexp/index.d.ts +1 -0
- package/lib/regexp/index.js +8 -0
- package/lib/url/format.d.ts +2 -0
- package/lib/url/format.js +13 -0
- package/lib/url/index.d.ts +16 -0
- package/lib/url/index.js +26 -0
- package/lib/url/interface.d.ts +12 -0
- package/lib/url/interface.js +2 -0
- package/lib/url/params.d.ts +1 -0
- package/lib/url/params.js +14 -0
- package/lib/url/parse.d.ts +2 -0
- package/lib/url/parse.js +39 -0
- package/lib/url/queryStringify.d.ts +3 -0
- package/lib/url/queryStringify.js +16 -0
- package/lib/url/searchParse.d.ts +5 -0
- package/lib/url/searchParse.js +26 -0
- package/package.json +46 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# @ray-js/shared
|
package/lib/file.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { outputFileSync } from 'fs-extra';
|
|
2
|
+
import { RayConfig } from '@ray-js/types';
|
|
3
|
+
export declare function writeFileSync(...params: Parameters<typeof outputFileSync>): void;
|
|
4
|
+
export declare function searchJSFile(fileName: string, options: {
|
|
5
|
+
cwd: string;
|
|
6
|
+
extensions?: string[];
|
|
7
|
+
}): string;
|
|
8
|
+
export declare function requireJSFile(file: string, specifier?: string): any;
|
|
9
|
+
export declare function requireRayConfigFile(cwd: string): RayConfig;
|
|
10
|
+
export declare function replaceExtension(file: string, ext?: string): string;
|
package/lib/file.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.replaceExtension = exports.requireRayConfigFile = exports.requireJSFile = exports.searchJSFile = exports.writeFileSync = void 0;
|
|
7
|
+
const fs_extra_1 = require("fs-extra");
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const slash_1 = __importDefault(require("slash"));
|
|
10
|
+
function writeFileSync(...params) {
|
|
11
|
+
(0, fs_extra_1.outputFileSync)(...params);
|
|
12
|
+
}
|
|
13
|
+
exports.writeFileSync = writeFileSync;
|
|
14
|
+
function searchJSFile(fileName, options) {
|
|
15
|
+
const { cwd, extensions = ['.ts', '.js'] } = options;
|
|
16
|
+
for (const extension of extensions) {
|
|
17
|
+
const file = path_1.default.join(cwd, fileName + extension);
|
|
18
|
+
if ((0, fs_extra_1.existsSync)(file)) {
|
|
19
|
+
return (0, slash_1.default)(file);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.searchJSFile = searchJSFile;
|
|
24
|
+
function requireJSFile(file, specifier = 'default') {
|
|
25
|
+
if (!path_1.default.isAbsolute(file)) {
|
|
26
|
+
throw new Error('require(file) must be absolute path');
|
|
27
|
+
}
|
|
28
|
+
if (file.endsWith('.ts')) {
|
|
29
|
+
require('@babel/register')({
|
|
30
|
+
presets: [
|
|
31
|
+
[require.resolve('@babel/preset-env'), { modules: 'auto' }],
|
|
32
|
+
require.resolve('@babel/preset-typescript'),
|
|
33
|
+
],
|
|
34
|
+
extensions: ['.ts'],
|
|
35
|
+
cache: false,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
try {
|
|
39
|
+
delete require.cache[require.resolve(file)];
|
|
40
|
+
const module = require(file);
|
|
41
|
+
if (module.default && specifier === 'default') {
|
|
42
|
+
return module.default;
|
|
43
|
+
}
|
|
44
|
+
return module;
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
console.error(err);
|
|
48
|
+
console.error('requireJSFile load failed:', file);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.requireJSFile = requireJSFile;
|
|
52
|
+
function requireRayConfigFile(cwd) {
|
|
53
|
+
const rayConfigFile = searchJSFile('ray.config', { cwd });
|
|
54
|
+
if (!rayConfigFile) {
|
|
55
|
+
throw new Error('Missing configuration file (ray.config)');
|
|
56
|
+
}
|
|
57
|
+
return requireJSFile(rayConfigFile);
|
|
58
|
+
}
|
|
59
|
+
exports.requireRayConfigFile = requireRayConfigFile;
|
|
60
|
+
function replaceExtension(file, ext = '') {
|
|
61
|
+
return file.replace(path_1.default.extname(file), ext);
|
|
62
|
+
}
|
|
63
|
+
exports.replaceExtension = replaceExtension;
|
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.url = void 0;
|
|
21
|
+
__exportStar(require("./file"), exports);
|
|
22
|
+
__exportStar(require("./path"), exports);
|
|
23
|
+
__exportStar(require("./log"), exports);
|
|
24
|
+
__exportStar(require("change-case"), exports);
|
|
25
|
+
const url_1 = __importDefault(require("./url"));
|
|
26
|
+
exports.url = url_1.default;
|
package/lib/log.d.ts
ADDED
package/lib/log.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.log = void 0;
|
|
7
|
+
const npmlog_1 = __importDefault(require("npmlog"));
|
|
8
|
+
const envs = ['verbose', 'info', 'error', 'warn'];
|
|
9
|
+
const logLevel = envs.indexOf(process.env.LOG_LEVEL) !== -1 ? process.env.LOG_LEVEL : 'info';
|
|
10
|
+
npmlog_1.default.level = logLevel;
|
|
11
|
+
exports.log = npmlog_1.default;
|
package/lib/path.d.ts
ADDED
package/lib/path.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.resolvePath = void 0;
|
|
27
|
+
const path = __importStar(require("path"));
|
|
28
|
+
function resolvePath(paths, options) {
|
|
29
|
+
const isAbsolute = path.isAbsolute(paths[0]);
|
|
30
|
+
const { cwd = process.cwd() } = options || {};
|
|
31
|
+
const p = paths.join(path.sep);
|
|
32
|
+
return isAbsolute ? path.resolve(p) : path.resolve(cwd, p);
|
|
33
|
+
}
|
|
34
|
+
exports.resolvePath = resolvePath;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
interface ExecArray extends RegExpExecArray {
|
|
2
|
+
groups?: Record<string, string> | undefined;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* 实现 Named Groups RegExp 的正则百表达式
|
|
6
|
+
* ECMA 2018 的实现
|
|
7
|
+
* 通过 new RegExp 运算符,无法被 babel 转义
|
|
8
|
+
*/
|
|
9
|
+
export default class NamedRegexp {
|
|
10
|
+
regex: RegExp;
|
|
11
|
+
groups: string[];
|
|
12
|
+
/**
|
|
13
|
+
* 创建 Named RegExp
|
|
14
|
+
* @param {object} options
|
|
15
|
+
* @param {RegExp} options.regex 正则
|
|
16
|
+
* @param {Array<String>} options.groups 分组
|
|
17
|
+
*/
|
|
18
|
+
constructor(options: {
|
|
19
|
+
regex: RegExp;
|
|
20
|
+
groups: string[];
|
|
21
|
+
});
|
|
22
|
+
exec(value: string): ExecArray | null;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* 实现 Named Groups RegExp 的正则百表达式
|
|
5
|
+
* ECMA 2018 的实现
|
|
6
|
+
* 通过 new RegExp 运算符,无法被 babel 转义
|
|
7
|
+
*/
|
|
8
|
+
class NamedRegexp {
|
|
9
|
+
/**
|
|
10
|
+
* 创建 Named RegExp
|
|
11
|
+
* @param {object} options
|
|
12
|
+
* @param {RegExp} options.regex 正则
|
|
13
|
+
* @param {Array<String>} options.groups 分组
|
|
14
|
+
*/
|
|
15
|
+
constructor(options) {
|
|
16
|
+
const { regex, groups } = options;
|
|
17
|
+
this.regex = regex;
|
|
18
|
+
this.groups = groups;
|
|
19
|
+
}
|
|
20
|
+
exec(value) {
|
|
21
|
+
const matches = this.regex.exec(value);
|
|
22
|
+
if (!matches)
|
|
23
|
+
return matches;
|
|
24
|
+
const groups = matches.reduce((result, match, index) => {
|
|
25
|
+
if (index > 0)
|
|
26
|
+
// This subtraction is required because we count
|
|
27
|
+
// match indexes from 1, because 0 is the entire matched string
|
|
28
|
+
result[this.groups[index - 1]] = match;
|
|
29
|
+
return result;
|
|
30
|
+
}, {});
|
|
31
|
+
matches.groups = groups;
|
|
32
|
+
return matches;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.default = NamedRegexp;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as NamedRegexp } from './NamedRegexp';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NamedRegexp = void 0;
|
|
7
|
+
var NamedRegexp_1 = require("./NamedRegexp");
|
|
8
|
+
Object.defineProperty(exports, "NamedRegexp", { enumerable: true, get: function () { return __importDefault(NamedRegexp_1).default; } });
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const queryStringify_1 = __importDefault(require("./queryStringify"));
|
|
7
|
+
const searchParse_1 = __importDefault(require("./searchParse"));
|
|
8
|
+
function format(attrs) {
|
|
9
|
+
const { hash = '', pathname = '', origin = '', query, search = '' } = attrs;
|
|
10
|
+
const searchQuery = (0, searchParse_1.default)(search);
|
|
11
|
+
return `${origin}${pathname}${(0, queryStringify_1.default)(Object.assign(Object.assign({}, query), searchQuery))}${hash}`;
|
|
12
|
+
}
|
|
13
|
+
exports.default = format;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import format from './format';
|
|
2
|
+
import params from './params';
|
|
3
|
+
import parse from './parse';
|
|
4
|
+
import queryStringify from './queryStringify';
|
|
5
|
+
import searchParse from './searchParse';
|
|
6
|
+
declare const queryParse: typeof searchParse;
|
|
7
|
+
export { parse, format, queryStringify, params, searchParse, queryParse };
|
|
8
|
+
declare const _default: {
|
|
9
|
+
parse: typeof parse;
|
|
10
|
+
format: typeof format;
|
|
11
|
+
queryStringify: typeof queryStringify;
|
|
12
|
+
queryParse: typeof searchParse;
|
|
13
|
+
params: typeof params;
|
|
14
|
+
searchParse: typeof searchParse;
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
package/lib/url/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.queryParse = exports.searchParse = exports.params = exports.queryStringify = exports.format = exports.parse = void 0;
|
|
7
|
+
const format_1 = __importDefault(require("./format"));
|
|
8
|
+
exports.format = format_1.default;
|
|
9
|
+
const params_1 = __importDefault(require("./params"));
|
|
10
|
+
exports.params = params_1.default;
|
|
11
|
+
const parse_1 = __importDefault(require("./parse"));
|
|
12
|
+
exports.parse = parse_1.default;
|
|
13
|
+
const queryStringify_1 = __importDefault(require("./queryStringify"));
|
|
14
|
+
exports.queryStringify = queryStringify_1.default;
|
|
15
|
+
const searchParse_1 = __importDefault(require("./searchParse"));
|
|
16
|
+
exports.searchParse = searchParse_1.default;
|
|
17
|
+
const queryParse = searchParse_1.default;
|
|
18
|
+
exports.queryParse = queryParse;
|
|
19
|
+
exports.default = {
|
|
20
|
+
parse: parse_1.default,
|
|
21
|
+
format: format_1.default,
|
|
22
|
+
queryStringify: queryStringify_1.default,
|
|
23
|
+
queryParse,
|
|
24
|
+
params: params_1.default,
|
|
25
|
+
searchParse: searchParse_1.default,
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function params(url: string, ...args: Array<Record<string, string>>): string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const merge_1 = __importDefault(require("merge"));
|
|
7
|
+
const parse_1 = __importDefault(require("./parse"));
|
|
8
|
+
const queryStringify_1 = __importDefault(require("./queryStringify"));
|
|
9
|
+
function params(url, ...args) {
|
|
10
|
+
const { query, pathname, origin, hash } = (0, parse_1.default)(url);
|
|
11
|
+
const params = (0, merge_1.default)(query, ...args); // 合并多个对象,覆盖前一个
|
|
12
|
+
return `${origin}${pathname}${(0, queryStringify_1.default)(params)}${hash}`;
|
|
13
|
+
}
|
|
14
|
+
exports.default = params;
|
package/lib/url/parse.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
const regexp_1 = require("../regexp");
|
|
18
|
+
const searchParse_1 = __importDefault(require("./searchParse"));
|
|
19
|
+
const URL_REGEX = new regexp_1.NamedRegexp({
|
|
20
|
+
regex: /(((?:http|https):)?(?:\/\/)?(([^:/?#]*)(?::(\d+))?))?([^?#]+)?(\?[^#]*)?(#.*)?/,
|
|
21
|
+
groups: ['origin', 'protocol', 'host', 'hostname', 'port', 'pathname', 'search', 'hash'],
|
|
22
|
+
});
|
|
23
|
+
function parse(href) {
|
|
24
|
+
/* istanbul ignore next */
|
|
25
|
+
const { groups = {} } = URL_REGEX.exec(href) || { groups: {} };
|
|
26
|
+
Object.keys(groups).forEach((key) => {
|
|
27
|
+
if (!groups[key]) {
|
|
28
|
+
groups[key] = '';
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
let query = {};
|
|
32
|
+
if (groups.search) {
|
|
33
|
+
query = (0, searchParse_1.default)(groups.search);
|
|
34
|
+
}
|
|
35
|
+
const { pathname } = groups, restGroups = __rest(groups, ["pathname"]);
|
|
36
|
+
return Object.assign({ query,
|
|
37
|
+
href, pathname: pathname ? pathname : '/' }, restGroups);
|
|
38
|
+
}
|
|
39
|
+
exports.default = parse;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
function queryStringify(query, options = {}) {
|
|
4
|
+
const { prefix = true } = options;
|
|
5
|
+
const search = [];
|
|
6
|
+
const keys = Object.keys(query);
|
|
7
|
+
if (keys.length === 0) {
|
|
8
|
+
return '';
|
|
9
|
+
}
|
|
10
|
+
keys.forEach((key) => {
|
|
11
|
+
const value = query[key];
|
|
12
|
+
search.push([key, value].join('='));
|
|
13
|
+
});
|
|
14
|
+
return `${prefix ? '?' : ''}${search.join('&')}`;
|
|
15
|
+
}
|
|
16
|
+
exports.default = queryStringify;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* 分割url search key value,返回 [key, value]
|
|
5
|
+
*/
|
|
6
|
+
function splitSearchKeyValue(str) {
|
|
7
|
+
const [key, ...valueArr] = str.split('=');
|
|
8
|
+
const value = valueArr.length ? valueArr.join('=') : '';
|
|
9
|
+
return [key, value];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 解析 url.search 返回对象类型
|
|
13
|
+
* @param search URL search 信息
|
|
14
|
+
*/
|
|
15
|
+
function searchParse(search) {
|
|
16
|
+
const query = {};
|
|
17
|
+
if (!search)
|
|
18
|
+
return query;
|
|
19
|
+
search = search.replace(/^\?/, ''); // 移除首字符 问号
|
|
20
|
+
search.split('&').forEach((i) => {
|
|
21
|
+
const [key, value] = splitSearchKeyValue(i);
|
|
22
|
+
query[key] = value;
|
|
23
|
+
});
|
|
24
|
+
return query;
|
|
25
|
+
}
|
|
26
|
+
exports.default = searchParse;
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ray-js/shared",
|
|
3
|
+
"version": "0.3.0-beta.1c347991",
|
|
4
|
+
"description": "Ray shared (Node Client)",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ray"
|
|
7
|
+
],
|
|
8
|
+
"author": "子长 <zichang.nong@tuya.com>",
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"main": "lib/index.js",
|
|
11
|
+
"files": [
|
|
12
|
+
"lib"
|
|
13
|
+
],
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "public",
|
|
16
|
+
"registry": "https://registry.npmjs.org"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"clean": "rm -rf lib",
|
|
20
|
+
"build": "tsc -p ./tsconfig.build.json",
|
|
21
|
+
"watch": "tsc -p ./tsconfig.build.json --watch"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@babel/preset-env": "^7.15.6",
|
|
25
|
+
"@babel/preset-typescript": "^7.15.0",
|
|
26
|
+
"@babel/register": "^7.15.3",
|
|
27
|
+
"change-case": "^4.1.2",
|
|
28
|
+
"fs-extra": "^10.0.0",
|
|
29
|
+
"merge": "^2.1.1",
|
|
30
|
+
"npmlog": "^5.0.1",
|
|
31
|
+
"slash": "3.x"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@ray-js/types": "^0.3.0-beta.1c347991",
|
|
35
|
+
"@types/fs-extra": "^9.0.12",
|
|
36
|
+
"@types/npmlog": "^4.1.3"
|
|
37
|
+
},
|
|
38
|
+
"maintainers": [
|
|
39
|
+
{
|
|
40
|
+
"name": "tuyafe",
|
|
41
|
+
"email": "tuyafe@tuya.com"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"gitHead": "e0bd013022ddda63380d3c9e20fd8cadb46cd61f",
|
|
45
|
+
"repository": {}
|
|
46
|
+
}
|