@onivoro/isomorphic-common 0.0.11 → 0.0.13
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 +1 -1
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/index.js.map +1 -1
- package/src/lib/functions/from-calendar-date.function.d.ts +1 -2
- package/src/lib/functions/from-calendar-date.function.js +4 -1
- package/src/lib/functions/from-calendar-date.function.js.map +1 -1
- package/src/lib/functions/to-decimal-base.function.d.ts +1 -0
- package/src/lib/functions/to-decimal-base.function.js +23 -0
- package/src/lib/functions/to-decimal-base.function.js.map +1 -0
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from './lib/functions/subtract-offset.function';
|
|
|
15
15
|
export * from './lib/functions/to-boolean-string.function';
|
|
16
16
|
export * from './lib/functions/to-calendar-date.function';
|
|
17
17
|
export * from './lib/functions/to-csv-string.function';
|
|
18
|
+
export * from './lib/functions/to-decimal-base.function';
|
|
18
19
|
export * from './lib/functions/to-locale-date-string.function';
|
|
19
20
|
export * from './lib/functions/to-locale-time-string.function';
|
|
20
21
|
export * from './lib/functions/to-unique-array.function';
|
package/src/index.js
CHANGED
|
@@ -18,6 +18,7 @@ tslib_1.__exportStar(require("./lib/functions/subtract-offset.function"), export
|
|
|
18
18
|
tslib_1.__exportStar(require("./lib/functions/to-boolean-string.function"), exports);
|
|
19
19
|
tslib_1.__exportStar(require("./lib/functions/to-calendar-date.function"), exports);
|
|
20
20
|
tslib_1.__exportStar(require("./lib/functions/to-csv-string.function"), exports);
|
|
21
|
+
tslib_1.__exportStar(require("./lib/functions/to-decimal-base.function"), exports);
|
|
21
22
|
tslib_1.__exportStar(require("./lib/functions/to-locale-date-string.function"), exports);
|
|
22
23
|
tslib_1.__exportStar(require("./lib/functions/to-locale-time-string.function"), exports);
|
|
23
24
|
tslib_1.__exportStar(require("./lib/functions/to-unique-array.function"), exports);
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/isomorphic-common/src/index.ts"],"names":[],"mappings":";;;AAAA,kFAAwD;AACxD,mFAAyD;AACzD,qFAA2D;AAE3D,8EAAoD;AACpD,8EAAoD;AACpD,6FAAmE;AACnE,uFAA6D;AAC7D,sFAA4D;AAC5D,mFAAyD;AACzD,8EAAoD;AACpD,uFAA6D;AAC7D,qFAA2D;AAC3D,8EAAoD;AACpD,mFAAyD;AACzD,qFAA2D;AAC3D,oFAA0D;AAC1D,iFAAuD;AACvD,yFAA+D;AAC/D,yFAA+D;AAC/D,mFAAyD;AACzD,kFAAwD;AACxD,8EAAoD;AACpD,+EAAqD;AACrD,yEAA+C;AAE/C,kGAAwE;AACxE,qFAA2D;AAC3D,wEAA8C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/isomorphic-common/src/index.ts"],"names":[],"mappings":";;;AAAA,kFAAwD;AACxD,mFAAyD;AACzD,qFAA2D;AAE3D,8EAAoD;AACpD,8EAAoD;AACpD,6FAAmE;AACnE,uFAA6D;AAC7D,sFAA4D;AAC5D,mFAAyD;AACzD,8EAAoD;AACpD,uFAA6D;AAC7D,qFAA2D;AAC3D,8EAAoD;AACpD,mFAAyD;AACzD,qFAA2D;AAC3D,oFAA0D;AAC1D,iFAAuD;AACvD,mFAAyD;AACzD,yFAA+D;AAC/D,yFAA+D;AAC/D,mFAAyD;AACzD,kFAAwD;AACxD,8EAAoD;AACpD,+EAAqD;AACrD,yEAA+C;AAE/C,kGAAwE;AACxE,qFAA2D;AAC3D,wEAA8C"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const fromCalendarDate: typeof addOffset;
|
|
1
|
+
export declare function fromCalendarDate(input: string | Date | undefined | null): Date | null;
|
|
@@ -2,5 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.fromCalendarDate = void 0;
|
|
4
4
|
const add_offset_function_1 = require("./add-offset.function");
|
|
5
|
-
|
|
5
|
+
function fromCalendarDate(input) {
|
|
6
|
+
return (0, add_offset_function_1.addOffset)(input) || null;
|
|
7
|
+
}
|
|
8
|
+
exports.fromCalendarDate = fromCalendarDate;
|
|
6
9
|
//# sourceMappingURL=from-calendar-date.function.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"from-calendar-date.function.js","sourceRoot":"","sources":["../../../../../../libs/isomorphic-common/src/lib/functions/from-calendar-date.function.ts"],"names":[],"mappings":";;;AAAA,+DAAkD;
|
|
1
|
+
{"version":3,"file":"from-calendar-date.function.js","sourceRoot":"","sources":["../../../../../../libs/isomorphic-common/src/lib/functions/from-calendar-date.function.ts"],"names":[],"mappings":";;;AAAA,+DAAkD;AAElD,SAAgB,gBAAgB,CAAC,KAAuC;IACpE,OAAO,IAAA,+BAAS,EAAC,KAAK,CAAC,IAAI,IAAI,CAAC;AACpC,CAAC;AAFD,4CAEC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function toDecimalBase(n: string | number, base?: number): number;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toDecimalBase = void 0;
|
|
4
|
+
function toDecimalBase(n, base = 16) {
|
|
5
|
+
const digits = n.toString().split('');
|
|
6
|
+
let answer = 0;
|
|
7
|
+
digits.reverse().forEach(function (d, i) {
|
|
8
|
+
let actualNumber = Number(d);
|
|
9
|
+
if (!actualNumber && actualNumber !== 0) {
|
|
10
|
+
const codeAt = d.charCodeAt(0);
|
|
11
|
+
if (codeAt >= 97) {
|
|
12
|
+
actualNumber = codeAt - 87;
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
actualNumber = codeAt - 55;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
answer = answer + actualNumber * Math.pow(base, i);
|
|
19
|
+
});
|
|
20
|
+
return answer;
|
|
21
|
+
}
|
|
22
|
+
exports.toDecimalBase = toDecimalBase;
|
|
23
|
+
//# sourceMappingURL=to-decimal-base.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-decimal-base.function.js","sourceRoot":"","sources":["../../../../../../libs/isomorphic-common/src/lib/functions/to-decimal-base.function.ts"],"names":[],"mappings":";;;AAAA,SAAgB,aAAa,CAAC,CAAkB,EAAE,IAAI,GAAG,EAAE;IACvD,MAAM,MAAM,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAEtC,IAAI,MAAM,GAAG,CAAC,CAAC;IAEf,MAAM,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QACnC,IAAI,YAAY,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QAE7B,IAAI,CAAC,YAAY,IAAI,YAAY,KAAK,CAAC,EAAE;YACrC,MAAM,MAAM,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAE/B,IAAI,MAAM,IAAI,EAAE,EAAE;gBACd,YAAY,GAAG,MAAM,GAAG,EAAE,CAAC;aAC9B;iBAAM;gBACH,YAAY,GAAG,MAAM,GAAG,EAAE,CAAC;aAC9B;SACJ;QAED,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAClB,CAAC;AAtBD,sCAsBC"}
|