1.0.4 • Published 10 months ago

@adriantombu/salesforce-convert-id v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Salesforce Convert ID

npm version npm.io

Before the Salesforce API v2.5 we had both formats of ID lengths which can sometimes lead to some problems. This library aims to converts a 15 character Salesforce ID to a 18 characters Salesforce ID to address this issue.

How to use it

  • Install the library first with yarn add @adriantombu/salesforce-convert-id
  • And then import it in your script
const { salesforceConvertId } = require('@adriantombu/salesforce-convert-id')

const smallId = 'a0i1t000002i0p0';
const longId = salesforceConvertId(smallId)

'a0i1t000002i0p0AAA'

In case of an invalid ID, we juste send it back with no warning as this is not the purpose of this library

const { salesforceConvertId } = require('@adriantombu/salesforce-convert-id')

const aWrongId = 'badid';
const longId = salesforceConvertId(aWrongId)

'badid'

How to contribute

  • Clone the repository git clone git@github.com:adriantombu/salesforce-convert-id.git
  • Install the packages with yarn install
  • Modify the src/index.ts file
  • When everything's done, you can send a PR \o/
1.0.4

10 months ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago