0.0.5 • Published 1 year ago
soql-escape v0.0.5
soql-escape
Escape soql queries
Installation
npm i soql-escapeor with yarn
yarn add soql-escapeUsage
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.