@solar-kit/planets 2.1.1 → 2.1.3
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/earth/utils/weight.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare function parseWeight(value: number, unitId: number): number;
|
|
|
8
8
|
* 解析各种重量为克
|
|
9
9
|
* @param gram
|
|
10
10
|
* @param unitId
|
|
11
|
-
* @deprecated Use {@link
|
|
11
|
+
* @deprecated Use {@link parseWeight} instead
|
|
12
12
|
*/
|
|
13
13
|
export declare const normalizedGram: typeof parseWeight;
|
|
14
14
|
/**
|
|
@@ -26,8 +26,3 @@ export declare const WeightUnit: {
|
|
|
26
26
|
readonly SimaJin: 447;
|
|
27
27
|
};
|
|
28
28
|
export type WeightUnit = typeof WeightUnit[keyof typeof WeightUnit];
|
|
29
|
-
export declare const WeightChannel: {
|
|
30
|
-
readonly Weight: 29;
|
|
31
|
-
readonly Quantity: 31;
|
|
32
|
-
};
|
|
33
|
-
export type WeightChannel = typeof WeightChannel[keyof typeof WeightChannel];
|
package/earth/utils/weight.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jinToGram, kiloToGram, simaJinToGram, toJin, toKilo, toSimaJin } from '@solar-kit/core';
|
|
1
|
+
import { jinToGram, kiloToGram, simaJinToGram, toJin, toKilo, toPrecision, toSimaJin } from '@solar-kit/core';
|
|
2
2
|
/**
|
|
3
3
|
* 解析各种重量为克
|
|
4
4
|
* @param value
|
|
@@ -16,7 +16,7 @@ export function parseWeight(value, unitId) {
|
|
|
16
16
|
* 解析各种重量为克
|
|
17
17
|
* @param gram
|
|
18
18
|
* @param unitId
|
|
19
|
-
* @deprecated Use {@link
|
|
19
|
+
* @deprecated Use {@link parseWeight} instead
|
|
20
20
|
*/
|
|
21
21
|
export const normalizedGram = parseWeight;
|
|
22
22
|
/**
|
|
@@ -30,7 +30,7 @@ export function formatWeight(gram, unitId) {
|
|
|
30
30
|
return (_a = {
|
|
31
31
|
[221]: toKilo(gram),
|
|
32
32
|
[222]: toJin(gram),
|
|
33
|
-
[292]: gram,
|
|
33
|
+
[292]: toPrecision(gram, 2),
|
|
34
34
|
[447]: toSimaJin(gram),
|
|
35
35
|
}[unitId]) !== null && _a !== void 0 ? _a : gram;
|
|
36
36
|
}
|
|
@@ -41,8 +41,4 @@ export const WeightUnit = {
|
|
|
41
41
|
Jin: 222,
|
|
42
42
|
SimaJin: 447
|
|
43
43
|
};
|
|
44
|
-
export const WeightChannel = {
|
|
45
|
-
Weight: 29,
|
|
46
|
-
Quantity: 31,
|
|
47
|
-
};
|
|
48
44
|
//# sourceMappingURL=weight.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"weight.js","sourceRoot":"","sources":["../../../../../packages/planets/src/earth/utils/weight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"weight.js","sourceRoot":"","sources":["../../../../../packages/planets/src/earth/utils/weight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE9G;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,KAAa,EAAE,MAAc;IACvD,OAAO;QACL,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC;QACxB,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC;QACvB,CAAC,GAAG,CAAC,EAAE,KAAK;QACZ,CAAC,GAAG,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC;KAC5B,CAAC,MAAM,CAAE,CAAC;AACb,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,MAAc;;IACvD,OAAO,MAAA;QACL,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC;QACnB,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC;QAClB,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;QAC3B,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC;KACvB,CAAC,MAAM,CAAC,mCAAI,IAAI,CAAC;AACpB,CAAC;AAED,WAAW;AACX,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,QAAQ,EAAE,GAAG;IACb,IAAI,EAAE,GAAG;IACT,GAAG,EAAE,GAAG;IACR,OAAO,EAAE,GAAG;CACJ,CAAC"}
|