# misc-utils-of-mine-generic

> Miscellaneous utilities for JavaScript/TypeScript that I often use

Latest version **0.2.45** (published 2022-10-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install misc-utils-of-mine-generic
pnpm add misc-utils-of-mine-generic
yarn add misc-utils-of-mine-generic
bun add misc-utils-of-mine-generic
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.45 |
| Published | 2022-10-13 |
| First published | 2019-02-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 385 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Sebastián Gurin |
| Maintainers | cancerberosgx |
| Keywords | JavaScript, TypeScript, utilities, miscellaneous |

## Links

- npm: https://www.npmjs.com/package/misc-utils-of-mine-generic
- Repository: https://github.com/cancerberoSgx/misc-utils-of-mine
- Homepage: https://github.com/cancerberoSgx/misc-utils-of-mine#readme
- Issues: https://github.com/cancerberoSgx/misc-utils-of-mine/issues
- npm.io page: https://npm.io/package/misc-utils-of-mine-generic

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.2.45 (latest) — 2022-10-13
- 0.2.44 — 2022-10-13
- 0.2.43 — 2022-06-09
- 0.2.42 — 2022-05-23
- 0.2.41 — 2022-05-23
- 0.2.40 — 2022-03-07
- 0.2.39 — 2021-11-27
- 0.2.38 — 2021-11-03
- 0.2.37 — 2020-08-09
- 0.2.36 — 2020-08-09
- 0.2.35 — 2019-10-05
- 0.2.34 — 2019-09-22
- 0.2.33 — 2019-09-22
- 0.2.32 — 2019-09-15
- 0.2.31 — 2019-09-14
- … 46 more at https://npm.io/package/misc-utils-of-mine-generic/versions

## README

Big collection of miscellaneous utilities, compatible with browser and node.js

These should work on all es5 compatible environments, Browse and node.js and even others like rhino, etc, since are pure JavaScript.

## API

 [API](api/README.md)

## TODO
- [ ] string/boxes : drawBox({pos: Point, lines:String[], padding: {top,right,bottom,left}})
- [ ] test visitJson
  - [ ] impl findJson, filterJson 
- [x] test tree.ts
- [x] objectToArray
- [x] Deferred test



<!-- 
  ### ideas


// an operation OP is expensive and we want to print: `${OP(a) && OP(a).foo || '' }` - we need to create a variable in order to not call it twice
// solution : a function get which : `${get(OP(a), 'foo')||'' }`
// useful if nested: `${get(OP(a), 'foo', 'bar', 'name')||'' }`
// for particular falsy (we do want to print 0 and false): `${get(OP(a), 'foo', 'bar', v=>v===undefined?'':v)}` (will print empty string only for undefined not for all falsy)
 -->

<!-- 
// function prop<T,S>(o:T, p:keyof T, map: S|((k:keyof T)=>S)):S {
//   var v = o[p]
// }

// function valueOf<T, P extends keyof T, D>(t:T,p:P, def:D, pred?: (v: T[P])=>boolean):T[P]|D {
// return (pred?pred(t[p]) : true ) 
// }
// an operation OP is expensive and we want to print: `${OP(a) && OP(a).foo || '' }` - we need to create a variable in order to not call it twice
// solution : a function get which : `${get(OP(a), 'foo')||'' }`
// useful if nested: `${get(OP(a), 'foo', 'bar', 'name')||'' }`
// for particular falsy (we do want to print 0 and false): `${get(OP(a), 'foo', 'bar', v=>v===undefined?'':v)}` (will print empty string only for undefined not for all falsy)

// var a: {name:B}[]

// a.map(b=>b.name)   vs: a.map(P('name'))n 

// a.map(a=>a.name||'asd')  vs a.map(P('name', 'asd'))  -->

---
_Source: https://npm.io/package/misc-utils-of-mine-generic · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
