This content moved here: https://exploringjs.com/impatient-js/ch_arrays.html#quickref-arrays
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Jest Conversion script | |
| * This script isn't the cleanest, and uses two different methods for performing global replaces... but it gets the job done. | |
| * We switched from using the `replace` method to the `advancedReplace` about 70% of the way through, and couldn't go and retrofit | |
| * `advancedReplace` everywhere with 100% confidence. However, should you use this script as a base for your own migration, | |
| * I would definitely suggest using `advancedReplace`, which uses the node-replace library. | |
| */ | |
| import {sync as globSync} from 'glob' | |
| import {execSync} from 'child_process' | |
| import fs from 'fs' |
Note:
When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.
If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:
- Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async function getKey(passphrase, salt = null) { | |
| passphrase = (new TextEncoder()).encode(passphrase); | |
| let digest = await crypto.subtle.digest({ name: 'SHA-256' }, passphrase); | |
| let keyMaterial = await crypto.subtle.importKey( | |
| 'raw', | |
| digest, | |
| { name: 'PBKDF2' }, | |
| false, | |
| ['deriveKey'] | |
| ); |
OlderNewer