source: frontend/node_modules/css-select-base-adapter/readme.md

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 2.3 KB
Line 
1# css-select-base-adapter
2
3Provides some base functions needed by a
4[`css-select`](https://github.com/fb55/css-select) adapter so that you don't
5have to implement the whole thing.
6
7## usage
8
9`npm install css-select-base-adapter --save`
10
11```javascript
12var baseAdapter = require('css-select-base-adapter');
13
14var myAdapter = {
15 // your partial implementation here
16};
17
18// get an adapter with everything needed by css-select
19var adapter = baseAdapter(myAdapter);
20
21// use adapter with css-select...
22```
23
24## how it works
25
26An adapter for `css-select` requires the following functions to be implemented:
27
28```
29isTag, existsOne, getAttributeValue, getChildren, getName, getParent,
30getSiblings, getText, hasAttrib, removeSubsets, findAll, findOne
31```
32
33You can pass this module a more minimal implementation and it will return a full
34adapter that fills in any missing functions, provided that you implement at
35least:
36
37```
38isTag, getAttributeValue, getChildren, getName, getParent, getText
39```
40
41If you provide any of the other methods required of an adapter, the base adapter
42will use your implementation instead of its own.
43
44See the
45[`css-select` readme](https://github.com/fb55/css-select/blob/master/README.md)
46for more information on the required function signatures.
47
48## license
49
50MIT License
51
52Copyright (c) 2018 Nik Coughlin
53
54Permission is hereby granted, free of charge, to any person obtaining a copy
55of this software and associated documentation files (the "Software"), to deal
56in the Software without restriction, including without limitation the rights
57to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
58copies of the Software, and to permit persons to whom the Software is
59furnished to do so, subject to the following conditions:
60
61The above copyright notice and this permission notice shall be included in all
62copies or substantial portions of the Software.
63
64THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
65IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
66FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
67AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
68LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
69OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
70SOFTWARE.
Note: See TracBrowser for help on using the repository browser.