You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
752 B

4 years ago
  1. # to-fast-properties [![Build Status](https://travis-ci.org/sindresorhus/to-fast-properties.svg?branch=master)](https://travis-ci.org/sindresorhus/to-fast-properties)
  2. > Force V8 to use fast properties for an object
  3. [Read more.](http://stackoverflow.com/questions/24987896/)
  4. Use `%HasFastProperties(object)` and `--allow-natives-syntax` to check whether an object already has fast properties.
  5. ## Install
  6. ```
  7. $ npm install --save to-fast-properties
  8. ```
  9. ## Usage
  10. ```js
  11. const toFastProperties = require('to-fast-properties');
  12. const obj = {
  13. foo: true,
  14. bar: true
  15. };
  16. delete obj.foo;
  17. // `obj` now has slow properties
  18. toFastProperties(obj);
  19. // `obj` now has fast properties
  20. ```
  21. ## License
  22. MIT © Petka Antonov, John-David Dalton, Sindre Sorhus