@esentri/transformer-functions
v0.6.0
Published
transformer functions from one data type into another
Downloads
20
Keywords
Readme
Transformer Functions
Simple functions for transforming from one data type into another.
Install
npm install @esentri/transformer-functions
yarn add @esentri/transformer-functions
Usage
Choose the needed function from the table (left = from, top = to):
| From \ To | String | HexString | ArrayBuffer | Uint8Array | Base64 | ArrayObject | |--------------|--------|-----------|-------------|------------|--------|-------------| | String | - | X | X | X | X | - | | HexString | X | - | X | X | X | - | | ArrayBuffer | X | X | - | X | X | X | | Uint8Array | X | X | X | - | X | X | | Base64 | X | X | X | X | - | - | | ArrayObject | - | - | X | X | - | - |
The corresponding method will be called:
[Type]To[Type] e.g.: StringToArrayBuffer [Type]WithBinaryDataTo[Type]: if you need to transform binary data
NOTE: String, HexString, and Base64 are all of type string. They differ in the way what they represent (and therefor in the way they are handled).
Special Types
HexString: A string that contains only hex values (e.g. 68656c6c6f20776f726c64
).
ArrayObject: An object that can be transformed to an array (e.g. {0: 10, 1: 298, 2: 233}
)
Projects used
- BSD 3-Clause
- for de/encoding from/to Base64
- License: MIT
- as a template for the setup
- JEST
- License: MIT
- Colors
- License: MIT
- Commitizen
- License: MIT
- Definitley Typed
- License: MIT
- Coveralls
- License: BSD-2-Clause
- Cross-env
- License: MIT
- cz-conventional-changelog
- License: MIT
- Husky
- License: MIT
- lint-staged
- License: MIT
- lodash.camelcase
- License: MIT
- Prompt
- License: MIT
- replace-in-file
- License: MIT
- rimraf
- License: ISC
- rollup
- License: MIT
- semantic-release
- License: MIT
- tslint
- License: Apache-2.0
- typedoc
- License: Apache-2.0
- typescript
- License: Apache-2.0
- validate-commit-msg
- License: MIT
License
MIT License
Copyright (c) 2018 esentri AG
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.