@opfr/utils-lang 0.8.1 → 0.10.0

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/dist/index.es.js CHANGED
@@ -28,8 +28,7 @@ const Ui = (e) => new Intl.NumberFormat("de-DE").format(e), Os = (e, t, s = Math
28
28
  ), to = ({ start: e = 0, stop: t, step: s = 1 }) => {
29
29
  if (s === 0)
30
30
  throw new RangeError("step cannot be equal to 0");
31
- if (s > 0 && e >= t || s < 0 && e <= t)
32
- return [];
31
+ if (s > 0 && e >= t || s < 0 && e <= t) return [];
33
32
  const n = [];
34
33
  for (let a = e; s > 0 ? a < t : a > t; a += s)
35
34
  n.push(a);
@@ -41,10 +40,8 @@ const Ui = (e) => new Intl.NumberFormat("de-DE").format(e), Os = (e, t, s = Math
41
40
  const u = Math.abs(
42
41
  n.slice(0, i + 1).join(" ").length - n.slice(i + 1).join(" ").length
43
42
  );
44
- if (u <= a)
45
- a = u;
46
- else
47
- return i - 1;
43
+ if (u <= a) a = u;
44
+ else return i - 1;
48
45
  }
49
46
  return a;
50
47
  })(t);
@@ -1456,8 +1453,7 @@ function Nn(e, t, s) {
1456
1453
  if (typeof e == "string") {
1457
1454
  if (e = St(He, e), e === null)
1458
1455
  return this;
1459
- } else
1460
- Math.abs(e) < 16 && !s && (e = e * 60);
1456
+ } else Math.abs(e) < 16 && !s && (e = e * 60);
1461
1457
  return !this._isUTC && t && (n = tt(this)), this._offset = e, this._isUTC = !0, n != null && this.add(n, "m"), r !== e && (!t || this._changeInProgress ? ds(
1462
1458
  this,
1463
1459
  L(e - r, "m"),
@@ -2763,23 +2759,17 @@ const mo = (e) => new Date(e).toString() !== "Invalid Date", _o = (e, t) => Math
2763
2759
  if (!t)
2764
2760
  return null;
2765
2761
  const [, s, r] = t, n = parseInt(s, 10), a = 1e3 * 60;
2766
- if (r === "m")
2767
- return a * n;
2768
- if (r === "h")
2769
- return a * 60 * n;
2770
- if (r === "d")
2771
- return a * 60 * 24 * n;
2762
+ if (r === "m") return a * n;
2763
+ if (r === "h") return a * 60 * n;
2764
+ if (r === "d") return a * 60 * 24 * n;
2772
2765
  }, vo = (e) => {
2773
2766
  const t = Yt.exec(e);
2774
2767
  if (!t)
2775
2768
  return null;
2776
2769
  const [, s, r] = t, n = parseInt(s, 10);
2777
- if (r === "m")
2778
- return `${n} minute${n > 1 ? "s" : ""}`;
2779
- if (r === "h")
2780
- return `${n} heure${n > 1 ? "s" : ""}`;
2781
- if (r === "d")
2782
- return `${n} jour${n > 1 ? "s" : ""}`;
2770
+ if (r === "m") return `${n} minute${n > 1 ? "s" : ""}`;
2771
+ if (r === "h") return `${n} heure${n > 1 ? "s" : ""}`;
2772
+ if (r === "d") return `${n} jour${n > 1 ? "s" : ""}`;
2783
2773
  }, Yo = (e) => typeof e == "function", Oo = (e, t, s) => {
2784
2774
  const r = { ...e }, n = Object.entries(e);
2785
2775
  for (const [a, i] of n) {
package/dist/object.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export declare const mergeObjects: <TKey extends string, TValue>(obj1: { [key in TKey]: TValue; }, obj2: Partial<{ [key_1 in TKey]: TValue; }>, mergeFn: (v1: TValue, v2: TValue) => TValue) => { [key_2 in TKey]: TValue; };
2
2
  export declare const isObject: (obj: unknown) => obj is Object;
3
3
  export declare const filterKeys: <T, K extends keyof T>(data: T, keys: K[]) => Pick<T, K>;
4
- export declare const recordToArray: <TKey extends string, TValue>(record: Record<TKey, TValue>) => [TKey, TValue][];
4
+ export declare const recordToArray: <TKey extends string, TValue>(record: Partial<Record<TKey, TValue>>) => [TKey, TValue][];
5
5
  //# sourceMappingURL=object.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../src/object.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,6HAGT,MAAM,MAAM,MAAM,KAAK,MAAM,iCAe5C,CAAC;AAEF,eAAO,MAAM,QAAQ,QAAS,OAAO,kBAEpC,CAAC;AAEF,eAAO,MAAM,UAAU,+BACf,CAAC,QACD,CAAC,EAAE,KACR,KAAK,CAAC,EAAE,CAAC,CAQX,CAAC;AAEF,eAAO,MAAM,aAAa,wCAChB,OAAO,IAAI,EAAE,MAAM,CAAC,KAC3B,CAAC,IAAI,EAAE,MAAM,CAAC,EAAgD,CAAC"}
1
+ {"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../src/object.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,6HAGT,MAAM,MAAM,MAAM,KAAK,MAAM,iCAe5C,CAAC;AAEF,eAAO,MAAM,QAAQ,QAAS,OAAO,kBAEpC,CAAC;AAEF,eAAO,MAAM,UAAU,+BACf,CAAC,QACD,CAAC,EAAE,KACR,KAAK,CAAC,EAAE,CAAC,CAQX,CAAC;AAEF,eAAO,MAAM,aAAa,wCAChB,QAAQ,OAAO,IAAI,EAAE,MAAM,CAAC,CAAC,KACpC,CAAC,IAAI,EAAE,MAAM,CAAC,EAAgD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"object.js","sourceRoot":"","sources":["../src/object.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,IAA+B,EAC/B,IAAwC,EACxC,OAA2C,EAChB,EAAE;IAC7B,MAAM,MAAM,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC;IAC3B,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAqB,CAAC;IAE7D,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,WAAW,EAAE,CAAC;QACvC,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;QAErB,IAAI,EAAE,EAAE,CAAC;YACP,MAAM,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACnC,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACtB,CAAC;I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,GAAG,CAAC,GAAY,EAAiB,EAAE;IACtD,OAAO,GAAG,YAAY,MAAM,CAAC;AAC/B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,IAAO,EACP,IAAS,EACG,EAAE;IACd,OAAO,IAAI,CAAC,MAAM,CAChB,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QACb,GAAG,GAAG;QACN,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC;KACjB,CAAC,EACF,EAAgB,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,MAAqC,EACnB,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAqB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opfr/utils-lang",
3
- "version": "0.8.1",
3
+ "version": "0.10.0",
4
4
  "private": false,
5
5
  "description": "OPFR utils-lang",
6
6
  "author": "Matthieu VEIGA",
@@ -11,9 +11,8 @@
11
11
  "test:ci": "vitest run",
12
12
  "coverage": "vitest run --coverage"
13
13
  },
14
- "peerDependencies": {
15
- "react": "17.x || 18.x",
16
- "react-dom": "17.x || 18.x"
14
+ "dependencies": {
15
+ "moment": "2.30.1"
17
16
  },
18
17
  "main": "dist/index.umd.js",
19
18
  "module": "dist/index.es.js",
@@ -32,5 +31,5 @@
32
31
  "node_modules",
33
32
  "dist"
34
33
  ],
35
- "gitHead": "193bc2fc91cbc7a87da9e9d173ae6cedc1d65664"
34
+ "gitHead": "350da823668a4a18b5df9907999bb1b951c20fae"
36
35
  }