best-globals 1.1.2 → 1.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/best-globals.d.ts CHANGED
@@ -59,6 +59,13 @@ declare module "best-globals"{
59
59
  toYmdHmsM():string
60
60
  toYmdHmsMm():string
61
61
  }
62
+ interface TimePack{
63
+ ms :number
64
+ seconds:number
65
+ minutes:number
66
+ hours :number
67
+ days :number
68
+ }
62
69
  class DateTime implements DateMethods{
63
70
  toPlainString():string
64
71
  toLocaleString():string
@@ -107,6 +114,7 @@ declare module "best-globals"{
107
114
  function iso(IsoString:string):TimeInterval
108
115
  function iso(IsoString:string|null, opts:TimeOpts):TimeInterval|null
109
116
  }
117
+ function timeInterval(timePack:TimePack):TimeInterval
110
118
  function functionName(f:Function):string
111
119
  function constructorName<T extends {}>(o:T):string
112
120
  function escapeRegExp(regExpString:string):string // minimalistic
@@ -125,6 +133,7 @@ declare module "best-globals"{
125
133
  function simplifyText(text:string):string
126
134
  function hyperSimplifyText(text:string, spaceReplacer?:string):string
127
135
  var simplifiedLetters:Record<string,string>
136
+ function splitRawRowIntoRow(text:string):string[]
128
137
  }
129
138
  export = bestGlobals
130
139
  }
package/best-globals.js CHANGED
@@ -1123,6 +1123,13 @@ bestGlobals.simplifyText = function simplifyText(text){
1123
1123
  bestGlobals.hyperSimplifyText = function hyperSimplifyText(text, spaceReplacer){
1124
1124
  return text.replace(/[^A-Za-z0-9\[\] ]/g,function(a){return bestGlobals.simplifiedChars[a]||' '}).trim().replace(/\s+/g,spaceReplacer==undefined?' ':spaceReplacer).toLowerCase();
1125
1125
  }
1126
+ bestGlobals.splitRawRowIntoRow = function splitRawRowIntoRow(line){
1127
+ return line.split(/(?<!(?:^|[^\\])(?:\\\\)*\\)\|/).map(item => item.trimRight().replace(
1128
+ /\\([^x]|x[\dA-Za-z]{1,2})/g,
1129
+ (_,l)=>(l=='t'?'\t':l=='r'?'\r':l=='n'?'\n':l=='s'?' ':l[0]=='x'?String.fromCodePoint(parseInt(l.substr(1),16)):l)
1130
+ ))
1131
+ }
1132
+
1126
1133
 
1127
1134
  return bestGlobals;
1128
1135
 
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.2",
4
+ "version": "1.1.3",
5
5
  "author": "Codenautas <codenautas@googlegroups.com>",
6
6
  "license": "MIT",
7
7
  "repository": "codenautas/best-globals",
@@ -20,19 +20,19 @@
20
20
  "colors": "~1.4.0",
21
21
  "cookie-parser": "^1.4.6",
22
22
  "expect.js": "~0.3.1",
23
- "express": "^4.18.2",
24
- "express-session": "^1.17.3",
25
- "karma": "^6.4.2",
23
+ "express": "^4.18.3",
24
+ "express-session": "^1.18.0",
25
+ "karma": "^6.4.3",
26
26
  "karma-chrome-launcher": "^3.2.0",
27
- "karma-coverage": "^2.2.0",
27
+ "karma-coverage": "^2.2.1",
28
28
  "karma-coverage-html-index-reporter": "^1.0.2",
29
29
  "karma-expect": "^1.1.3",
30
- "karma-firefox-launcher": "^2.1.2",
30
+ "karma-firefox-launcher": "^2.1.3",
31
31
  "karma-mocha": "^2.0.1",
32
32
  "nyc": "~15.1.0",
33
- "mocha": "~10.2.0",
33
+ "mocha": "~10.3.0",
34
34
  "require-bro": "^0.3.1",
35
- "sinon": "~15.1.0",
35
+ "sinon": "~17.0.1",
36
36
  "audit-copy": "~0.1.0",
37
37
  "discrepances": "~0.2.8"
38
38
  },