Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
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.

readme.md 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. # camelcase-keys [![Build Status](https://travis-ci.org/sindresorhus/camelcase-keys.svg?branch=master)](https://travis-ci.org/sindresorhus/camelcase-keys)
  2. > Convert object keys to camel case using [`camelcase`](https://github.com/sindresorhus/camelcase)
  3. ## Install
  4. ```
  5. $ npm install camelcase-keys
  6. ```
  7. ## Usage
  8. ```js
  9. const camelcaseKeys = require('camelcase-keys');
  10. // Convert an object
  11. camelcaseKeys({'foo-bar': true});
  12. //=> {fooBar: true}
  13. // Convert an array of objects
  14. camelcaseKeys([{'foo-bar': true}, {'bar-foo': false}]);
  15. //=> [{fooBar: true}, {barFoo: false}]
  16. camelcaseKeys({'foo-bar': true, nested: {unicorn_rainbow: true}}, {deep: true});
  17. //=> {fooBar: true, nested: {unicornRainbow: true}}
  18. camelcaseKeys({a_b: 1, a_c: {c_d: 1, c_e: {e_f: 1}}}, {deep: true, stopPaths: ['a_c.c_e']}),
  19. //=> {aB: 1, aC: {cD: 1, cE: {e_f: 1}}}
  20. // Convert object keys to pascal case
  21. camelcaseKeys({'foo-bar': true, nested: {unicorn_rainbow: true}}, {deep: true, pascalCase: true});
  22. //=> {FooBar: true, Nested: {UnicornRainbow: true}}
  23. ```
  24. ```js
  25. const camelcaseKeys = require('camelcase-keys');
  26. const argv = require('minimist')(process.argv.slice(2));
  27. //=> {_: [], 'foo-bar': true}
  28. camelcaseKeys(argv);
  29. //=> {_: [], fooBar: true}
  30. ```
  31. ## API
  32. ### camelcaseKeys(input, options?)
  33. #### input
  34. Type: `object | object[]`
  35. An object or array of objects to camel-case.
  36. #### options
  37. Type: `object`
  38. ##### exclude
  39. Type: `Array<string | RegExp>`\
  40. Default: `[]`
  41. Exclude keys from being camel-cased.
  42. ##### stopPaths
  43. Type: `string[]`\
  44. Default: `[]`
  45. Exclude children at the given object paths in dot-notation from being camel-cased. For example, with an object like `{a: {b: '🦄'}}`, the object path to reach the unicorn is `'a.b'`.
  46. ```js
  47. camelcaseKeys({
  48. a_b: 1,
  49. a_c: {
  50. c_d: 1,
  51. c_e: {
  52. e_f: 1
  53. }
  54. }
  55. }, {
  56. deep: true,
  57. stopPaths: [
  58. 'a_c.c_e'
  59. ]
  60. }),
  61. /*
  62. {
  63. aB: 1,
  64. aC: {
  65. cD: 1,
  66. cE: {
  67. e_f: 1
  68. }
  69. }
  70. }
  71. */
  72. ```
  73. ##### deep
  74. Type: `boolean`\
  75. Default: `false`
  76. Recurse nested objects and objects in arrays.
  77. ##### pascalCase
  78. Type: `boolean`\
  79. Default: `false`
  80. Uppercase the first character as in `bye-bye` → `ByeBye`.
  81. ## camelcase-keys for enterprise
  82. Available as part of the Tidelift Subscription.
  83. The maintainers of camelcase-keys and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-camelcase-keys?utm_source=npm-camelcase-keys&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
  84. ## Related
  85. - [snakecase-keys](https://github.com/bendrucker/snakecase-keys)
  86. - [kebabcase-keys](https://github.com/mattiloh/kebabcase-keys)