项目原始demo,不改动
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
Questo repository è archiviato. Puoi vedere i file e clonarli, ma non puoi effettuare richieste di pushj o aprire problemi/richieste di pull.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. [![npm][npm]][npm-url]
  2. [![node][node]][node-url]
  3. [![deps][deps]][deps-url]
  4. [![test][test]][test-url]
  5. [![coverage][cover]][cover-url]
  6. [![chat][chat]][chat-url]
  7. <div align="center">
  8. <a href="http://json-schema.org">
  9. <!-- src="https://webpack-contrib.github.io/schema-utils/logo.png" -->
  10. <img width="180" height="180"
  11. src="https://raw.githubusercontent.com/json-schema-org/json-schema-org.github.io/master/img/logo.png">
  12. </a>
  13. <a href="https://github.com/webpack/webpack">
  14. <img width="200" height="200" hspace="10"
  15. src="https://webpack.js.org/assets/icon-square-big.svg">
  16. </a>
  17. <h1>Schema Utils</h1>
  18. </div>
  19. <h2 align="center">Install</h2>
  20. ```bash
  21. npm install --save schema-utils
  22. ```
  23. <h2 align="center">Usage</h2>
  24. ### `validateOptions`
  25. ```js
  26. import validateOptions from 'schema-utils'
  27. validateOptions('path/to/schema.json', options, 'Loader/Plugin Name')
  28. ```
  29. <h2 align="center">Examples</h2>
  30. ### Loader
  31. ```js
  32. import { getOptions } from 'loader-utils'
  33. import validateOptions from 'schema-utils'
  34. function loader (src, map) {
  35. const options = getOptions(this) || {}
  36. validateOptions('path/to/schema.json', options, 'Loader Name')
  37. }
  38. ```
  39. ### Plugin
  40. ```js
  41. import Tapable from 'tapable'
  42. import validateOptions from 'schema-utils'
  43. class Plugin extends Tapable {
  44. constructor (options) {
  45. validateOptions('path/to/schema.json', options, 'Plugin Name')
  46. }
  47. }
  48. ```
  49. <h2 align="center">Maintainers</h2>
  50. <table>
  51. <tbody>
  52. <tr>
  53. <td align="center">
  54. <img width="150" height="150"
  55. src="https://github.com/bebraw.png?v=3&s=150">
  56. </br>
  57. <a href="https://github.com/bebraw">Juho Vepsäläinen</a>
  58. </td>
  59. <td align="center">
  60. <img width="150" height="150"
  61. src="https://github.com/d3viant0ne.png?v=3&s=150">
  62. </br>
  63. <a href="https://github.com/d3viant0ne">Joshua Wiens</a>
  64. </td>
  65. <td align="center">
  66. <img width="150" height="150"
  67. src="https://github.com/michael-ciniawsky.png?v=3&s=150">
  68. </br>
  69. <a href="https://github.com/michael-ciniawsky">Michael Ciniawsky</a>
  70. </td>
  71. </tr>
  72. <tbody>
  73. </table>
  74. [npm]: https://img.shields.io/npm/v/schema-utils.svg
  75. [npm-url]: https://npmjs.com/package/schema-utils
  76. [node]: https://img.shields.io/node/v/schema-utils.svg
  77. [node-url]: https://nodejs.org
  78. [deps]: https://david-dm.org/webpack-contrib/schema-utils.svg
  79. [deps-url]: https://david-dm.org/webpack-contrib/schema-utils
  80. [test]: http://img.shields.io/travis/webpack-contrib/schema-utils.svg
  81. [test-url]: https://travis-ci.org/webpack-contrib/schema-utils
  82. [cover]: https://codecov.io/gh/webpack-contrib/schema-utils/branch/master/graph/badge.svg
  83. [cover-url]: https://codecov.io/gh/webpack-contrib/schema-utils
  84. [chat]: https://img.shields.io/badge/gitter-webpack%2Fwebpack-brightgreen.svg
  85. [chat-url]: https://gitter.im/webpack/webpack