@fastcar/core 0.2.58 → 0.2.60

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fastcar/core",
3
- "version": "0.2.58",
3
+ "version": "0.2.60",
4
4
  "homepage": "https://github.com/williamDazhangyu/fast-car",
5
5
  "main": "target/index.js",
6
6
  "author": "william_zhong",
@@ -1,22 +1,26 @@
1
+ import "reflect-metadata";
1
2
  import * as path from "path";
2
3
  import * as fs from "fs";
3
4
  import { FastCarMetaData } from "../../constant/FastCarMetaData";
4
5
 
5
- export default function ComponentScanMust(target: any, ...names: string[]) {
6
- let ScanPathList = FastCarMetaData.ComponentScanMust;
7
- let list: string[] = Reflect.get(target.prototype, ScanPathList) || [];
6
+ //和本包的相对路径
7
+ export default function ComponentScanMust(...names: string[]) {
8
+ return function (target: any) {
9
+ let scanMust = FastCarMetaData.ComponentScanMust;
10
+ let list: string[] = Reflect.get(target.prototype, scanMust) || [];
8
11
 
9
- for (let name of names) {
10
- //可支持绝对路径
11
- let p = path.join(require.main?.path || process.cwd() || "", name);
12
- if (fs.existsSync(name)) {
13
- p = name;
14
- }
12
+ for (let name of names) {
13
+ //可支持绝对路径
14
+ let p = path.join(require.main?.path || process.cwd() || "", name);
15
+ if (fs.existsSync(name)) {
16
+ p = name;
17
+ }
15
18
 
16
- if (!list.includes(p)) {
17
- list.push(p);
19
+ if (!list.includes(p)) {
20
+ list.push(p);
21
+ }
18
22
  }
19
- }
20
23
 
21
- Reflect.set(target.prototype, ScanPathList, list);
24
+ Reflect.set(target.prototype, scanMust, list);
25
+ };
22
26
  }
package/src/db.ts CHANGED
@@ -23,6 +23,7 @@ export enum OperatorEnum {
23
23
  export enum JoinEnum {
24
24
  and = "AND",
25
25
  or = "OR",
26
+ not = "NOT",
26
27
  }
27
28
 
28
29
  export enum OrderEnum {
@@ -1,21 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ require("reflect-metadata");
3
4
  const path = require("path");
4
5
  const fs = require("fs");
5
6
  const FastCarMetaData_1 = require("../../constant/FastCarMetaData");
6
- function ComponentScanMust(target, ...names) {
7
- let ScanPathList = FastCarMetaData_1.FastCarMetaData.ComponentScanMust;
8
- let list = Reflect.get(target.prototype, ScanPathList) || [];
9
- for (let name of names) {
10
- //可支持绝对路径
11
- let p = path.join(require.main?.path || process.cwd() || "", name);
12
- if (fs.existsSync(name)) {
13
- p = name;
7
+ //和本包的相对路径
8
+ function ComponentScanMust(...names) {
9
+ return function (target) {
10
+ let scanMust = FastCarMetaData_1.FastCarMetaData.ComponentScanMust;
11
+ let list = Reflect.get(target.prototype, scanMust) || [];
12
+ for (let name of names) {
13
+ //可支持绝对路径
14
+ let p = path.join(require.main?.path || process.cwd() || "", name);
15
+ if (fs.existsSync(name)) {
16
+ p = name;
17
+ }
18
+ if (!list.includes(p)) {
19
+ list.push(p);
20
+ }
14
21
  }
15
- if (!list.includes(p)) {
16
- list.push(p);
17
- }
18
- }
19
- Reflect.set(target.prototype, ScanPathList, list);
22
+ Reflect.set(target.prototype, scanMust, list);
23
+ };
20
24
  }
21
25
  exports.default = ComponentScanMust;