best-globals 1.0.2 → 1.0.4

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
@@ -118,11 +118,13 @@ declare module "best-globals"{
118
118
  function serie(first:number, length:number):number[]
119
119
  function serie(spec:{from?:number, step?:number, to:number}):number[]
120
120
  function serie(spec:{from?:number, step?:number, length:number}):number[]
121
- function sameValues(x:any, y:any):boolean
121
+ function sameValue<T>(x:T, y:T):boolean
122
+ function sameValues<T>(x:T, y:T):boolean
122
123
  function isLowerIdent(text:string):boolean
123
124
  function deepFreeze<T extends {}>(o:T):Readonly<T>
124
125
  function simplifyText(text:string):string
125
126
  function hyperSimplifyText(text:string, spaceReplacer?:string):string
127
+ var simplifiedLetters:Record<string,string>
126
128
  }
127
129
  export = bestGlobals
128
130
  }
package/best-globals.js CHANGED
@@ -963,11 +963,13 @@ bestGlobals.sameValue = function sameValue(a,b){
963
963
  return a==b ||
964
964
  a instanceof Date && b instanceof Date && a.getTime() == b.getTime() ||
965
965
  typeof a === 'number' && (a>MAX_SAFE_INTEGER || a< -MAX_SAFE_INTEGER) && Math.abs(a/b)<1.00000000000001 && Math.abs(a/b)>0.99999999999999 ||
966
- a && !!a.sameValue && a.sameValue(b);
966
+ a !=null && !!a.sameValue && a.sameValue(b);
967
967
  }
968
968
 
969
969
  bestGlobals.sameValues = function sameValues(a,b, sideOfBigger){
970
970
  if(a===b) return true;
971
+ if(bestGlobals.sameValue(a,b)) return true;
972
+ if(!(a instanceof Object) || !(b instanceof Object)) return false;
971
973
  if(sideOfBigger=="left"){
972
974
  return bestGlobals.sameValues(b,a,"right");
973
975
  }else if(sideOfBigger=="right"){
@@ -1010,7 +1012,7 @@ bestGlobals.escapeStringRegexp = function escapeStringRegexp(string) {
1010
1012
  .replace(/-/g, '\\x2d');
1011
1013
  }
1012
1014
 
1013
- bestGlobals.simplifiedChars={
1015
+ bestGlobals.simplifiedLetters={
1014
1016
  "\u00a0":" ",
1015
1017
  "Á":"A","Ă":"A","Ắ":"A","Ặ":"A","Ằ":"A","Ẳ":"A","Ẵ":"A","Ǎ":"A","Â":"A","Ấ":"A","Ậ":"A","Ầ":"A","Ẩ":"A","Ẫ":"A","Ä":"A","Ǟ":"A","Ȧ":"A","Ǡ":"A","Ạ":"A","Ȁ":"A","À":"A","Ả":"A","Ȃ":"A","Ā":"A","Ą":"A","Å":"A","Ǻ":"A","Ḁ":"A","Ⱥ":"A","Ã":"A",
1016
1018
  "Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY",
@@ -1027,7 +1029,7 @@ bestGlobals.simplifiedChars={
1027
1029
  "Ḱ":"K","Ǩ":"K","Ķ":"K","Ⱪ":"K","Ꝃ":"K","Ḳ":"K","Ƙ":"K","Ḵ":"K","Ꝁ":"K","Ꝅ":"K",
1028
1030
  "Ĺ":"L","Ƚ":"L","Ľ":"L","Ļ":"L","Ḽ":"L","Ḷ":"L","Ḹ":"L","Ⱡ":"L","Ꝉ":"L","Ḻ":"L","Ŀ":"L","Ɫ":"L","Lj":"L","Ł":"L","LJ":"LJ",
1029
1031
  "Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M",
1030
- "Ń":"N","Ň":"N","Ņ":"N","Ṋ":"N","Ṅ":"N","Ṇ":"N","Ǹ":"N","Ɲ":"N","Ṉ":"N","Ƞ":"N","Nj":"N","Ñ":"N","NJ":"NJ",
1032
+ "Ń":"N","Ň":"N","Ņ":"N","Ṋ":"N","Ṅ":"N","Ṇ":"N","Ǹ":"N","Ɲ":"N","Ṉ":"N","Ƞ":"N","Nj":"Nj","Ñ":"N","NJ":"NJ",
1031
1033
  "Ó":"O","Ŏ":"O","Ǒ":"O","Ô":"O","Ố":"O","Ộ":"O","Ồ":"O","Ổ":"O","Ỗ":"O","Ö":"O","Ȫ":"O","Ȯ":"O","Ȱ":"O","Ọ":"O","Ő":"O","Ȍ":"O","Ò":"O","Ỏ":"O","Ơ":"O","Ớ":"O","Ợ":"O","Ờ":"O","Ở":"O","Ỡ":"O","Ȏ":"O","Ꝋ":"O","Ꝍ":"O","Ō":"O","Ṓ":"O","Ṑ":"O","Ɵ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Õ":"O","Ṍ":"O","Ṏ":"O","Ȭ":"O","Ƣ":"OI","Ꝏ":"OO","Ɛ":"E","Ɔ":"O","Ȣ":"OU",
1032
1034
  "Ṕ":"P","Ṗ":"P","Ꝓ":"P","Ƥ":"P","Ꝕ":"P","Ᵽ":"P","Ꝑ":"P",
1033
1035
  "Ꝙ":"Q","Ꝗ":"Q",
@@ -1073,6 +1075,8 @@ bestGlobals.simplifiedChars={
1073
1075
  "ff":"ff","ffi":"ffi","ffl":"ffl","fi":"fi","fl":"fl","ij":"ij","œ":"oe","st":"st",
1074
1076
  "ₐ":"a","ₑ":"e","ᵢ":"i","ⱼ":"j","ₒ":"o","ᵣ":"r","ᵤ":"u","ᵥ":"v","ₓ":"x"
1075
1077
  };
1078
+ bestGlobals.simplifiedChars=bestGlobals.simplifiedLetters;
1079
+
1076
1080
  bestGlobals.simplifyText = function simplifyText(text){
1077
1081
  return text.replace(/[^A-Za-z0-9\[\] ]/g,function(a){return bestGlobals.simplifiedChars[a]||a});
1078
1082
  }
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. coalesce",
4
- "version": "1.0.2",
4
+ "version": "1.0.4",
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.17.2",
24
- "express-session": "^1.17.2",
25
- "karma": "^6.3.9",
26
- "karma-chrome-launcher": "^3.1.0",
27
- "karma-coverage": "^2.1.0",
23
+ "express": "^4.18.2",
24
+ "express-session": "^1.17.3",
25
+ "karma": "^6.4.1",
26
+ "karma-chrome-launcher": "^3.1.1",
27
+ "karma-coverage": "^2.2.0",
28
28
  "karma-coverage-html-index-reporter": "^1.0.2",
29
29
  "karma-expect": "^1.1.3",
30
30
  "karma-firefox-launcher": "^2.1.2",
31
31
  "karma-mocha": "^2.0.1",
32
32
  "nyc": "~15.1.0",
33
- "mocha": "~9.1.3",
33
+ "mocha": "~10.2.0",
34
34
  "require-bro": "^0.3.0",
35
- "sinon": "~12.0.1",
35
+ "sinon": "~15.0.1",
36
36
  "audit-copy": "~0.1.0",
37
37
  "discrepances": "~0.2.6"
38
38
  },