# jsonql-utils

> This is a jsonql dependency module, not for generate use.

Latest version **1.4.1** (published 2020-04-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install jsonql-utils
pnpm add jsonql-utils
yarn add jsonql-utils
bun add jsonql-utils
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.1 |
| Published | 2020-04-18 |
| First published | 2019-09-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 100.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Joel Chu |
| Maintainers | joelchu |
| Keywords | jsonql, utils |

## Links

- npm: https://www.npmjs.com/package/jsonql-utils
- Repository: https://gitee.com:to1source/jsonql
- Homepage: http://jsonql.org
- Issues: https://gitee.com/to1source/jsonql/issues
- npm.io page: https://npm.io/package/jsonql-utils

## Dependencies (2)

- [jsonql-errors](https://npm.io/package/jsonql-errors.md) ^1.2.1
- [jsonql-constants](https://npm.io/package/jsonql-constants.md) ^2.1.3

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.4.1 (latest) — 2020-04-18
- 1.4.0 — 2020-04-17
- 1.3.2 — 2020-04-17
- 1.3.1 — 2020-04-17
- 1.3.0 — 2020-04-17
- 1.2.7 — 2020-04-04
- 1.2.6 — 2020-03-25
- 1.2.5 — 2020-03-22
- 1.2.4 — 2020-03-18
- 1.2.3 — 2020-03-17
- 1.2.2 — 2020-03-17
- 1.2.1 — 2020-03-16
- 1.2.0 — 2020-03-15
- 1.1.3 — 2020-03-12
- 1.1.2 — 2020-03-12
- … 83 more at https://npm.io/package/jsonql-utils/versions

## README

# jsonql-utils

> This is a dependency module for various jsonql node / browser modules. Not intend to use directly

Please check [jsonql](https://jsonql.js.org) for more information.

## complete list of all available functions

When use with build tool, for better tree shaking. You need to import them directly.
Please reference which functions in what file below

### Browser and node.js

#### src/chain-fns.js

- chainFns

#### src/chain-promises.js

- chainPromises
- chainProcessPromises

#### src/contract.js

- checkIsContract
- isContract (alias to checkIsContract but when it's true return the contract itself)
- extractSocketPart
- groupByNamespace
- getNamespaceInOrder
- extractArgsFromPayload
- extractParamsFromContract

#### src/timestamp.js

- timestamp

#### src/dasherize.js

- dasherize

#### src/urls.js

- urlParams
- cacheBurstUrl
- cacheBurst

#### src/generic.js

- inArray
- toArray
- parse
- isObjectHasKey
- createEvt
- getConfigValue
- toJson
- isNotEmpty
- isFunc
- nil (placeholder function always return false)
- assign (alias to Object.assign)
- freeze (alias to Object.freeze)

#### src/logger.js

- logger (wrapper for console.log to use in browser, set `window.DEBUG=true` then it will show)

#### src/obj-define-props.js

- objDefineProps
- objHasProp
- injectToFn

#### src/params-api.js

- toPayload
- formatPayload
- getNameFromPayload
- createDeliverable
- createQuery
- createQueryStr
- createMutation
- createMutationStr
- getQueryFromArgs
- processPayload
- getQueryFromPayload
- getMutationFromArgs
- getMutationFromPayload

#### src/results.js

- getCallMethod
- packResult
- isJsonqlErrorObj
- packError
- resultHandler

### For node.js only

### src/jsonql-handler.js

- isJsonqlPath
- isJsonqlRequest
- isJsonqlConsoleUrl

#### src/node-error.js

- replaceErrors
- printError

#### src/node-find-from-contract.js

- findFromContract

#### src/node-koa.js

- handleOutput
- handleHtmlOutput
- ctxErrorHandler
- forbiddenHandler

#### src/node-middleware.js

- getDocLen
- headerParser
- isHeaderPresent
- getPathToFn


## Breaking change (0.6.4)

The `module` now only export the browser used modules. The `main` field comes with everything including all the node.js one.

For browser package, you want to do this

```js
import { chainFns } from 'jsonql-utils/module'
```

But this doesn't help with the tree shaking (Tree shaking is a total lie anyway). So you might want to
import like what it show in the above section.

For node/cjs then just do it like you normally would.

```js

const { chainFns } = require('jsonql-utils')

```

---

ISC

Joel Chu (c) 2020

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