JSPM

soql-escape

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

A template library to escape soql queries

Package Exports

  • soql-escape
  • soql-escape/src/index.js

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 (soql-escape) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

soql-escape

Escape soql queries

Installation

npm i soql-escape

or with yarn

yarn add soql-escape

Usage

const { soql } = require('soql-escape')

Query with characters to escape:

soql`SELECT foo FROM Bar WHERE str = ${unEscapedString}`

Query using a date:

soql`
    SELECT id, CreatedDate
    FROM Sales_Order__c
    WHERE CreatedDate < ${new Date('2013-05-21T00:00:00Z')}
`

It is also possible to import the escape function directly:

const { escape } = require('soql-escape')

assert(escape('"quotes\'') === `'\\"quotes\\''`)

Contributing

Fork this repo and create a pull-request.