best-globals 1.0.3 → 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,12 +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
126
- var simplifiedLetters={[letter in string]:string}
127
+ var simplifiedLetters:Record<string,string>
127
128
  }
128
129
  export = bestGlobals
129
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"){
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.3",
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.11",
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
  },