mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-29 16:57:00 +08:00
json.dump appears to add extraneous spaces before newline characters. By specifying the separators option, we can remove these whitespaces, reducing the diff noise. Solution taken from https://stackoverflow.com/questions/16311562/python-json-without-whitespaces DISABLE_THIRD_PARTY_CHECK=Fix whitespace in node_modules Change-Id: I26556e5053f19a9021ad41779319bdfe3f8c2b6c Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2013154 Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org> Commit-Queue: Mathias Bynens <mathias@chromium.org> Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org> Reviewed-by: Mathias Bynens <mathias@chromium.org>
Buffer Alloc Unsafe
A ponyfill for Buffer.allocUnsafe.
Works as Node.js: v7.0.0
Works on Node.js: v0.10.0
Installation
npm install --save buffer-alloc-unsafe
Usage
const allocUnsafe = require('buffer-alloc-unsafe')
console.log(allocUnsafe(10))
//=> <Buffer 78 0c 80 03 01 00 00 00 05 00>
console.log(allocUnsafe(10))
//=> <Buffer 58 ed bf 5f ff 7f 00 00 01 00>
console.log(allocUnsafe(10))
//=> <Buffer 50 0c 80 03 01 00 00 00 0a 00>
allocUnsafe(-10)
//=> RangeError: "size" argument must not be negative
API
allocUnsafe(size)
size<Integer> The desired length of the newBuffer
Allocates a new non-zero-filled Buffer of size bytes. The size must be
less than or equal to the value of buffer.kMaxLength and greater than or equal
to zero. Otherwise, a RangeError is thrown.
See also
- buffer-alloc A ponyfill for
Buffer.alloc - buffer-fill A ponyfill for
Buffer.fill - buffer-from A ponyfill for
Buffer.from