@aeriajs/common 0.0.73 → 0.0.75

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.
@@ -0,0 +1 @@
1
+ export declare const arraysIntersect: <T extends any[] | readonly any[]>(subject: T | string, arr: T | undefined) => boolean;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.arraysIntersects = void 0;
4
- const arraysIntersects = (subject, arr) => {
3
+ exports.arraysIntersect = void 0;
4
+ const arraysIntersect = (subject, arr) => {
5
5
  if (!arr) {
6
6
  return false;
7
7
  }
@@ -9,4 +9,4 @@ const arraysIntersects = (subject, arr) => {
9
9
  ? subject.some((e) => arr.includes(e))
10
10
  : arr.includes(subject);
11
11
  };
12
- exports.arraysIntersects = arraysIntersects;
12
+ exports.arraysIntersect = arraysIntersect;
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- export const arraysIntersects = (subject, arr) => {
2
+ export const arraysIntersect = (subject, arr) => {
3
3
  if (!arr) {
4
4
  return false;
5
5
  }
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.evaluateCondition = void 0;
4
- const arraysIntersects_js_1 = require("./arraysIntersects.js");
4
+ const arraysIntersect_js_1 = require("./arraysIntersect.js");
5
5
  const equalOrContains = (term1, term2) => {
6
6
  if (Array.isArray(term1) && Array.isArray(term2)) {
7
- return (0, arraysIntersects_js_1.arraysIntersects)(term1, term2);
7
+ return (0, arraysIntersect_js_1.arraysIntersect)(term1, term2);
8
8
  }
9
9
  if (Array.isArray(term1)) {
10
10
  return term1.includes(term2);
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
- import { arraysIntersects } from "./arraysIntersects.mjs";
2
+ import { arraysIntersect } from "./arraysIntersect.mjs";
3
3
  const equalOrContains = (term1, term2) => {
4
4
  if (Array.isArray(term1) && Array.isArray(term2)) {
5
- return arraysIntersects(term1, term2);
5
+ return arraysIntersect(term1, term2);
6
6
  }
7
7
  if (Array.isArray(term1)) {
8
8
  return term1.includes(term2);
@@ -1,2 +1,2 @@
1
1
  import type { Description } from '@aeriajs/types';
2
- export declare const freshItem: (description: Pick<Description, 'properties' | 'freshItem'>) => Record<string, any>;
2
+ export declare const freshItem: (description: Pick<Description, "properties" | "freshItem">) => Record<string, any>;
@@ -1,2 +1,2 @@
1
1
  import type { JsonSchema } from '@aeriajs/types';
2
- export declare const getMissingProperties: (what: Record<string, any>, schema: Omit<JsonSchema, '$id'>, required: JsonSchema['required']) => string[];
2
+ export declare const getMissingProperties: (what: Record<string, any>, schema: Omit<JsonSchema, "$id">, required: JsonSchema["required"]) => string[];
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export * from './arraysIntersects.js';
1
+ export * from './arraysIntersect.js';
2
2
  export * from './checkForUndefined.js';
3
3
  export * from './convertConditionToQuery.js';
4
4
  export * from './date.js';
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./arraysIntersects.js"), exports);
17
+ __exportStar(require("./arraysIntersect.js"), exports);
18
18
  __exportStar(require("./checkForUndefined.js"), exports);
19
19
  __exportStar(require("./convertConditionToQuery.js"), exports);
20
20
  __exportStar(require("./date.js"), exports);
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- export * from "./arraysIntersects.mjs";
2
+ export * from "./arraysIntersect.mjs";
3
3
  export * from "./checkForUndefined.mjs";
4
4
  export * from "./convertConditionToQuery.mjs";
5
5
  export * from "./date.mjs";
package/dist/isGranted.js CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isGranted = void 0;
4
- const arraysIntersects_js_1 = require("./arraysIntersects.js");
4
+ const arraysIntersect_js_1 = require("./arraysIntersect.js");
5
5
  const isGranted = (condition, token) => {
6
6
  if (Array.isArray(condition)) {
7
7
  return token.authenticated
8
- ? (0, arraysIntersects_js_1.arraysIntersects)(token.roles, condition)
8
+ ? (0, arraysIntersect_js_1.arraysIntersect)(token.roles, condition)
9
9
  : condition.includes('unauthenticated');
10
10
  }
11
11
  switch (condition) {
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
- import { arraysIntersects } from "./arraysIntersects.mjs";
2
+ import { arraysIntersect } from "./arraysIntersect.mjs";
3
3
  export const isGranted = (condition, token) => {
4
4
  if (Array.isArray(condition)) {
5
- return token.authenticated ? arraysIntersects(token.roles, condition) : condition.includes("unauthenticated");
5
+ return token.authenticated ? arraysIntersect(token.roles, condition) : condition.includes("unauthenticated");
6
6
  }
7
7
  switch (condition) {
8
8
  case false:
@@ -1,2 +1,2 @@
1
1
  import type { Description } from '@aeriajs/types';
2
- export declare const isRequired: (propName: string, required: NonNullable<Description['required']>, subject: any) => boolean;
2
+ export declare const isRequired: (propName: string, required: NonNullable<Description["required"]>, subject: any) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeriajs/common",
3
- "version": "0.0.73",
3
+ "version": "0.0.75",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -31,7 +31,7 @@
31
31
  "bson": "^6.5.0"
32
32
  },
33
33
  "peerDependencies": {
34
- "@aeriajs/types": "^0.0.64",
34
+ "@aeriajs/types": "^0.0.65",
35
35
  "bson": "^6.5.0"
36
36
  },
37
37
  "scripts": {
@@ -1 +0,0 @@
1
- export declare const arraysIntersects: <T extends any[] | readonly any[]>(subject: T | string, arr: T | undefined) => boolean;