not-node 6.4.0 → 6.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/fields/filter.js +16 -0
- package/src/form/transformers/xss.js +1 -1
package/package.json
CHANGED
package/src/fields/filter.js
CHANGED
|
@@ -37,7 +37,9 @@ const {
|
|
|
37
37
|
* }
|
|
38
38
|
*/
|
|
39
39
|
|
|
40
|
+
/** @type {string} */
|
|
40
41
|
const OPERATOR_EXCLUDE = "-";
|
|
42
|
+
/** @type {string} */
|
|
41
43
|
const SPECIAL_SET_PREFIX = "@";
|
|
42
44
|
|
|
43
45
|
//system special fields sets aka system specials
|
|
@@ -61,6 +63,20 @@ const SPECIAL_SET_ID_UUID = "id";
|
|
|
61
63
|
* @property {boolean} [auth] authenticated user initiated action
|
|
62
64
|
*/
|
|
63
65
|
|
|
66
|
+
/**
|
|
67
|
+
* Fields lists definition and include/exclude operations
|
|
68
|
+
* Supported standart special sets:
|
|
69
|
+
* - * - ID, id, keys(schema)
|
|
70
|
+
* - safe - schema keys that is safe for user and action signature
|
|
71
|
+
* - unsafe - salt, password, session
|
|
72
|
+
* - timestamps - createdAt, updatedAt
|
|
73
|
+
* - ownage - owner, ownerId, ownerModel if presented in schema
|
|
74
|
+
* - versioning - __version, __versions, __closed, __latest, __v
|
|
75
|
+
* - ID - {modelName}ID incremental universaly not unique
|
|
76
|
+
* - id - UUID universaly "unique"
|
|
77
|
+
*
|
|
78
|
+
* @class notFieldsFilter
|
|
79
|
+
*/
|
|
64
80
|
class notFieldsFilter {
|
|
65
81
|
static #USER_DEFINED_SETS = {};
|
|
66
82
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const xss = require("xss");
|
|
2
|
-
module.exports = (val) => xss(val);
|
|
2
|
+
module.exports = (val) => (typeof val === "string" ? xss(val) : val);
|