
Research
/Security News
Chrome and Firefox Extensions Posing as Free VPNs Add Clipboard Stealers via Malicious Updates
Malicious Chrome and Firefox extensions posed as free VPNs while stealing clipboard data through later extension updates.
This library is used to transform dialed strings. It's useful when for example you need to prepend, append, change, or remove a given string to a number before issuing a VoIP call (or when receiving the call).
Add this library to your package.json configuration:
"dependencies": {
"dialrules": "latest"
}
var dialrules = require('dialrules');
var result = dialrules.translate(dialedString, rules);
See below to know how the rules variable should be formed. The result
variable is an object that contains the information for the matched rules and
final result.
The rule JSON Object is documented in the source code for
index.js.
All rules have the following fields:
condition.replace.true, no further rules will be matched if this one matches.value to the dialed string.value to the dialed string.condition_pattern by value.last to avoid matching
further rules.condition_pattern from the dialed string.Below you will find a few examples for the most common usage. More examples can be found in the tests.
Let's say your US carrier will send you US numbers without the leading 1 and
international numbers with a 011 and you want to transform any of those into
E.164:
[
{
condition: 'length',
description: 'for US numbers prepend 1',
condition_pattern: '10',
action: 'prepend',
value: '1',
last: true
},
{
condition: 'starts_with',
description: 'for Intl numbers remove the US intl prefix',
condition_pattern: '011',
action: 'remove',
last: true
}
]
Now let's say that you have a carrier that allows you to choose the route quality by appending a string. You might want to use a specific route for all calls to Argentina:
[
{
condition: 'starts_with',
description: 'Append route to Argentina',
condition_pattern: '54',
action: 'append',
value: '#999#15'
}
]
The exact opposite can be achieved by this
[
{
condition: 'ends_with',
description: 'Removes route suffix',
condition_pattern: '#999#15',
action: 'remove'
}
]
[
{
condition: 'exact_match',
description: 'Changes phone number',
condition_pattern: '12223334444',
value: '15556667777'
action: 'replace'
}
]
This project uses standard npm scripts. Current tasks include:
To run a task, just do:
npm run build
To contribute:
npm run build and make sure everything is ok before submitting the pull
request (make eslint happy).The source code is released under Apache 2 License.
Check LICENSE file for more information.
FAQs
A library to bill telephone calls
We found that dialrules demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Malicious Chrome and Firefox extensions posed as free VPNs while stealing clipboard data through later extension updates.

Research
/Security News
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.

Security News
Rolldown paused Rust React Compiler integration after a 5MB binary size increase raised concerns about shipping React-specific code to all Vite users.