epuber-stylus-source 0.54.8 → 0.56.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (465) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -1
  3. data/Rakefile +1 -1
  4. data/VERSION +1 -1
  5. data/vendor/{History.md → Changelog.md} +50 -0
  6. data/vendor/Readme.md +37 -23
  7. data/vendor/bin/stylus +1 -2
  8. data/vendor/lib/convert/css.js +1 -1
  9. data/vendor/lib/functions/acos.js +20 -0
  10. data/vendor/lib/functions/asin.js +21 -0
  11. data/vendor/lib/functions/atan.js +21 -0
  12. data/vendor/lib/functions/convert-angle.js +19 -0
  13. data/vendor/lib/functions/index.js +3 -0
  14. data/vendor/lib/functions/url.js +5 -5
  15. data/vendor/lib/lexer.js +1 -1
  16. data/vendor/lib/middleware.js +1 -2
  17. data/vendor/lib/visitor/compiler.js +2 -2
  18. data/vendor/lib/visitor/deps-resolver.js +3 -0
  19. data/vendor/node_modules/{cliui/node_modules/ansi-regex → ansi-regex}/index.d.ts +0 -0
  20. data/vendor/node_modules/ansi-regex/index.js +4 -4
  21. data/vendor/node_modules/ansi-regex/package.json +53 -51
  22. data/vendor/node_modules/ansi-regex/readme.md +35 -3
  23. data/vendor/node_modules/assertion-error/History.md +24 -0
  24. data/vendor/node_modules/{mkdirp/LICENSE → assertion-error/README.md} +22 -2
  25. data/vendor/node_modules/assertion-error/index.d.ts +11 -0
  26. data/vendor/node_modules/assertion-error/index.js +116 -0
  27. data/vendor/node_modules/assertion-error/package.json +29 -0
  28. data/vendor/node_modules/camelcase/index.d.ts +5 -3
  29. data/vendor/node_modules/camelcase/index.js +40 -18
  30. data/vendor/node_modules/camelcase/package.json +1 -1
  31. data/vendor/node_modules/camelcase/readme.md +21 -5
  32. data/vendor/node_modules/chai/CODEOWNERS +1 -0
  33. data/vendor/node_modules/chai/CODE_OF_CONDUCT.md +58 -0
  34. data/vendor/node_modules/chai/CONTRIBUTING.md +218 -0
  35. data/vendor/node_modules/chai/History.md +1059 -0
  36. data/vendor/node_modules/{should-type-adaptors → chai}/LICENSE +1 -1
  37. data/vendor/node_modules/chai/README.md +212 -0
  38. data/vendor/node_modules/chai/ReleaseNotes.md +737 -0
  39. data/vendor/node_modules/chai/bower.json +26 -0
  40. data/vendor/node_modules/chai/chai.js +11464 -0
  41. data/vendor/node_modules/chai/index.js +1 -0
  42. data/vendor/node_modules/chai/index.mjs +14 -0
  43. data/vendor/node_modules/chai/karma.conf.js +34 -0
  44. data/vendor/node_modules/chai/karma.sauce.js +41 -0
  45. data/vendor/node_modules/chai/lib/chai/assertion.js +175 -0
  46. data/vendor/node_modules/chai/lib/chai/config.js +94 -0
  47. data/vendor/node_modules/chai/lib/chai/core/assertions.js +3853 -0
  48. data/vendor/node_modules/chai/lib/chai/interface/assert.js +3113 -0
  49. data/vendor/node_modules/chai/lib/chai/interface/expect.js +47 -0
  50. data/vendor/node_modules/chai/lib/chai/interface/should.js +219 -0
  51. data/vendor/node_modules/chai/lib/chai/utils/addChainableMethod.js +152 -0
  52. data/vendor/node_modules/chai/lib/chai/utils/addLengthGuard.js +60 -0
  53. data/vendor/node_modules/chai/lib/chai/utils/addMethod.js +68 -0
  54. data/vendor/node_modules/chai/lib/chai/utils/addProperty.js +72 -0
  55. data/vendor/node_modules/chai/lib/chai/utils/compareByInspect.js +31 -0
  56. data/vendor/node_modules/chai/lib/chai/utils/expectTypes.js +51 -0
  57. data/vendor/node_modules/chai/lib/chai/utils/flag.js +33 -0
  58. data/vendor/node_modules/chai/lib/chai/utils/getActual.js +20 -0
  59. data/vendor/node_modules/chai/lib/chai/utils/getEnumerableProperties.js +26 -0
  60. data/vendor/node_modules/chai/lib/chai/utils/getMessage.js +50 -0
  61. data/vendor/node_modules/chai/lib/chai/utils/getOperator.js +55 -0
  62. data/vendor/node_modules/chai/lib/chai/utils/getOwnEnumerableProperties.js +29 -0
  63. data/vendor/node_modules/chai/lib/chai/utils/getOwnEnumerablePropertySymbols.js +27 -0
  64. data/vendor/node_modules/chai/lib/chai/utils/getProperties.js +36 -0
  65. data/vendor/node_modules/chai/lib/chai/utils/index.js +178 -0
  66. data/vendor/node_modules/chai/lib/chai/utils/inspect.js +33 -0
  67. data/vendor/node_modules/chai/lib/chai/utils/isNaN.js +26 -0
  68. data/vendor/node_modules/chai/lib/chai/utils/isProxyEnabled.js +24 -0
  69. data/vendor/node_modules/chai/lib/chai/utils/objDisplay.js +50 -0
  70. data/vendor/node_modules/chai/lib/chai/utils/overwriteChainableMethod.js +69 -0
  71. data/vendor/node_modules/chai/lib/chai/utils/overwriteMethod.js +92 -0
  72. data/vendor/node_modules/chai/lib/chai/utils/overwriteProperty.js +92 -0
  73. data/vendor/node_modules/chai/lib/chai/utils/proxify.js +147 -0
  74. data/vendor/node_modules/chai/lib/chai/utils/test.js +28 -0
  75. data/vendor/node_modules/chai/lib/chai/utils/transferFlags.js +45 -0
  76. data/vendor/node_modules/chai/lib/chai.js +92 -0
  77. data/vendor/node_modules/chai/package.json +63 -0
  78. data/vendor/node_modules/chai/register-assert.js +1 -0
  79. data/vendor/node_modules/chai/register-expect.js +1 -0
  80. data/vendor/node_modules/chai/register-should.js +1 -0
  81. data/vendor/node_modules/chai/sauce.browsers.js +106 -0
  82. data/vendor/node_modules/chalk/package.json +1 -1
  83. data/vendor/node_modules/chalk/readme.md +7 -1
  84. data/vendor/node_modules/{source-map-url → check-error}/LICENSE +1 -3
  85. data/vendor/node_modules/check-error/README.md +207 -0
  86. data/vendor/node_modules/check-error/check-error.js +176 -0
  87. data/vendor/node_modules/check-error/index.js +172 -0
  88. data/vendor/node_modules/check-error/package.json +85 -0
  89. data/vendor/node_modules/chokidar/README.md +5 -4
  90. data/vendor/node_modules/chokidar/index.js +7 -1
  91. data/vendor/node_modules/chokidar/lib/constants.js +2 -0
  92. data/vendor/node_modules/chokidar/lib/fsevents-handler.js +2 -1
  93. data/vendor/node_modules/chokidar/lib/nodefs-handler.js +9 -1
  94. data/vendor/node_modules/chokidar/package.json +15 -8
  95. data/vendor/node_modules/chokidar/types/index.d.ts +4 -3
  96. data/vendor/node_modules/css/lib/stringify/source-map-support.js +10 -3
  97. data/vendor/node_modules/css/package.json +8 -9
  98. data/vendor/node_modules/debug/LICENSE +10 -9
  99. data/vendor/node_modules/debug/README.md +116 -3
  100. data/vendor/node_modules/debug/package.json +35 -19
  101. data/vendor/node_modules/debug/src/browser.js +194 -120
  102. data/vendor/node_modules/debug/src/common.js +274 -0
  103. data/vendor/node_modules/debug/src/index.js +4 -4
  104. data/vendor/node_modules/debug/src/node.js +174 -97
  105. data/vendor/node_modules/{resolve-url → deep-eql}/LICENSE +1 -3
  106. data/vendor/node_modules/deep-eql/README.md +116 -0
  107. data/vendor/node_modules/deep-eql/deep-eql.js +833 -0
  108. data/vendor/node_modules/deep-eql/index.js +455 -0
  109. data/vendor/node_modules/deep-eql/package.json +90 -0
  110. data/vendor/node_modules/{urix → get-func-name}/LICENSE +1 -3
  111. data/vendor/node_modules/get-func-name/README.md +123 -0
  112. data/vendor/node_modules/get-func-name/get-func-name.js +48 -0
  113. data/vendor/node_modules/get-func-name/index.js +44 -0
  114. data/vendor/node_modules/get-func-name/package.json +85 -0
  115. data/vendor/node_modules/glob/README.md +3 -0
  116. data/vendor/node_modules/glob/common.js +2 -0
  117. data/vendor/node_modules/glob/glob.js +4 -5
  118. data/vendor/node_modules/glob/package.json +2 -1
  119. data/vendor/node_modules/glob/sync.js +4 -5
  120. data/vendor/node_modules/{cliui/node_modules/is-fullwidth-code-point → is-fullwidth-code-point}/index.d.ts +0 -0
  121. data/vendor/node_modules/is-fullwidth-code-point/index.js +25 -21
  122. data/vendor/node_modules/is-fullwidth-code-point/license +4 -16
  123. data/vendor/node_modules/is-fullwidth-code-point/package.json +40 -43
  124. data/vendor/node_modules/is-fullwidth-code-point/readme.md +6 -6
  125. data/vendor/node_modules/is-glob/README.md +1 -1
  126. data/vendor/node_modules/is-glob/index.js +126 -24
  127. data/vendor/node_modules/is-glob/package.json +2 -2
  128. data/vendor/node_modules/is-unicode-supported/index.d.ts +14 -0
  129. data/vendor/node_modules/is-unicode-supported/index.js +13 -0
  130. data/vendor/node_modules/{cliui/node_modules/string-width → is-unicode-supported}/license +1 -1
  131. data/vendor/node_modules/is-unicode-supported/package.json +41 -0
  132. data/vendor/node_modules/is-unicode-supported/readme.md +35 -0
  133. data/vendor/node_modules/js-yaml/CHANGELOG.md +13 -0
  134. data/vendor/node_modules/js-yaml/README.md +1 -1
  135. data/vendor/node_modules/js-yaml/dist/js-yaml.js +90 -70
  136. data/vendor/node_modules/js-yaml/dist/js-yaml.min.js +2 -2
  137. data/vendor/node_modules/js-yaml/dist/js-yaml.mjs +84 -65
  138. data/vendor/node_modules/js-yaml/index.js +17 -0
  139. data/vendor/node_modules/js-yaml/lib/schema.js +9 -9
  140. data/vendor/node_modules/js-yaml/lib/type.js +1 -0
  141. data/vendor/node_modules/js-yaml/package.json +1 -1
  142. data/vendor/node_modules/jscoverage/node_modules/ms/index.js +152 -0
  143. data/vendor/node_modules/{should-format/LICENSE → jscoverage/node_modules/ms/license.md} +1 -2
  144. data/vendor/node_modules/jscoverage/node_modules/ms/package.json +37 -0
  145. data/vendor/node_modules/jscoverage/node_modules/ms/readme.md +51 -0
  146. data/vendor/node_modules/log-symbols/index.d.ts +2 -2
  147. data/vendor/node_modules/log-symbols/index.js +3 -4
  148. data/vendor/node_modules/log-symbols/package.json +7 -5
  149. data/vendor/node_modules/log-symbols/readme.md +3 -3
  150. data/vendor/node_modules/loupe/CHANGELOG.md +5 -0
  151. data/vendor/node_modules/{cliui/node_modules/strip-ansi/license → loupe/LICENSE} +2 -2
  152. data/vendor/node_modules/loupe/README.md +63 -0
  153. data/vendor/node_modules/loupe/index.js +195 -0
  154. data/vendor/node_modules/loupe/lib/arguments.js +7 -0
  155. data/vendor/node_modules/loupe/lib/array.js +20 -0
  156. data/vendor/node_modules/loupe/lib/bigint.js +7 -0
  157. data/vendor/node_modules/loupe/lib/class.js +18 -0
  158. data/vendor/node_modules/loupe/lib/date.js +8 -0
  159. data/vendor/node_modules/loupe/lib/error.js +34 -0
  160. data/vendor/node_modules/loupe/lib/function.js +10 -0
  161. data/vendor/node_modules/loupe/lib/helpers.js +177 -0
  162. data/vendor/node_modules/loupe/lib/html.js +40 -0
  163. data/vendor/node_modules/loupe/lib/map.js +27 -0
  164. data/vendor/node_modules/loupe/lib/number.js +18 -0
  165. data/vendor/node_modules/loupe/lib/object.js +31 -0
  166. data/vendor/node_modules/loupe/lib/promise.js +16 -0
  167. data/vendor/node_modules/loupe/lib/regexp.js +8 -0
  168. data/vendor/node_modules/loupe/lib/set.js +16 -0
  169. data/vendor/node_modules/loupe/lib/string.js +29 -0
  170. data/vendor/node_modules/loupe/lib/symbol.js +6 -0
  171. data/vendor/node_modules/loupe/lib/typedarray.js +45 -0
  172. data/vendor/node_modules/loupe/loupe.js +852 -0
  173. data/vendor/node_modules/loupe/package.json +141 -0
  174. data/vendor/node_modules/minimatch/README.md +22 -1
  175. data/vendor/node_modules/minimatch/minimatch.js +93 -69
  176. data/vendor/node_modules/minimatch/package.json +6 -3
  177. data/vendor/node_modules/mocha/LICENSE +1 -1
  178. data/vendor/node_modules/mocha/README.md +1 -1
  179. data/vendor/node_modules/mocha/bin/mocha +18 -27
  180. data/vendor/node_modules/mocha/browser-entry.js +27 -20
  181. data/vendor/node_modules/mocha/lib/browser/growl.js +5 -5
  182. data/vendor/node_modules/mocha/lib/browser/parse-query.js +1 -1
  183. data/vendor/node_modules/mocha/lib/browser/progress.js +6 -6
  184. data/vendor/node_modules/mocha/lib/cli/cli.js +3 -2
  185. data/vendor/node_modules/mocha/lib/cli/config.js +7 -12
  186. data/vendor/node_modules/mocha/lib/cli/lookup-files.js +2 -8
  187. data/vendor/node_modules/mocha/lib/cli/node-flags.js +2 -5
  188. data/vendor/node_modules/mocha/lib/cli/one-and-dones.js +1 -2
  189. data/vendor/node_modules/mocha/lib/cli/run-helpers.js +15 -15
  190. data/vendor/node_modules/mocha/lib/cli/run-option-metadata.js +4 -0
  191. data/vendor/node_modules/mocha/lib/cli/run.js +13 -1
  192. data/vendor/node_modules/mocha/lib/cli/watch-run.js +3 -6
  193. data/vendor/node_modules/mocha/lib/context.js +5 -5
  194. data/vendor/node_modules/mocha/lib/errors.js +3 -3
  195. data/vendor/node_modules/mocha/lib/hook.js +9 -3
  196. data/vendor/node_modules/mocha/lib/interfaces/bdd.js +23 -20
  197. data/vendor/node_modules/mocha/lib/interfaces/common.js +7 -7
  198. data/vendor/node_modules/mocha/lib/interfaces/exports.js +1 -1
  199. data/vendor/node_modules/mocha/lib/interfaces/qunit.js +7 -7
  200. data/vendor/node_modules/mocha/lib/interfaces/tdd.js +9 -9
  201. data/vendor/node_modules/mocha/lib/mocha.js +105 -99
  202. data/vendor/node_modules/mocha/lib/nodejs/buffered-worker-pool.js +17 -1
  203. data/vendor/node_modules/mocha/lib/nodejs/esm-utils.js +124 -0
  204. data/vendor/node_modules/mocha/lib/reporters/base.js +49 -35
  205. data/vendor/node_modules/mocha/lib/reporters/doc.js +4 -4
  206. data/vendor/node_modules/mocha/lib/reporters/dot.js +5 -5
  207. data/vendor/node_modules/mocha/lib/reporters/html.js +12 -12
  208. data/vendor/node_modules/mocha/lib/reporters/json-stream.js +4 -4
  209. data/vendor/node_modules/mocha/lib/reporters/json.js +35 -10
  210. data/vendor/node_modules/mocha/lib/reporters/landing.js +5 -5
  211. data/vendor/node_modules/mocha/lib/reporters/list.js +5 -5
  212. data/vendor/node_modules/mocha/lib/reporters/markdown.js +5 -5
  213. data/vendor/node_modules/mocha/lib/reporters/min.js +1 -1
  214. data/vendor/node_modules/mocha/lib/reporters/nyan.js +16 -16
  215. data/vendor/node_modules/mocha/lib/reporters/progress.js +3 -3
  216. data/vendor/node_modules/mocha/lib/reporters/spec.js +6 -6
  217. data/vendor/node_modules/mocha/lib/reporters/tap.js +17 -17
  218. data/vendor/node_modules/mocha/lib/reporters/xunit.js +9 -9
  219. data/vendor/node_modules/mocha/lib/runnable.js +21 -21
  220. data/vendor/node_modules/mocha/lib/runner.js +63 -61
  221. data/vendor/node_modules/mocha/lib/stats-collector.js +7 -7
  222. data/vendor/node_modules/mocha/lib/suite.js +46 -75
  223. data/vendor/node_modules/mocha/lib/test.js +5 -5
  224. data/vendor/node_modules/mocha/lib/utils.js +19 -114
  225. data/vendor/node_modules/mocha/mocha-es2018.js +19794 -0
  226. data/vendor/node_modules/mocha/mocha.js +8059 -6920
  227. data/vendor/node_modules/mocha/mocha.js.map +1 -1
  228. data/vendor/node_modules/mocha/node_modules/debug/LICENSE +10 -9
  229. data/vendor/node_modules/mocha/node_modules/debug/README.md +24 -1
  230. data/vendor/node_modules/mocha/node_modules/debug/package.json +6 -6
  231. data/vendor/node_modules/mocha/node_modules/debug/src/common.js +15 -2
  232. data/vendor/node_modules/{semver → mocha/node_modules/minimatch}/LICENSE +1 -1
  233. data/vendor/node_modules/mocha/node_modules/minimatch/README.md +230 -0
  234. data/vendor/node_modules/mocha/node_modules/minimatch/minimatch.js +908 -0
  235. data/vendor/node_modules/mocha/node_modules/minimatch/package.json +31 -0
  236. data/vendor/node_modules/mocha/package.json +66 -65
  237. data/vendor/node_modules/ms/index.js +29 -19
  238. data/vendor/node_modules/ms/package.json +6 -6
  239. data/vendor/node_modules/ms/readme.md +18 -9
  240. data/vendor/node_modules/nanoid/README.md +9 -473
  241. data/vendor/node_modules/nanoid/async/index.browser.cjs +34 -0
  242. data/vendor/node_modules/nanoid/async/index.browser.js +7 -43
  243. data/vendor/node_modules/nanoid/async/index.cjs +5 -41
  244. data/vendor/node_modules/nanoid/async/index.d.ts +7 -7
  245. data/vendor/node_modules/nanoid/async/index.js +5 -41
  246. data/vendor/node_modules/nanoid/async/index.native.js +5 -36
  247. data/vendor/node_modules/nanoid/async/package.json +2 -1
  248. data/vendor/node_modules/nanoid/bin/nanoid.cjs +52 -2
  249. data/vendor/node_modules/nanoid/index.browser.cjs +37 -0
  250. data/vendor/node_modules/nanoid/index.browser.js +5 -73
  251. data/vendor/node_modules/nanoid/index.cjs +14 -49
  252. data/vendor/node_modules/nanoid/index.d.ts +9 -6
  253. data/vendor/node_modules/nanoid/index.js +14 -49
  254. data/vendor/node_modules/nanoid/non-secure/index.cjs +3 -12
  255. data/vendor/node_modules/nanoid/non-secure/index.d.ts +8 -5
  256. data/vendor/node_modules/nanoid/non-secure/index.js +3 -12
  257. data/vendor/node_modules/nanoid/package.json +14 -10
  258. data/vendor/node_modules/nanoid/url-alphabet/index.cjs +1 -4
  259. data/vendor/node_modules/nanoid/url-alphabet/index.js +1 -4
  260. data/vendor/node_modules/pathval/CHANGELOG.md +18 -0
  261. data/vendor/node_modules/pathval/LICENSE +16 -0
  262. data/vendor/node_modules/pathval/README.md +147 -0
  263. data/vendor/node_modules/pathval/index.js +301 -0
  264. data/vendor/node_modules/pathval/package.json +80 -0
  265. data/vendor/node_modules/pathval/pathval.js +1 -0
  266. data/vendor/node_modules/picomatch/CHANGELOG.md +16 -0
  267. data/vendor/node_modules/picomatch/README.md +34 -17
  268. data/vendor/node_modules/picomatch/lib/parse.js +19 -6
  269. data/vendor/node_modules/picomatch/lib/picomatch.js +34 -31
  270. data/vendor/node_modules/picomatch/lib/scan.js +8 -2
  271. data/vendor/node_modules/picomatch/package.json +1 -1
  272. data/vendor/node_modules/readdirp/index.js +11 -6
  273. data/vendor/node_modules/readdirp/package.json +1 -1
  274. data/vendor/node_modules/serialize-javascript/README.md +2 -4
  275. data/vendor/node_modules/serialize-javascript/index.js +11 -2
  276. data/vendor/node_modules/serialize-javascript/package.json +2 -2
  277. data/vendor/node_modules/source-map-resolve/LICENSE +1 -1
  278. data/vendor/node_modules/source-map-resolve/changelog.md +6 -0
  279. data/vendor/node_modules/source-map-resolve/{lib/source-map-resolve-node.js → index.js} +48 -13
  280. data/vendor/node_modules/source-map-resolve/package.json +7 -14
  281. data/vendor/node_modules/source-map-resolve/readme.md +1 -39
  282. data/vendor/node_modules/{cliui/node_modules/string-width → string-width}/index.d.ts +0 -0
  283. data/vendor/node_modules/string-width/index.js +16 -5
  284. data/vendor/node_modules/string-width/package.json +11 -10
  285. data/vendor/node_modules/string-width/readme.md +15 -7
  286. data/vendor/node_modules/{cliui/node_modules/strip-ansi → strip-ansi}/index.d.ts +0 -0
  287. data/vendor/node_modules/strip-ansi/index.js +1 -1
  288. data/vendor/node_modules/strip-ansi/package.json +52 -50
  289. data/vendor/node_modules/strip-ansi/readme.md +12 -5
  290. data/vendor/node_modules/{fsevents → type-detect}/LICENSE +1 -4
  291. data/vendor/node_modules/type-detect/README.md +228 -0
  292. data/vendor/node_modules/type-detect/index.js +378 -0
  293. data/vendor/node_modules/type-detect/package.json +1 -0
  294. data/vendor/node_modules/type-detect/type-detect.js +388 -0
  295. data/vendor/node_modules/workerpool/HISTORY.md +42 -0
  296. data/vendor/node_modules/workerpool/README.md +11 -1
  297. data/vendor/node_modules/workerpool/dist/worker.js +9 -42
  298. data/vendor/node_modules/workerpool/dist/worker.js.map +1 -1
  299. data/vendor/node_modules/workerpool/dist/workerpool.js +117 -74
  300. data/vendor/node_modules/workerpool/dist/workerpool.js.map +1 -1
  301. data/vendor/node_modules/workerpool/dist/workerpool.min.js +1 -1
  302. data/vendor/node_modules/workerpool/dist/workerpool.min.js.LICENSE.txt +3 -3
  303. data/vendor/node_modules/workerpool/dist/workerpool.min.js.map +1 -1
  304. data/vendor/node_modules/workerpool/package.json +11 -11
  305. data/vendor/node_modules/workerpool/src/Pool.js +29 -4
  306. data/vendor/node_modules/workerpool/src/WorkerHandler.js +17 -4
  307. data/vendor/node_modules/workerpool/src/generated/embeddedWorker.js +1 -1
  308. data/vendor/node_modules/workerpool/src/header.js +1 -1
  309. data/vendor/node_modules/workerpool/src/types.js +2 -1
  310. data/vendor/package-lock.json +401 -664
  311. data/vendor/package.json +7 -9
  312. metadata +139 -175
  313. data/vendor/node_modules/cliui/node_modules/ansi-regex/index.js +0 -10
  314. data/vendor/node_modules/cliui/node_modules/ansi-regex/license +0 -9
  315. data/vendor/node_modules/cliui/node_modules/ansi-regex/package.json +0 -55
  316. data/vendor/node_modules/cliui/node_modules/ansi-regex/readme.md +0 -78
  317. data/vendor/node_modules/cliui/node_modules/is-fullwidth-code-point/index.js +0 -50
  318. data/vendor/node_modules/cliui/node_modules/is-fullwidth-code-point/license +0 -9
  319. data/vendor/node_modules/cliui/node_modules/is-fullwidth-code-point/package.json +0 -42
  320. data/vendor/node_modules/cliui/node_modules/is-fullwidth-code-point/readme.md +0 -39
  321. data/vendor/node_modules/cliui/node_modules/string-width/index.js +0 -47
  322. data/vendor/node_modules/cliui/node_modules/string-width/package.json +0 -56
  323. data/vendor/node_modules/cliui/node_modules/string-width/readme.md +0 -50
  324. data/vendor/node_modules/cliui/node_modules/strip-ansi/index.js +0 -4
  325. data/vendor/node_modules/cliui/node_modules/strip-ansi/package.json +0 -54
  326. data/vendor/node_modules/cliui/node_modules/strip-ansi/readme.md +0 -46
  327. data/vendor/node_modules/css-parse/Readme.md +0 -15
  328. data/vendor/node_modules/css-parse/index.js +0 -1
  329. data/vendor/node_modules/css-parse/package.json +0 -23
  330. data/vendor/node_modules/debug/CHANGELOG.md +0 -395
  331. data/vendor/node_modules/debug/Makefile +0 -58
  332. data/vendor/node_modules/debug/karma.conf.js +0 -70
  333. data/vendor/node_modules/debug/node.js +0 -1
  334. data/vendor/node_modules/debug/src/debug.js +0 -225
  335. data/vendor/node_modules/fsevents/README.md +0 -83
  336. data/vendor/node_modules/fsevents/fsevents.d.ts +0 -46
  337. data/vendor/node_modules/fsevents/fsevents.js +0 -82
  338. data/vendor/node_modules/fsevents/fsevents.node +0 -0
  339. data/vendor/node_modules/fsevents/package.json +0 -62
  340. data/vendor/node_modules/glob/changelog.md +0 -67
  341. data/vendor/node_modules/mkdirp/CHANGELOG.md +0 -15
  342. data/vendor/node_modules/mkdirp/bin/cmd.js +0 -68
  343. data/vendor/node_modules/mkdirp/index.js +0 -31
  344. data/vendor/node_modules/mkdirp/lib/find-made.js +0 -29
  345. data/vendor/node_modules/mkdirp/lib/mkdirp-manual.js +0 -64
  346. data/vendor/node_modules/mkdirp/lib/mkdirp-native.js +0 -39
  347. data/vendor/node_modules/mkdirp/lib/opts-arg.js +0 -23
  348. data/vendor/node_modules/mkdirp/lib/path-arg.js +0 -29
  349. data/vendor/node_modules/mkdirp/lib/use-native.js +0 -10
  350. data/vendor/node_modules/mkdirp/package.json +0 -44
  351. data/vendor/node_modules/mkdirp/readme.markdown +0 -266
  352. data/vendor/node_modules/mocha/CHANGELOG.md +0 -931
  353. data/vendor/node_modules/mocha/lib/esm-utils.js +0 -58
  354. data/vendor/node_modules/mocha/node_modules/glob/LICENSE +0 -21
  355. data/vendor/node_modules/mocha/node_modules/glob/README.md +0 -375
  356. data/vendor/node_modules/mocha/node_modules/glob/changelog.md +0 -67
  357. data/vendor/node_modules/mocha/node_modules/glob/common.js +0 -240
  358. data/vendor/node_modules/mocha/node_modules/glob/glob.js +0 -790
  359. data/vendor/node_modules/mocha/node_modules/glob/package.json +0 -46
  360. data/vendor/node_modules/mocha/node_modules/glob/sync.js +0 -486
  361. data/vendor/node_modules/nanoid/CHANGELOG.md +0 -241
  362. data/vendor/node_modules/nanoid/index.dev.js +0 -105
  363. data/vendor/node_modules/nanoid/index.prod.js +0 -105
  364. data/vendor/node_modules/resolve-url/bower.json +0 -15
  365. data/vendor/node_modules/resolve-url/changelog.md +0 -15
  366. data/vendor/node_modules/resolve-url/component.json +0 -15
  367. data/vendor/node_modules/resolve-url/package.json +0 -34
  368. data/vendor/node_modules/resolve-url/readme.md +0 -83
  369. data/vendor/node_modules/resolve-url/resolve-url.js +0 -47
  370. data/vendor/node_modules/resolve-url/test/resolve-url.js +0 -70
  371. data/vendor/node_modules/semver/CHANGELOG.md +0 -70
  372. data/vendor/node_modules/semver/README.md +0 -443
  373. data/vendor/node_modules/semver/bin/semver.js +0 -174
  374. data/vendor/node_modules/semver/package.json +0 -28
  375. data/vendor/node_modules/semver/range.bnf +0 -16
  376. data/vendor/node_modules/semver/semver.js +0 -1596
  377. data/vendor/node_modules/should/CONTRIBUTING.md +0 -14
  378. data/vendor/node_modules/should/History.md +0 -554
  379. data/vendor/node_modules/should/LICENSE +0 -20
  380. data/vendor/node_modules/should/Readme.md +0 -223
  381. data/vendor/node_modules/should/as-function.js +0 -2935
  382. data/vendor/node_modules/should/cjs/should.js +0 -2962
  383. data/vendor/node_modules/should/es6/should.js +0 -2958
  384. data/vendor/node_modules/should/package.json +0 -51
  385. data/vendor/node_modules/should/should.d.ts +0 -243
  386. data/vendor/node_modules/should/should.js +0 -4371
  387. data/vendor/node_modules/should-equal/LICENSE +0 -21
  388. data/vendor/node_modules/should-equal/README.md +0 -24
  389. data/vendor/node_modules/should-equal/cjs/should-equal.js +0 -333
  390. data/vendor/node_modules/should-equal/es6/should-equal.js +0 -329
  391. data/vendor/node_modules/should-equal/package.json +0 -38
  392. data/vendor/node_modules/should-format/README.md +0 -6
  393. data/vendor/node_modules/should-format/cjs/should-format.js +0 -532
  394. data/vendor/node_modules/should-format/es6/should-format.js +0 -528
  395. data/vendor/node_modules/should-format/package.json +0 -44
  396. data/vendor/node_modules/should-type/LICENSE +0 -22
  397. data/vendor/node_modules/should-type/README.md +0 -4
  398. data/vendor/node_modules/should-type/cjs/should-type.js +0 -263
  399. data/vendor/node_modules/should-type/es6/should-type.js +0 -261
  400. data/vendor/node_modules/should-type/package.json +0 -38
  401. data/vendor/node_modules/should-type-adaptors/README.md +0 -1
  402. data/vendor/node_modules/should-type-adaptors/cjs/should-type-adaptors.js +0 -288
  403. data/vendor/node_modules/should-type-adaptors/es6/should-type-adaptors.js +0 -272
  404. data/vendor/node_modules/should-type-adaptors/package.json +0 -43
  405. data/vendor/node_modules/should-util/LICENSE +0 -21
  406. data/vendor/node_modules/should-util/README.md +0 -2
  407. data/vendor/node_modules/should-util/cjs/should-util.js +0 -50
  408. data/vendor/node_modules/should-util/es6/should-util.js +0 -42
  409. data/vendor/node_modules/should-util/package.json +0 -40
  410. data/vendor/node_modules/source-map-resolve/lib/decode-uri-component.js +0 -8
  411. data/vendor/node_modules/source-map-resolve/lib/resolve-url.js +0 -9
  412. data/vendor/node_modules/source-map-resolve/source-map-resolve.js +0 -348
  413. data/vendor/node_modules/source-map-url/changelog.md +0 -57
  414. data/vendor/node_modules/source-map-url/package.json +0 -39
  415. data/vendor/node_modules/source-map-url/readme.md +0 -97
  416. data/vendor/node_modules/source-map-url/source-map-url.js +0 -57
  417. data/vendor/node_modules/urix/index.js +0 -17
  418. data/vendor/node_modules/urix/package.json +0 -25
  419. data/vendor/node_modules/urix/readme.md +0 -46
  420. data/vendor/node_modules/urix/test/index.js +0 -43
  421. data/vendor/node_modules/wide-align/LICENSE +0 -14
  422. data/vendor/node_modules/wide-align/README.md +0 -47
  423. data/vendor/node_modules/wide-align/align.js +0 -65
  424. data/vendor/node_modules/wide-align/package.json +0 -33
  425. data/vendor/node_modules/wrap-ansi/node_modules/ansi-regex/index.d.ts +0 -37
  426. data/vendor/node_modules/wrap-ansi/node_modules/ansi-regex/index.js +0 -10
  427. data/vendor/node_modules/wrap-ansi/node_modules/ansi-regex/license +0 -9
  428. data/vendor/node_modules/wrap-ansi/node_modules/ansi-regex/package.json +0 -55
  429. data/vendor/node_modules/wrap-ansi/node_modules/ansi-regex/readme.md +0 -78
  430. data/vendor/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/index.d.ts +0 -17
  431. data/vendor/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/index.js +0 -50
  432. data/vendor/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/license +0 -9
  433. data/vendor/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/package.json +0 -42
  434. data/vendor/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/readme.md +0 -39
  435. data/vendor/node_modules/wrap-ansi/node_modules/string-width/index.d.ts +0 -29
  436. data/vendor/node_modules/wrap-ansi/node_modules/string-width/index.js +0 -47
  437. data/vendor/node_modules/wrap-ansi/node_modules/string-width/license +0 -9
  438. data/vendor/node_modules/wrap-ansi/node_modules/string-width/package.json +0 -56
  439. data/vendor/node_modules/wrap-ansi/node_modules/string-width/readme.md +0 -50
  440. data/vendor/node_modules/wrap-ansi/node_modules/strip-ansi/index.d.ts +0 -17
  441. data/vendor/node_modules/wrap-ansi/node_modules/strip-ansi/index.js +0 -4
  442. data/vendor/node_modules/wrap-ansi/node_modules/strip-ansi/license +0 -9
  443. data/vendor/node_modules/wrap-ansi/node_modules/strip-ansi/package.json +0 -54
  444. data/vendor/node_modules/wrap-ansi/node_modules/strip-ansi/readme.md +0 -46
  445. data/vendor/node_modules/yargs/node_modules/ansi-regex/index.d.ts +0 -37
  446. data/vendor/node_modules/yargs/node_modules/ansi-regex/index.js +0 -10
  447. data/vendor/node_modules/yargs/node_modules/ansi-regex/license +0 -9
  448. data/vendor/node_modules/yargs/node_modules/ansi-regex/package.json +0 -55
  449. data/vendor/node_modules/yargs/node_modules/ansi-regex/readme.md +0 -78
  450. data/vendor/node_modules/yargs/node_modules/is-fullwidth-code-point/index.d.ts +0 -17
  451. data/vendor/node_modules/yargs/node_modules/is-fullwidth-code-point/index.js +0 -50
  452. data/vendor/node_modules/yargs/node_modules/is-fullwidth-code-point/license +0 -9
  453. data/vendor/node_modules/yargs/node_modules/is-fullwidth-code-point/package.json +0 -42
  454. data/vendor/node_modules/yargs/node_modules/is-fullwidth-code-point/readme.md +0 -39
  455. data/vendor/node_modules/yargs/node_modules/string-width/index.d.ts +0 -29
  456. data/vendor/node_modules/yargs/node_modules/string-width/index.js +0 -47
  457. data/vendor/node_modules/yargs/node_modules/string-width/license +0 -9
  458. data/vendor/node_modules/yargs/node_modules/string-width/package.json +0 -56
  459. data/vendor/node_modules/yargs/node_modules/string-width/readme.md +0 -50
  460. data/vendor/node_modules/yargs/node_modules/strip-ansi/index.d.ts +0 -17
  461. data/vendor/node_modules/yargs/node_modules/strip-ansi/index.js +0 -4
  462. data/vendor/node_modules/yargs/node_modules/strip-ansi/license +0 -9
  463. data/vendor/node_modules/yargs/node_modules/strip-ansi/package.json +0 -54
  464. data/vendor/node_modules/yargs/node_modules/strip-ansi/readme.md +0 -46
  465. data/vendor/test.js +0 -31
