Comparing version 1.15.23 to 1.15.24
{ | ||
"name": "3xpr", | ||
"version": "1.15.23", | ||
"version": "1.15.24", | ||
"description": "expressions", | ||
@@ -5,0 +5,0 @@ "author": "Flavio Lionel Rita <flaviolrita@hotmail.com>", |
@@ -107,2 +107,31 @@ # 3xpr | ||
## Extend | ||
You can extend the library by adding enums, constants, formats, operators, and functions. | ||
To do this, use the following functions: | ||
- **AddConstant**: Adds a constant to the library. | ||
- **AddEnum**: Adds an enumeration to the library. | ||
- **AddFormat**: Adds a format to the library. | ||
- **AddOperator**: Adds an operator to the library. | ||
- **AddFunction**: Adds a function to the library. | ||
### Example | ||
```typescript | ||
import { expressions as exp } from '3xpr' | ||
const CryptoJS = require('crypto-js') | ||
exp.addFunction( | ||
'encrypt(value:string):string', | ||
(value: string, key:string):string => CryptoJS.AES.encrypt(value, key).toString(), | ||
{ description: 'Encrypt a string' } | ||
) | ||
exp.addFunction( | ||
'decrypt(value:string):string', | ||
(value: string, key:string):string => CryptoJS.AES.decrypt(value, key).toString(CryptoJS.enc.Utf8), | ||
{ description: 'Decrypt a string' } | ||
) | ||
``` | ||
## Related projects | ||
@@ -109,0 +138,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
513853
145