@stryke/helpers 0.5.3 → 0.6.1

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/README.md CHANGED
@@ -22,15 +22,10 @@ This package is part of Storm Software's **đŸŒŠī¸ Stryke** monorepo. Stryke pac
22
22
 
23
23
  <h3 align="center">đŸ’ģ Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
24
24
 
25
- [![Version](https://img.shields.io/badge/version-0.5.2-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/stryke/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
26
-
27
- > [!IMPORTANT] This repository, and the apps, libraries, and tools contained
28
- > within, is still in it's initial development phase. As a result, bugs and
29
- > issues are expected with it's usage. When the main development phase
30
- > completes, a proper release will be performed, the packages will be availible
31
- > through NPM (and other distributions), and this message will be removed.
32
- > However, in the meantime, please feel free to report any issues you may come
33
- > across.
25
+ [![Version](https://img.shields.io/badge/version-0.6.0-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/stryke/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
26
+
27
+ > [!IMPORTANT] Important
28
+ > This repository, and the apps, libraries, and tools contained within, is still in it's initial development phase. As a result, bugs and issues are expected with it's usage. When the main development phase completes, a proper release will be performed, the packages will be available through NPM (and other distributions), and this message will be removed. However, in the meantime, please feel free to report any issues you may come across.
34
29
 
35
30
  <div align="center">
36
31
  <b>Be sure to ⭐ this repository on <a href="https://github.com/storm-software/stryke" target="_blank">GitHub</a> so you can keep up to date on any daily progress!</b>
package/dist/index.cjs CHANGED
@@ -168,6 +168,28 @@ Object.keys(_noop).forEach(function (key) {
168
168
  }
169
169
  });
170
170
  });
171
+ var _omit = require("./omit.cjs");
172
+ Object.keys(_omit).forEach(function (key) {
173
+ if (key === "default" || key === "__esModule") return;
174
+ if (key in exports && exports[key] === _omit[key]) return;
175
+ Object.defineProperty(exports, key, {
176
+ enumerable: true,
177
+ get: function () {
178
+ return _omit[key];
179
+ }
180
+ });
181
+ });
182
+ var _pick = require("./pick.cjs");
183
+ Object.keys(_pick).forEach(function (key) {
184
+ if (key === "default" || key === "__esModule") return;
185
+ if (key in exports && exports[key] === _pick[key]) return;
186
+ Object.defineProperty(exports, key, {
187
+ enumerable: true,
188
+ get: function () {
189
+ return _pick[key];
190
+ }
191
+ });
192
+ });
171
193
  var _removeAccents = require("./remove-accents.cjs");
172
194
  Object.keys(_removeAccents).forEach(function (key) {
173
195
  if (key === "default" || key === "__esModule") return;
package/dist/index.d.ts CHANGED
@@ -13,6 +13,8 @@ export * from "./is-equal";
13
13
  export * from "./match-sorter";
14
14
  export * from "./mutex";
15
15
  export * from "./noop";
16
+ export * from "./omit";
17
+ export * from "./pick";
16
18
  export * from "./remove-accents";
17
19
  export * from "./remove-empty-items";
18
20
  export * from "./semaphore";
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- export*from"./arg-identity";export*from"./debounce";export*from"./deep-clone";export*from"./deep-merge";export*from"./delay";export*from"./filter-empty";export*from"./flatten-object";export*from"./get-field";export*from"./get-ordered-by";export*from"./get-unique";export*from"./identity";export*from"./is-equal";export*from"./match-sorter";export*from"./mutex";export*from"./noop";export*from"./remove-accents";export*from"./remove-empty-items";export*from"./semaphore";export*from"./set-field";export*from"./throttle";export*from"./timeout";export*from"./to-deep-key";export*from"./to-path";export*from"./unflatten-object";export*from"./union";export*from"./with-timeout";
1
+ export*from"./arg-identity";export*from"./debounce";export*from"./deep-clone";export*from"./deep-merge";export*from"./delay";export*from"./filter-empty";export*from"./flatten-object";export*from"./get-field";export*from"./get-ordered-by";export*from"./get-unique";export*from"./identity";export*from"./is-equal";export*from"./match-sorter";export*from"./mutex";export*from"./noop";export*from"./omit";export*from"./pick";export*from"./remove-accents";export*from"./remove-empty-items";export*from"./semaphore";export*from"./set-field";export*from"./throttle";export*from"./timeout";export*from"./to-deep-key";export*from"./to-path";export*from"./unflatten-object";export*from"./union";export*from"./with-timeout";
package/dist/omit.cjs ADDED
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.omit = omit;
7
+ function omit(r, t) {
8
+ const n = {
9
+ ...r
10
+ };
11
+ for (let e = 0; e < t.length; e++) {
12
+ const o = t[e];
13
+ o && delete n[o];
14
+ }
15
+ return n;
16
+ }
package/dist/omit.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Creates a new object with specified keys omitted.
3
+ *
4
+ * This function takes an object and an array of keys, and returns a new object that
5
+ * excludes the properties corresponding to the specified keys.
6
+ *
7
+ * @param obj - The object to omit keys from.
8
+ * @param keys - An array of keys to be omitted from the object.
9
+ * @returns A new object with the specified keys omitted.
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * const obj = { a: 1, b: 2, c: 3 };
14
+ * const result = omit(obj, ['b', 'c']);
15
+ * // result will be { a: 1 }
16
+ * ```
17
+ */
18
+ export declare function omit<T extends Record<string, any>, K extends keyof T>(obj: T, keys: readonly K[]): Omit<T, K>;
package/dist/omit.mjs ADDED
@@ -0,0 +1 @@
1
+ export function omit(r,t){const n={...r};for(let e=0;e<t.length;e++){const o=t[e];o&&delete n[o]}return n}
package/dist/pick.cjs ADDED
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.pick = pick;
7
+ function pick(t, c) {
8
+ const r = {};
9
+ for (let n = 0; n < c.length; n++) {
10
+ const e = c[n];
11
+ e && Object.hasOwn(t, e) && (r[e] = t[e]);
12
+ }
13
+ return r;
14
+ }
package/dist/pick.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Creates a new object composed of the picked object properties.
3
+ *
4
+ * This function takes an object and an array of keys, and returns a new object that
5
+ * includes only the properties corresponding to the specified keys.
6
+ *
7
+ * @param obj - The object to pick keys from.
8
+ * @param keys - An array of keys to be picked from the object.
9
+ * @returns A new object with the specified keys picked.
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * const obj = { a: 1, b: 2, c: 3 };
14
+ * const result = pick(obj, ['a', 'c']);
15
+ * // result will be { a: 1, c: 3 }
16
+ * ```
17
+ */
18
+ export declare function pick<T extends Record<string, any>, K extends keyof T>(obj: T, keys: readonly K[]): Pick<T, K>;
package/dist/pick.mjs ADDED
@@ -0,0 +1 @@
1
+ export function pick(t,c){const r={};for(let n=0;n<c.length;n++){const e=c[n];e&&Object.hasOwn(t,e)&&(r[e]=t[e])}return r}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stryke/helpers",
3
- "version": "0.5.3",
3
+ "version": "0.6.1",
4
4
  "type": "module",
5
5
  "description": "A package containing miscellaneous helper functions that are used across many different Storm Software projects.",
6
6
  "repository": {
@@ -11,9 +11,9 @@
11
11
  "private": false,
12
12
  "publishConfig": { "access": "public" },
13
13
  "dependencies": {
14
- "@stryke/convert": "^0.1.5",
15
- "@stryke/type-checks": "^0.3.2",
16
- "@stryke/types": "^0.8.1"
14
+ "@stryke/convert": "^0.2.1",
15
+ "@stryke/type-checks": "^0.3.3",
16
+ "@stryke/types": "^0.8.3"
17
17
  },
18
18
  "devDependencies": {},
19
19
  "sideEffects": false,
@@ -207,6 +207,16 @@
207
207
  "default": "./dist/remove-accents.mjs"
208
208
  }
209
209
  },
210
+ "./pick": {
211
+ "import": { "types": "./dist/pick.d.ts", "default": "./dist/pick.mjs" },
212
+ "require": { "types": "./dist/pick.d.ts", "default": "./dist/pick.cjs" },
213
+ "default": { "types": "./dist/pick.d.ts", "default": "./dist/pick.mjs" }
214
+ },
215
+ "./omit": {
216
+ "import": { "types": "./dist/omit.d.ts", "default": "./dist/omit.mjs" },
217
+ "require": { "types": "./dist/omit.d.ts", "default": "./dist/omit.cjs" },
218
+ "default": { "types": "./dist/omit.d.ts", "default": "./dist/omit.mjs" }
219
+ },
210
220
  "./noop": {
211
221
  "import": { "types": "./dist/noop.d.ts", "default": "./dist/noop.mjs" },
212
222
  "require": { "types": "./dist/noop.d.ts", "default": "./dist/noop.cjs" },