@@ -0,0 +1,47 @@
1
+ /*!
2
+ * chai
3
+ * Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
4
+ * MIT Licensed
5
+ */
6
+
7
+ module.exports = function (chai, util) {
8
+ chai.expect = function (val, message) {
9
+ return new chai.Assertion(val, message);
10
+ };
11
+
12
+ /**
13
+ * ### .fail([message])
14
+ * ### .fail(actual, expected, [message], [operator])
15
+ *
16
+ * Throw a failure.
17
+ *
18
+ * expect.fail();
19
+ * expect.fail("custom error message");
20
+ * expect.fail(1, 2);
21
+ * expect.fail(1, 2, "custom error message");
22
+ * expect.fail(1, 2, "custom error message", ">");
23
+ * expect.fail(1, 2, undefined, ">");
24
+ *
25
+ * @name fail
26
+ * @param {Mixed} actual
27
+ * @param {Mixed} expected
28
+ * @param {String} message
29
+ * @param {String} operator
30
+ * @namespace BDD
31
+ * @api public
32
+ */
33
+
34
+ chai.expect.fail = function (actual, expected, message, operator) {
35
+ if (arguments.length < 2) {
36
+ message = actual;
37
+ actual = undefined;
38
+ }
39
+
40
+ message = message || 'expect.fail()';
41
+ throw new chai.AssertionError(message, {
42
+ actual: actual
43
+ , expected: expected
44
+ , operator: operator
45
+ }, chai.expect.fail);
46
+ };
47
+ };
@@ -0,0 +1,219 @@
1
+ /*!
2
+ * chai
3
+ * Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
4
+ * MIT Licensed
5
+ */
6
+
7
+ module.exports = function (chai, util) {
8
+ var Assertion = chai.Assertion;
9
+
10
+ function loadShould () {
11
+ // explicitly define this method as function as to have it's name to include as `ssfi`
12
+ function shouldGetter() {
13
+ if (this instanceof String
14
+ || this instanceof Number
15
+ || this instanceof Boolean
16
+ || typeof Symbol === 'function' && this instanceof Symbol
17
+ || typeof BigInt === 'function' && this instanceof BigInt) {
18
+ return new Assertion(this.valueOf(), null, shouldGetter);
19
+ }
20
+ return new Assertion(this, null, shouldGetter);
21
+ }
22
+ function shouldSetter(value) {
23
+ // See https://github.com/chaijs/chai/issues/86: this makes
24
+ // `whatever.should = someValue` actually set `someValue`, which is
25
+ // especially useful for `global.should = require('chai').should()`.
26
+ //
27
+ // Note that we have to use [[DefineProperty]] instead of [[Put]]
28
+ // since otherwise we would trigger this very setter!
29
+ Object.defineProperty(this, 'should', {
30
+ value: value,
31
+ enumerable: true,
32
+ configurable: true,
33
+ writable: true
34
+ });
35
+ }
36
+ // modify Object.prototype to have `should`
37
+ Object.defineProperty(Object.prototype, 'should', {
38
+ set: shouldSetter
39
+ , get: shouldGetter
40
+ , configurable: true
41
+ });
42
+
43
+ var should = {};
44
+
45
+ /**
46
+ * ### .fail([message])
47
+ * ### .fail(actual, expected, [message], [operator])
48
+ *
49
+ * Throw a failure.
50
+ *
51
+ * should.fail();
52
+ * should.fail("custom error message");
53
+ * should.fail(1, 2);
54
+ * should.fail(1, 2, "custom error message");
55
+ * should.fail(1, 2, "custom error message", ">");
56
+ * should.fail(1, 2, undefined, ">");
57
+ *
58
+ *
59
+ * @name fail
60
+ * @param {Mixed} actual
61
+ * @param {Mixed} expected
62
+ * @param {String} message
63
+ * @param {String} operator
64
+ * @namespace BDD
65
+ * @api public
66
+ */
67
+
68
+ should.fail = function (actual, expected, message, operator) {
69
+ if (arguments.length < 2) {
70
+ message = actual;
71
+ actual = undefined;
72
+ }
73
+
74
+ message = message || 'should.fail()';
75
+ throw new chai.AssertionError(message, {
76
+ actual: actual
77
+ , expected: expected
78
+ , operator: operator
79
+ }, should.fail);
80
+ };
81
+
82
+ /**
83
+ * ### .equal(actual, expected, [message])
84
+ *
85
+ * Asserts non-strict equality (`==`) of `actual` and `expected`.
86
+ *
87
+ * should.equal(3, '3', '== coerces values to strings');
88
+ *
89
+ * @name equal
90
+ * @param {Mixed} actual
91
+ * @param {Mixed} expected
92
+ * @param {String} message
93
+ * @namespace Should
94
+ * @api public
95
+ */
96
+
97
+ should.equal = function (val1, val2, msg) {
98
+ new Assertion(val1, msg).to.equal(val2);
99
+ };
100
+
101
+ /**
102
+ * ### .throw(function, [constructor/string/regexp], [string/regexp], [message])
103
+ *
104
+ * Asserts that `function` will throw an error that is an instance of
105
+ * `constructor`, or alternately that it will throw an error with message
106
+ * matching `regexp`.
107
+ *
108
+ * should.throw(fn, 'function throws a reference error');
109
+ * should.throw(fn, /function throws a reference error/);
110
+ * should.throw(fn, ReferenceError);
111
+ * should.throw(fn, ReferenceError, 'function throws a reference error');
112
+ * should.throw(fn, ReferenceError, /function throws a reference error/);
113
+ *
114
+ * @name throw
115
+ * @alias Throw
116
+ * @param {Function} function
117
+ * @param {ErrorConstructor} constructor
118
+ * @param {RegExp} regexp
119
+ * @param {String} message
120
+ * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types
121
+ * @namespace Should
122
+ * @api public
123
+ */
124
+
125
+ should.Throw = function (fn, errt, errs, msg) {
126
+ new Assertion(fn, msg).to.Throw(errt, errs);
127
+ };
128
+
129
+ /**
130
+ * ### .exist
131
+ *
132
+ * Asserts that the target is neither `null` nor `undefined`.
133
+ *
134
+ * var foo = 'hi';
135
+ *
136
+ * should.exist(foo, 'foo exists');
137
+ *
138
+ * @name exist
139
+ * @namespace Should
140
+ * @api public
141
+ */
142
+
143
+ should.exist = function (val, msg) {
144
+ new Assertion(val, msg).to.exist;
145
+ }
146
+
147
+ // negation
148
+ should.not = {}
149
+
150
+ /**
151
+ * ### .not.equal(actual, expected, [message])
152
+ *
153
+ * Asserts non-strict inequality (`!=`) of `actual` and `expected`.
154
+ *
155
+ * should.not.equal(3, 4, 'these numbers are not equal');
156
+ *
157
+ * @name not.equal
158
+ * @param {Mixed} actual
159
+ * @param {Mixed} expected
160
+ * @param {String} message
161
+ * @namespace Should
162
+ * @api public
163
+ */
164
+
165
+ should.not.equal = function (val1, val2, msg) {
166
+ new Assertion(val1, msg).to.not.equal(val2);
167
+ };
168
+
169
+ /**
170
+ * ### .throw(function, [constructor/regexp], [message])
171
+ *
172
+ * Asserts that `function` will _not_ throw an error that is an instance of
173
+ * `constructor`, or alternately that it will not throw an error with message
174
+ * matching `regexp`.
175
+ *
176
+ * should.not.throw(fn, Error, 'function does not throw');
177
+ *
178
+ * @name not.throw
179
+ * @alias not.Throw
180
+ * @param {Function} function
181
+ * @param {ErrorConstructor} constructor
182
+ * @param {RegExp} regexp
183
+ * @param {String} message
184
+ * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types
185
+ * @namespace Should
186
+ * @api public
187
+ */
188
+
189
+ should.not.Throw = function (fn, errt, errs, msg) {
190
+ new Assertion(fn, msg).to.not.Throw(errt, errs);
191
+ };
192
+
193
+ /**
194
+ * ### .not.exist
195
+ *
196
+ * Asserts that the target is neither `null` nor `undefined`.
197
+ *
198
+ * var bar = null;
199
+ *
200
+ * should.not.exist(bar, 'bar does not exist');
201
+ *
202
+ * @name not.exist
203
+ * @namespace Should
204
+ * @api public
205
+ */
206
+
207
+ should.not.exist = function (val, msg) {
208
+ new Assertion(val, msg).to.not.exist;
209
+ }
210
+
211
+ should['throw'] = should['Throw'];
212
+ should.not['throw'] = should.not['Throw'];
213
+
214
+ return should;
215
+ };
216
+
217
+ chai.should = loadShould;
218
+ chai.Should = loadShould;
219
+ };
@@ -0,0 +1,152 @@
1
+ /*!
2
+ * Chai - addChainingMethod utility
3
+ * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
4
+ * MIT Licensed
5
+ */
6
+
7
+ /*!
8
+ * Module dependencies
9
+ */
10
+
11
+ var addLengthGuard = require('./addLengthGuard');
12
+ var chai = require('../../chai');
13
+ var flag = require('./flag');
14
+ var proxify = require('./proxify');
15
+ var transferFlags = require('./transferFlags');
16
+
17
+ /*!
18
+ * Module variables
19
+ */
20
+
21
+ // Check whether `Object.setPrototypeOf` is supported
22
+ var canSetPrototype = typeof Object.setPrototypeOf === 'function';
23
+
24
+ // Without `Object.setPrototypeOf` support, this module will need to add properties to a function.
25
+ // However, some of functions' own props are not configurable and should be skipped.
26
+ var testFn = function() {};
27
+ var excludeNames = Object.getOwnPropertyNames(testFn).filter(function(name) {
28
+ var propDesc = Object.getOwnPropertyDescriptor(testFn, name);
29
+
30
+ // Note: PhantomJS 1.x includes `callee` as one of `testFn`'s own properties,
31
+ // but then returns `undefined` as the property descriptor for `callee`. As a
32
+ // workaround, we perform an otherwise unnecessary type-check for `propDesc`,
33
+ // and then filter it out if it's not an object as it should be.
34
+ if (typeof propDesc !== 'object')
35
+ return true;
36
+
37
+ return !propDesc.configurable;
38
+ });
39
+
40
+ // Cache `Function` properties
41
+ var call = Function.prototype.call,
42
+ apply = Function.prototype.apply;
43
+
44
+ /**
45
+ * ### .addChainableMethod(ctx, name, method, chainingBehavior)
46
+ *
47
+ * Adds a method to an object, such that the method can also be chained.
48
+ *
49
+ * utils.addChainableMethod(chai.Assertion.prototype, 'foo', function (str) {
50
+ * var obj = utils.flag(this, 'object');
51
+ * new chai.Assertion(obj).to.be.equal(str);
52
+ * });
53
+ *
54
+ * Can also be accessed directly from `chai.Assertion`.
55
+ *
56
+ * chai.Assertion.addChainableMethod('foo', fn, chainingBehavior);
57
+ *
58
+ * The result can then be used as both a method assertion, executing both `method` and
59
+ * `chainingBehavior`, or as a language chain, which only executes `chainingBehavior`.
60
+ *
61
+ * expect(fooStr).to.be.foo('bar');
62
+ * expect(fooStr).to.be.foo.equal('foo');
63
+ *
64
+ * @param {Object} ctx object to which the method is added
65
+ * @param {String} name of method to add
66
+ * @param {Function} method function to be used for `name`, when called
67
+ * @param {Function} chainingBehavior function to be called every time the property is accessed
68
+ * @namespace Utils
69
+ * @name addChainableMethod
70
+ * @api public
71
+ */
72
+
73
+ module.exports = function addChainableMethod(ctx, name, method, chainingBehavior) {
74
+ if (typeof chainingBehavior !== 'function') {
75
+ chainingBehavior = function () { };
76
+ }
77
+
78
+ var chainableBehavior = {
79
+ method: method
80
+ , chainingBehavior: chainingBehavior
81
+ };
82
+
83
+ // save the methods so we can overwrite them later, if we need to.
84
+ if (!ctx.__methods) {
85
+ ctx.__methods = {};
86
+ }
87
+ ctx.__methods[name] = chainableBehavior;
88
+
89
+ Object.defineProperty(ctx, name,
90
+ { get: function chainableMethodGetter() {
91
+ chainableBehavior.chainingBehavior.call(this);
92
+
93
+ var chainableMethodWrapper = function () {
94
+ // Setting the `ssfi` flag to `chainableMethodWrapper` causes this
95
+ // function to be the starting point for removing implementation
96
+ // frames from the stack trace of a failed assertion.
97
+ //
98
+ // However, we only want to use this function as the starting point if
99
+ // the `lockSsfi` flag isn't set.
100
+ //
101
+ // If the `lockSsfi` flag is set, then this assertion is being
102
+ // invoked from inside of another assertion. In this case, the `ssfi`
103
+ // flag has already been set by the outer assertion.
104
+ //
105
+ // Note that overwriting a chainable method merely replaces the saved
106
+ // methods in `ctx.__methods` instead of completely replacing the
107
+ // overwritten assertion. Therefore, an overwriting assertion won't
108
+ // set the `ssfi` or `lockSsfi` flags.
109
+ if (!flag(this, 'lockSsfi')) {
110
+ flag(this, 'ssfi', chainableMethodWrapper);
111
+ }
112
+
113
+ var result = chainableBehavior.method.apply(this, arguments);
114
+ if (result !== undefined) {
115
+ return result;
116
+ }
117
+
118
+ var newAssertion = new chai.Assertion();
119
+ transferFlags(this, newAssertion);
120
+ return newAssertion;
121
+ };
122
+
123
+ addLengthGuard(chainableMethodWrapper, name, true);
124
+
125
+ // Use `Object.setPrototypeOf` if available
126
+ if (canSetPrototype) {
127
+ // Inherit all properties from the object by replacing the `Function` prototype
128
+ var prototype = Object.create(this);
129
+ // Restore the `call` and `apply` methods from `Function`
130
+ prototype.call = call;
131
+ prototype.apply = apply;
132
+ Object.setPrototypeOf(chainableMethodWrapper, prototype);
133
+ }
134
+ // Otherwise, redefine all properties (slow!)
135
+ else {
136
+ var asserterNames = Object.getOwnPropertyNames(ctx);
137
+ asserterNames.forEach(function (asserterName) {
138
+ if (excludeNames.indexOf(asserterName) !== -1) {
139
+ return;
140
+ }
141
+
142
+ var pd = Object.getOwnPropertyDescriptor(ctx, asserterName);
143
+ Object.defineProperty(chainableMethodWrapper, asserterName, pd);
144
+ });
145
+ }
146
+
147
+ transferFlags(this, chainableMethodWrapper);
148
+ return proxify(chainableMethodWrapper);
149
+ }
150
+ , configurable: true
151
+ });
152
+ };
@@ -0,0 +1,60 @@
1
+ var fnLengthDesc = Object.getOwnPropertyDescriptor(function () {}, 'length');
2
+
3
+ /*!
4
+ * Chai - addLengthGuard utility
5
+ * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
6
+ * MIT Licensed
7
+ */
8
+
9
+ /**
10
+ * ### .addLengthGuard(fn, assertionName, isChainable)
11
+ *
12
+ * Define `length` as a getter on the given uninvoked method assertion. The
13
+ * getter acts as a guard against chaining `length` directly off of an uninvoked
14
+ * method assertion, which is a problem because it references `function`'s
15
+ * built-in `length` property instead of Chai's `length` assertion. When the
16
+ * getter catches the user making this mistake, it throws an error with a
17
+ * helpful message.
18
+ *
19
+ * There are two ways in which this mistake can be made. The first way is by
20
+ * chaining the `length` assertion directly off of an uninvoked chainable
21
+ * method. In this case, Chai suggests that the user use `lengthOf` instead. The
22
+ * second way is by chaining the `length` assertion directly off of an uninvoked
23
+ * non-chainable method. Non-chainable methods must be invoked prior to
24
+ * chaining. In this case, Chai suggests that the user consult the docs for the
25
+ * given assertion.
26
+ *
27
+ * If the `length` property of functions is unconfigurable, then return `fn`
28
+ * without modification.
29
+ *
30
+ * Note that in ES6, the function's `length` property is configurable, so once
31
+ * support for legacy environments is dropped, Chai's `length` property can
32
+ * replace the built-in function's `length` property, and this length guard will
33
+ * no longer be necessary. In the mean time, maintaining consistency across all
34
+ * environments is the priority.
35
+ *
36
+ * @param {Function} fn
37
+ * @param {String} assertionName
38
+ * @param {Boolean} isChainable
39
+ * @namespace Utils
40
+ * @name addLengthGuard
41
+ */
42
+
43
+ module.exports = function addLengthGuard (fn, assertionName, isChainable) {
44
+ if (!fnLengthDesc.configurable) return fn;
45
+
46
+ Object.defineProperty(fn, 'length', {
47
+ get: function () {
48
+ if (isChainable) {
49
+ throw Error('Invalid Chai property: ' + assertionName + '.length. Due' +
50
+ ' to a compatibility issue, "length" cannot directly follow "' +
51
+ assertionName + '". Use "' + assertionName + '.lengthOf" instead.');
52
+ }
53
+
54
+ throw Error('Invalid Chai property: ' + assertionName + '.length. See' +
55
+ ' docs for proper usage of "' + assertionName + '".');
56
+ }
57
+ });
58
+
59
+ return fn;
60
+ };
@@ -0,0 +1,68 @@
1
+ /*!
2
+ * Chai - addMethod utility
3
+ * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
4
+ * MIT Licensed
5
+ */
6
+
7
+ var addLengthGuard = require('./addLengthGuard');
8
+ var chai = require('../../chai');
9
+ var flag = require('./flag');
10
+ var proxify = require('./proxify');
11
+ var transferFlags = require('./transferFlags');
12
+
13
+ /**
14
+ * ### .addMethod(ctx, name, method)
15
+ *
16
+ * Adds a method to the prototype of an object.
17
+ *
18
+ * utils.addMethod(chai.Assertion.prototype, 'foo', function (str) {
19
+ * var obj = utils.flag(this, 'object');
20
+ * new chai.Assertion(obj).to.be.equal(str);
21
+ * });
22
+ *
23
+ * Can also be accessed directly from `chai.Assertion`.
24
+ *
25
+ * chai.Assertion.addMethod('foo', fn);
26
+ *
27
+ * Then can be used as any other assertion.
28
+ *
29
+ * expect(fooStr).to.be.foo('bar');
30
+ *
31
+ * @param {Object} ctx object to which the method is added
32
+ * @param {String} name of method to add
33
+ * @param {Function} method function to be used for name
34
+ * @namespace Utils
35
+ * @name addMethod
36
+ * @api public
37
+ */
38
+
39
+ module.exports = function addMethod(ctx, name, method) {
40
+ var methodWrapper = function () {
41
+ // Setting the `ssfi` flag to `methodWrapper` causes this function to be the
42
+ // starting point for removing implementation frames from the stack trace of
43
+ // a failed assertion.
44
+ //
45
+ // However, we only want to use this function as the starting point if the
46
+ // `lockSsfi` flag isn't set.
47
+ //
48
+ // If the `lockSsfi` flag is set, then either this assertion has been
49
+ // overwritten by another assertion, or this assertion is being invoked from
50
+ // inside of another assertion. In the first case, the `ssfi` flag has
51
+ // already been set by the overwriting assertion. In the second case, the
52
+ // `ssfi` flag has already been set by the outer assertion.
53
+ if (!flag(this, 'lockSsfi')) {
54
+ flag(this, 'ssfi', methodWrapper);
55
+ }
56
+
57
+ var result = method.apply(this, arguments);
58
+ if (result !== undefined)
59
+ return result;
60
+
61
+ var newAssertion = new chai.Assertion();
62
+ transferFlags(this, newAssertion);
63
+ return newAssertion;
64
+ };
65
+
66
+ addLengthGuard(methodWrapper, name, false);
67
+ ctx[name] = proxify(methodWrapper, name);
68
+ };
@@ -0,0 +1,72 @@
1
+ /*!
2
+ * Chai - addProperty utility
3
+ * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
4
+ * MIT Licensed
5
+ */
6
+
7
+ var chai = require('../../chai');
8
+ var flag = require('./flag');
9
+ var isProxyEnabled = require('./isProxyEnabled');
10
+ var transferFlags = require('./transferFlags');
11
+
12
+ /**
13
+ * ### .addProperty(ctx, name, getter)
14
+ *
15
+ * Adds a property to the prototype of an object.
16
+ *
17
+ * utils.addProperty(chai.Assertion.prototype, 'foo', function () {
18
+ * var obj = utils.flag(this, 'object');
19
+ * new chai.Assertion(obj).to.be.instanceof(Foo);
20
+ * });
21
+ *
22
+ * Can also be accessed directly from `chai.Assertion`.
23
+ *
24
+ * chai.Assertion.addProperty('foo', fn);
25
+ *
26
+ * Then can be used as any other assertion.
27
+ *
28
+ * expect(myFoo).to.be.foo;
29
+ *
30
+ * @param {Object} ctx object to which the property is added
31
+ * @param {String} name of property to add
32
+ * @param {Function} getter function to be used for name
33
+ * @namespace Utils
34
+ * @name addProperty
35
+ * @api public
36
+ */
37
+
38
+ module.exports = function addProperty(ctx, name, getter) {
39
+ getter = getter === undefined ? function () {} : getter;
40
+
41
+ Object.defineProperty(ctx, name,
42
+ { get: function propertyGetter() {
43
+ // Setting the `ssfi` flag to `propertyGetter` causes this function to
44
+ // be the starting point for removing implementation frames from the
45
+ // stack trace of a failed assertion.
46
+ //
47
+ // However, we only want to use this function as the starting point if
48
+ // the `lockSsfi` flag isn't set and proxy protection is disabled.
49
+ //
50
+ // If the `lockSsfi` flag is set, then either this assertion has been
51
+ // overwritten by another assertion, or this assertion is being invoked
52
+ // from inside of another assertion. In the first case, the `ssfi` flag
53
+ // has already been set by the overwriting assertion. In the second
54
+ // case, the `ssfi` flag has already been set by the outer assertion.
55
+ //
56
+ // If proxy protection is enabled, then the `ssfi` flag has already been
57
+ // set by the proxy getter.
58
+ if (!isProxyEnabled() && !flag(this, 'lockSsfi')) {
59
+ flag(this, 'ssfi', propertyGetter);
60
+ }
61
+
62
+ var result = getter.call(this);
63
+ if (result !== undefined)
64
+ return result;
65
+
66
+ var newAssertion = new chai.Assertion();
67
+ transferFlags(this, newAssertion);
68
+ return newAssertion;
69
+ }
70
+ , configurable: true
71
+ });
72
+ };
@@ -0,0 +1,31 @@
1
+ /*!
2
+ * Chai - compareByInspect utility
3
+ * Copyright(c) 2011-2016 Jake Luer <jake@alogicalparadox.com>
4
+ * MIT Licensed
5
+ */
6
+
7
+ /*!
8
+ * Module dependencies
9
+ */
10
+
11
+ var inspect = require('./inspect');
12
+
13
+ /**
14
+ * ### .compareByInspect(mixed, mixed)
15
+ *
16
+ * To be used as a compareFunction with Array.prototype.sort. Compares elements
17
+ * using inspect instead of default behavior of using toString so that Symbols
18
+ * and objects with irregular/missing toString can still be sorted without a
19
+ * TypeError.
20
+ *
21
+ * @param {Mixed} first element to compare
22
+ * @param {Mixed} second element to compare
23
+ * @returns {Number} -1 if 'a' should come before 'b'; otherwise 1
24
+ * @name compareByInspect
25
+ * @namespace Utils
26
+ * @api public
27
+ */
28
+
29
+ module.exports = function compareByInspect(a, b) {
30
+ return inspect(a) < inspect(b) ? -1 : 1;
31
+ };