@kcuf/helper-data 0.0.1 → 0.1.0

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 CHANGED
@@ -1,4 +1,4 @@
1
- # @/pkg/data-normalizer
1
+ # @kcuf/helper-data
2
2
 
3
3
  将千奇百怪、随心所欲、虚头巴脑的后端数据中的字段、类型进行标准化的帮助类型及方法。
4
4
 
@@ -40,6 +40,12 @@ Object.defineProperty(exports, "normalizePagedList", {
40
40
  return _normalizePagedList.default;
41
41
  }
42
42
  });
43
+ Object.defineProperty(exports, "normalizePagedListUncertain", {
44
+ enumerable: true,
45
+ get: function get() {
46
+ return _normalizePagedListUncertain.default;
47
+ }
48
+ });
43
49
  Object.defineProperty(exports, "normalizeTime", {
44
50
  enumerable: true,
45
51
  get: function get() {
@@ -52,4 +58,5 @@ var _normalizeNumber = _interopRequireDefault(require("./normalize-number"));
52
58
  var _normalizeEnum = _interopRequireDefault(require("./normalize-enum"));
53
59
  var _normalizeTime = _interopRequireDefault(require("./normalize-time"));
54
60
  var _normalizePagedList = _interopRequireDefault(require("./normalize-paged-list"));
61
+ var _normalizePagedListUncertain = _interopRequireDefault(require("./normalize-paged-list-uncertain"));
55
62
  var _createDataWithLoading = _interopRequireDefault(require("./create-data-with-loading"));
@@ -4,5 +4,6 @@ export { default as normalizeNumber } from './normalize-number';
4
4
  export { default as normalizeEnum } from './normalize-enum';
5
5
  export { default as normalizeTime } from './normalize-time';
6
6
  export { default as normalizePagedList } from './normalize-paged-list';
7
+ export { default as normalizePagedListUncertain } from './normalize-paged-list-uncertain';
7
8
  export { default as createDataWithLoading } from './create-data-with-loading';
8
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["default","normalizeId","normalizeBoolean","normalizeNumber","normalizeEnum","normalizeTime","normalizePagedList","createDataWithLoading"],"sources":["../../../src/helper/index.ts"],"sourcesContent":["export { default as normalizeId } from './normalize-id';\nexport { default as normalizeBoolean } from './normalize-boolean';\nexport { default as normalizeNumber } from './normalize-number';\nexport { default as normalizeEnum } from './normalize-enum';\nexport { default as normalizeTime } from './normalize-time';\nexport { default as normalizePagedList } from './normalize-paged-list';\n\nexport { default as createDataWithLoading } from './create-data-with-loading';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,WAAW,QAAQ,gBAAgB;AACvD,SAASD,OAAO,IAAIE,gBAAgB,QAAQ,qBAAqB;AACjE,SAASF,OAAO,IAAIG,eAAe,QAAQ,oBAAoB;AAC/D,SAASH,OAAO,IAAII,aAAa,QAAQ,kBAAkB;AAC3D,SAASJ,OAAO,IAAIK,aAAa,QAAQ,kBAAkB;AAC3D,SAASL,OAAO,IAAIM,kBAAkB,QAAQ,wBAAwB;AAEtE,SAASN,OAAO,IAAIO,qBAAqB,QAAQ,4BAA4B","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["default","normalizeId","normalizeBoolean","normalizeNumber","normalizeEnum","normalizeTime","normalizePagedList","normalizePagedListUncertain","createDataWithLoading"],"sources":["../../../src/helper/index.ts"],"sourcesContent":["export { default as normalizeId } from './normalize-id';\nexport { default as normalizeBoolean } from './normalize-boolean';\nexport { default as normalizeNumber } from './normalize-number';\nexport { default as normalizeEnum } from './normalize-enum';\nexport { default as normalizeTime } from './normalize-time';\nexport { default as normalizePagedList } from './normalize-paged-list';\nexport { default as normalizePagedListUncertain } from './normalize-paged-list-uncertain';\n\nexport { default as createDataWithLoading } from './create-data-with-loading';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,WAAW,QAAQ,gBAAgB;AACvD,SAASD,OAAO,IAAIE,gBAAgB,QAAQ,qBAAqB;AACjE,SAASF,OAAO,IAAIG,eAAe,QAAQ,oBAAoB;AAC/D,SAASH,OAAO,IAAII,aAAa,QAAQ,kBAAkB;AAC3D,SAASJ,OAAO,IAAIK,aAAa,QAAQ,kBAAkB;AAC3D,SAASL,OAAO,IAAIM,kBAAkB,QAAQ,wBAAwB;AACtE,SAASN,OAAO,IAAIO,2BAA2B,QAAQ,kCAAkC;AAEzF,SAASP,OAAO,IAAIQ,qBAAqB,QAAQ,4BAA4B","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ELoadingStatus","LoadingStatus"],"sources":["../../src/index.ts"],"sourcesContent":["export * from './helper';\n\nexport {\n ELoadingStatus as LoadingStatus\n} from './enum';\n\nexport type {\n IBaseParamsPage as BaseParamsPage,\n IBaseParamsPageWithQ as BaseParamsPageWithQ,\n \n IBaseDataId as BaseDataId,\n IBaseDataName as BaseDataName,\n IBaseDataIdName as BaseDataIdName,\n IBaseDataTitle as BaseDataTitle,\n IBaseDataContent as BaseDataContent,\n IBaseDataTimeCreated as BaseDataTimeCreated,\n IBaseDataTimeModified as BaseDataTimeModified,\n IBaseDataTimes as BaseDataTimes,\n \n IPagedList as PagedList,\n IPagedListUncertain as PagedListUncertain,\n \n IDataWithLoading as DataWithLoading\n} from './types';\n"],"mappings":"AAAA,cAAc,UAAU;AAExB,SACEA,cAAc,IAAIC,aAAa,QAC1B,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["ELoadingStatus","LoadingStatus"],"sources":["../../src/index.ts"],"sourcesContent":["export * from './helper';\n\nexport {\n ELoadingStatus as LoadingStatus\n} from './enum';\n\nexport type {\n IBaseParamsPage as BaseParamsPage,\n IBaseParamsPageWithQ as BaseParamsPageWithQ,\n \n IBaseDataId as BaseDataId,\n IBaseDataName as BaseDataName,\n IBaseDataIdName as BaseDataIdName,\n IBaseDataTitle as BaseDataTitle,\n IBaseDataContent as BaseDataContent,\n IBaseDataTimeCreated as BaseDataTimeCreated,\n IBaseDataTimeModified as BaseDataTimeModified,\n IBaseDataTimes as BaseDataTimes,\n IBaseDataWhoCreated as BaseDataWhoCreated,\n IBaseDataWhoModified as BaseDataWhoModified,\n \n IPagedList as PagedList,\n IPagedListUncertain as PagedListUncertain,\n \n IDataWithLoading as DataWithLoading\n} from './types';\n"],"mappings":"AAAA,cAAc,UAAU;AAExB,SACEA,cAAc,IAAIC,aAAa,QAC1B,QAAQ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"base-data.js","names":[],"sources":["../../../src/types/base-data.ts"],"sourcesContent":["// 基础类型 mixin,用于继承,统一前缀 BaseData\n\n/**\n * 「ID」标准化\n */\nexport interface IBaseDataId {\n id: string;\n}\n\n/**\n * 「名称」标准化\n */\nexport interface IBaseDataName {\n name: string;\n}\n\n/**\n * 「标题」标准化\n */\nexport interface IBaseDataTitle {\n title: string;\n}\n\n/**\n * 「内容」标准化\n */\nexport interface IBaseDataContent {\n content: string;\n}\n\n/**\n * id + name\n */\nexport interface IBaseDataIdName extends IBaseDataId, IBaseDataName {}\n\n/**\n * 「创建时间」标准化\n */\nexport interface IBaseDataTimeCreated {\n timeCreated: Date;\n}\n\n/**\n * 「更新时间」标准化\n */\nexport interface IBaseDataTimeModified {\n timeModified: Date;\n}\n\n/**\n * timeCreated + timeModified\n */\nexport interface IBaseDataTimes extends IBaseDataTimeCreated, IBaseDataTimeModified {}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"base-data.js","names":[],"sources":["../../../src/types/base-data.ts"],"sourcesContent":["// 基础类型 mixin,用于继承,统一前缀 BaseData\n\n/**\n * 「ID」标准化\n */\nexport interface IBaseDataId {\n id: string;\n}\n\n/**\n * 「名称」标准化\n */\nexport interface IBaseDataName {\n name: string;\n}\n\n/**\n * 「标题」标准化\n */\nexport interface IBaseDataTitle {\n title: string;\n}\n\n/**\n * 「内容」标准化\n */\nexport interface IBaseDataContent {\n content: string;\n}\n\n/**\n * id + name\n */\nexport interface IBaseDataIdName extends IBaseDataId, IBaseDataName {}\n\n/**\n * 「创建时间」标准化\n */\nexport interface IBaseDataTimeCreated {\n timeCreated: Date;\n}\n\n/**\n * 「更新时间」标准化\n */\nexport interface IBaseDataTimeModified {\n timeModified: Date;\n}\n\n/**\n * timeCreated + timeModified\n */\nexport interface IBaseDataTimes extends IBaseDataTimeCreated, IBaseDataTimeModified {}\n\n/**\n * 「谁创建」标准化\n */\nexport interface IBaseDataWhoCreated {\n whoCreated: IBaseDataIdName;\n}\n\n/**\n * 「谁更新」标准化\n */\nexport interface IBaseDataWhoModified {\n whoModified: IBaseDataIdName;\n}\n"],"mappings":"","ignoreList":[]}
@@ -4,4 +4,5 @@ export { default as normalizeNumber } from './normalize-number';
4
4
  export { default as normalizeEnum } from './normalize-enum';
5
5
  export { default as normalizeTime } from './normalize-time';
6
6
  export { default as normalizePagedList } from './normalize-paged-list';
7
+ export { default as normalizePagedListUncertain } from './normalize-paged-list-uncertain';
7
8
  export { default as createDataWithLoading } from './create-data-with-loading';
@@ -1,3 +1,3 @@
1
1
  export * from './helper';
2
2
  export { ELoadingStatus as LoadingStatus } from './enum';
3
- export type { IBaseParamsPage as BaseParamsPage, IBaseParamsPageWithQ as BaseParamsPageWithQ, IBaseDataId as BaseDataId, IBaseDataName as BaseDataName, IBaseDataIdName as BaseDataIdName, IBaseDataTitle as BaseDataTitle, IBaseDataContent as BaseDataContent, IBaseDataTimeCreated as BaseDataTimeCreated, IBaseDataTimeModified as BaseDataTimeModified, IBaseDataTimes as BaseDataTimes, IPagedList as PagedList, IPagedListUncertain as PagedListUncertain, IDataWithLoading as DataWithLoading } from './types';
3
+ export type { IBaseParamsPage as BaseParamsPage, IBaseParamsPageWithQ as BaseParamsPageWithQ, IBaseDataId as BaseDataId, IBaseDataName as BaseDataName, IBaseDataIdName as BaseDataIdName, IBaseDataTitle as BaseDataTitle, IBaseDataContent as BaseDataContent, IBaseDataTimeCreated as BaseDataTimeCreated, IBaseDataTimeModified as BaseDataTimeModified, IBaseDataTimes as BaseDataTimes, IBaseDataWhoCreated as BaseDataWhoCreated, IBaseDataWhoModified as BaseDataWhoModified, IPagedList as PagedList, IPagedListUncertain as PagedListUncertain, IDataWithLoading as DataWithLoading } from './types';
@@ -44,3 +44,15 @@ export interface IBaseDataTimeModified {
44
44
  */
45
45
  export interface IBaseDataTimes extends IBaseDataTimeCreated, IBaseDataTimeModified {
46
46
  }
47
+ /**
48
+ * 「谁创建」标准化
49
+ */
50
+ export interface IBaseDataWhoCreated {
51
+ whoCreated: IBaseDataIdName;
52
+ }
53
+ /**
54
+ * 「谁更新」标准化
55
+ */
56
+ export interface IBaseDataWhoModified {
57
+ whoModified: IBaseDataIdName;
58
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kcuf/helper-data",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
4
4
  "description": "Data normalizer helpers and loading stuff to make all frontend data processing sane.",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -22,17 +22,17 @@
22
22
  "access": "public"
23
23
  },
24
24
  "devDependencies": {
25
- "@babel/cli": "^7.25.9",
25
+ "@babel/cli": "^7.26.4",
26
26
  "@babel/core": "^7.26.0",
27
27
  "@babel/plugin-transform-runtime": "^7.25.9",
28
28
  "@babel/preset-env": "^7.26.0",
29
29
  "@babel/preset-typescript": "^7.26.0",
30
30
  "rimraf": "^6.0.1",
31
- "typescript": "^5.6.3",
31
+ "typescript": "^5.7.2",
32
32
  "@kcuf/ts-config": "^0.0.1"
33
33
  },
34
34
  "peerDependencies": {
35
- "@babel/runtime": "^7.24.8"
35
+ "@babel/runtime": "^7.x"
36
36
  },
37
37
  "scripts": {
38
38
  "build:clean": "rimraf dist",