best-globals 1.1.3 → 1.1.5
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/best-globals.d.ts +2 -2
- package/best-globals.js +11 -6
- package/package.json +7 -5
package/best-globals.d.ts
CHANGED
|
@@ -32,8 +32,8 @@ declare module "best-globals"{
|
|
|
32
32
|
}):ChangingOptions
|
|
33
33
|
}
|
|
34
34
|
class RealDate extends Date implements DateMethods{
|
|
35
|
-
add(ti:TimeInterval):RealDate
|
|
36
|
-
sub(ti:TimeInterval):RealDate
|
|
35
|
+
add(ti:TimeInterval|{days:number}):RealDate
|
|
36
|
+
sub(ti:TimeInterval|{days:number}):RealDate
|
|
37
37
|
sub(d:RealDate):TimeInterval
|
|
38
38
|
sameValue(ti:RealDate):boolean
|
|
39
39
|
toDmy():string
|
package/best-globals.js
CHANGED
|
@@ -493,11 +493,14 @@ bestGlobals.Datetime.prototype.toPlainString = function toPlainString(preserveHm
|
|
|
493
493
|
}
|
|
494
494
|
// bestGlobals.Datetime.prototype.toUTCString = function toUTCString(){ return this.iso; }
|
|
495
495
|
|
|
496
|
-
bestGlobals.Datetime.prototype.
|
|
496
|
+
bestGlobals.Datetime.prototype.toSqlString = function toSqlString(){
|
|
497
497
|
return this.toPlainString();
|
|
498
498
|
}
|
|
499
499
|
|
|
500
|
-
bestGlobals.Datetime.prototype.
|
|
500
|
+
bestGlobals.Datetime.prototype.toPostgres = bestGlobals.Datetime.prototype.toSqlString;
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
bestGlobals.Datetime.prototype.toLocaleString = function toSqlString(){
|
|
501
504
|
var str=this.toDmy()+' '+this.toHms();
|
|
502
505
|
var prune = function(what){
|
|
503
506
|
if(str.substr(str.length-what.length)==what){
|
|
@@ -692,10 +695,12 @@ bestGlobals.TimeInterval.prototype.toHmsOrMs = function toHmsOrMs(){
|
|
|
692
695
|
return this.toHms(false,false,false,true,true);
|
|
693
696
|
}
|
|
694
697
|
|
|
695
|
-
bestGlobals.TimeInterval.prototype.
|
|
698
|
+
bestGlobals.TimeInterval.prototype.toSqlString = function toSqlString(){
|
|
696
699
|
return this.timeInterval.ms+'ms';
|
|
697
700
|
}
|
|
698
701
|
|
|
702
|
+
bestGlobals.TimeInterval.prototype.toPostgres = bestGlobals.TimeInterval.prototype.toSqlString;
|
|
703
|
+
|
|
699
704
|
bestGlobals.timeInterval = function timeInterval(timePack) {
|
|
700
705
|
return new bestGlobals.TimeInterval(timePack);
|
|
701
706
|
};
|
|
@@ -780,8 +785,8 @@ bestGlobals.forOrder = function forOrder(text){
|
|
|
780
785
|
var normal=text.toString()
|
|
781
786
|
.replace(letterTranslatorRegexp, function(letter){ return letterTranslator[letter]; })
|
|
782
787
|
.replace(
|
|
783
|
-
/([a-z]+)|((-?)0*(0|[1-9][0-9]*)
|
|
784
|
-
function(t, letters, nums, sign, integer,
|
|
788
|
+
/([a-z]+)|((-?)0*(0|[1-9][0-9]*))|([^a-z0-9])/ig,
|
|
789
|
+
function(t, letters, nums, sign, integer, others){
|
|
785
790
|
if(letters){
|
|
786
791
|
main.push(' '+letters.toLowerCase());
|
|
787
792
|
}
|
|
@@ -794,7 +799,7 @@ bestGlobals.forOrder = function forOrder(text){
|
|
|
794
799
|
}else{
|
|
795
800
|
negative = false;
|
|
796
801
|
}
|
|
797
|
-
main.push(' '+(negative?'A':'')+String.fromCharCode(65+coalesce(integer,'').length)+coalesce(integer,'')
|
|
802
|
+
main.push(' '+(negative?'A':'')+String.fromCharCode(65+coalesce(integer,'').length)+coalesce(integer,''));
|
|
798
803
|
}
|
|
799
804
|
canBeNegative=false;
|
|
800
805
|
if(others){
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "best-globals",
|
|
3
3
|
"description": "common global function and constants - i.e. changes",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.5",
|
|
5
5
|
"author": "Codenautas <codenautas@googlegroups.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": "codenautas/best-globals",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"colors": "~1.4.0",
|
|
21
21
|
"cookie-parser": "^1.4.6",
|
|
22
22
|
"expect.js": "~0.3.1",
|
|
23
|
-
"express": "^4.
|
|
23
|
+
"express": "^4.19.2",
|
|
24
24
|
"express-session": "^1.18.0",
|
|
25
25
|
"karma": "^6.4.3",
|
|
26
26
|
"karma-chrome-launcher": "^3.2.0",
|
|
@@ -29,10 +29,12 @@
|
|
|
29
29
|
"karma-expect": "^1.1.3",
|
|
30
30
|
"karma-firefox-launcher": "^2.1.3",
|
|
31
31
|
"karma-mocha": "^2.0.1",
|
|
32
|
-
"nyc": "~
|
|
33
|
-
"
|
|
32
|
+
"nyc": "~17.0.0",
|
|
33
|
+
"mini-tools": "^1.12.1",
|
|
34
|
+
"mocha": "~10.4.0",
|
|
35
|
+
"pg-promise-strict": "^1.4.0",
|
|
34
36
|
"require-bro": "^0.3.1",
|
|
35
|
-
"sinon": "~
|
|
37
|
+
"sinon": "~18.0.0",
|
|
36
38
|
"audit-copy": "~0.1.0",
|
|
37
39
|
"discrepances": "~0.2.8"
|
|
38
40
|
},
|