1.4.1 • Published 5 years ago

jsonql-utils v1.4.1

Weekly downloads
2
License
ISC
Repository
-
Last release
5 years ago

jsonql-utils

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

Please check jsonql 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

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.

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

ISC

Joel Chu (c) 2020

1.4.1

5 years ago

1.4.0

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.3

5 years ago

1.1.1

5 years ago

1.1.2

5 years ago

1.1.0

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.9.7

5 years ago

0.9.6

5 years ago

0.9.5

5 years ago

0.9.4

5 years ago

0.9.3

5 years ago

0.9.2

5 years ago

0.9.1

5 years ago

0.9.0

5 years ago

0.8.11

5 years ago

0.8.10

5 years ago

0.8.9

5 years ago

0.8.8

5 years ago

0.8.7

5 years ago

0.8.6

5 years ago

0.8.5

5 years ago

0.8.4

5 years ago

0.8.3

5 years ago

0.8.2

5 years ago

0.8.1

5 years ago

0.8.0

5 years ago

0.7.8

5 years ago

0.7.7

5 years ago

0.7.6

5 years ago

0.7.5

5 years ago

0.7.4

5 years ago

0.7.3

5 years ago

0.7.2

5 years ago

0.7.1

5 years ago

0.7.0

5 years ago

0.6.12

5 years ago

0.6.11

5 years ago

0.6.10

5 years ago

0.6.8

5 years ago

0.6.7

5 years ago

0.6.6

5 years ago

0.6.5

5 years ago

0.6.4

5 years ago

0.6.3

5 years ago

0.6.2

5 years ago

0.6.1

5 years ago

0.6.0

5 years ago

0.5.2

5 years ago

0.5.1

5 years ago

0.5.0

5 years ago

0.4.10

5 years ago

0.4.9

5 years ago

0.4.8

5 years ago

0.4.7

5 years ago

0.4.6

5 years ago

0.4.5

5 years ago

0.4.4

5 years ago

0.4.3

5 years ago

0.4.2

5 years ago

0.4.0

5 years ago

0.3.15

5 years ago

0.3.14

5 years ago

0.3.13

5 years ago

0.3.12

5 years ago

0.3.11

5 years ago

0.3.10

5 years ago

0.3.9

5 years ago

0.3.8

5 years ago

0.3.7

5 years ago

0.3.6

5 years ago

0.3.5

5 years ago

0.3.4

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago