JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q36186F
  • License MIT

Serializable object assertions.

Package Exports

  • @rule.js/knex

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@rule.js/knex) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Rule.js: KnexJs Module

Use your rule.js conditions with KnexJs!

Example:

const Rule = require('@rule.js/core').extend({}, {
    knex: require('@rule.js/knex')()
})

const knex = require('knex')({ client: 'pg' })

knex('user')
    .select()
    .where(function() {
        Rule().equal('name', 'Joe Pass').knex(this)
    })

Note: This module automatically converts keys to snake case. If you don't want it to do this, you can override it with:

const Rule = require('@rule.js/core').extend({}, {
    knex: require('@rule.js/knex')(function(key) { return key })
})