@clipboard-health/util-ts 0.9.0 → 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/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.10.0](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.9.1...util-ts-0.10.0) (2023-09-14)
6
+
7
+
8
+ ### Features
9
+
10
+ * add identity function to util-ts ([#314](https://github.com/ClipboardHealth/cbh-core/issues/314)) ([7ba2f98](https://github.com/ClipboardHealth/cbh-core/commit/7ba2f98db8550cef89cd9b1e8631ec6902f46058))
11
+
12
+ ## [0.9.1](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.9.0...util-ts-0.9.1) (2023-08-18)
13
+
5
14
  ## [0.9.0](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.8.0...util-ts-0.9.0) (2023-08-14)
6
15
 
7
16
 
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@clipboard-health/util-ts",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "main": "./src/index.js",
5
5
  "scripts": {
6
6
  "build": "nx build util-ts",
7
7
  "lint": "nx lint util-ts",
8
8
  "test": "nx test util-ts"
9
9
  },
10
- "types": "./src/index.d.ts"
10
+ "type": "commonjs"
11
11
  }
package/src/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export * from "./lib/cbh-response";
3
3
  export * from "./lib/defined-utils";
4
4
  export * from "./lib/force-cast";
5
5
  export * from "./lib/head";
6
+ export * from "./lib/identity";
6
7
  export * from "./lib/is-string";
7
8
  export * from "./lib/non-empty-array";
8
9
  export * from "./lib/stringify";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/util-ts/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/util-ts/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC"}
package/src/index.js CHANGED
@@ -19,6 +19,7 @@ __exportStar(require("./lib/cbh-response"), exports);
19
19
  __exportStar(require("./lib/defined-utils"), exports);
20
20
  __exportStar(require("./lib/force-cast"), exports);
21
21
  __exportStar(require("./lib/head"), exports);
22
+ __exportStar(require("./lib/identity"), exports);
22
23
  __exportStar(require("./lib/is-string"), exports);
23
24
  __exportStar(require("./lib/non-empty-array"), exports);
24
25
  __exportStar(require("./lib/stringify"), exports);
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/util-ts/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,qDAAmC;AACnC,sDAAoC;AACpC,mDAAiC;AACjC,6CAA2B;AAC3B,kDAAgC;AAChC,wDAAsC;AACtC,kDAAgC;AAChC,iDAA+B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/util-ts/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,qDAAmC;AACnC,sDAAoC;AACpC,mDAAiC;AACjC,6CAA2B;AAC3B,iDAA+B;AAC/B,kDAAgC;AAChC,wDAAsC;AACtC,kDAAgC;AAChC,iDAA+B"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * A generic function that returns its input unchanged.
3
+ * This function is useful in various functional programming scenarios, such as:
4
+ * - Creating higher-order functions like map, filter, and reduce.
5
+ * - Composing functions by providing an "identity element" in function composition.
6
+ *
7
+ * @template T - The type of the input value.
8
+ * @param {T} value - The value to return unchanged.
9
+ * @returns {T} The input value, unchanged.
10
+ */
11
+ export declare function identity<T>(value: T): T;
12
+ //# sourceMappingURL=identity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAEvC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.identity = void 0;
4
+ /**
5
+ * A generic function that returns its input unchanged.
6
+ * This function is useful in various functional programming scenarios, such as:
7
+ * - Creating higher-order functions like map, filter, and reduce.
8
+ * - Composing functions by providing an "identity element" in function composition.
9
+ *
10
+ * @template T - The type of the input value.
11
+ * @param {T} value - The value to return unchanged.
12
+ * @returns {T} The input value, unchanged.
13
+ */
14
+ function identity(value) {
15
+ return value;
16
+ }
17
+ exports.identity = identity;
18
+ //# sourceMappingURL=identity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity.js","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/identity.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;GASG;AACH,SAAgB,QAAQ,CAAI,KAAQ;IAClC,OAAO,KAAK,CAAC;AACf,CAAC;AAFD,4BAEC"}