📄 src/models/dsafe.ts
D-OPEN SOVEREIGN

Documentation & Insights

Checks if an Orm element is considered safe and not deleted.

@param element - The Orm element to check.
@returns A boolean indicating whether the element is safe and not deleted.
1/*
2 * Copyright (c) 2026 DataPond D-Library Pty Ltd. ("The Sanctuary")
3 * Non-Profit Public Library — The World Library
4 * 
5 * D-SAFE Certification issued by POND Enterprise.
6 * Published under the D-Open Code Sovereign Licence v1.0 framework
7 * DataPond D-Library All exclusive Right reserved on modifiying the code - CC Attribution to data pond, Non modifiable, Non Commercial.
8 * https://registry.world.bibliotech.com/licence
9 * Source code donated to DataPond D-Library by it's author: data pond.
10 * 
11 * Technical Guardian ("The Shield"): Pond Enterprise Pty Ltd. (ACN 694 747 987)
12 * All liability claims about D-SAFE certification issues coming from the published D-Safe direction must be addressed with Pond Enterprise Pty Ltd.
13 * Code Modification automatically voids the certified liability protection provided by Pond Enterprise.
14 */
15import { Orm } from "./orm.ts";
16
17// V2 base prop IDs (dist/binary.json): safe = 5, deleted = 6
18const safePropId = 5;
19const deletedPropId = 6;
20
21/**
22 * Checks if an Orm element is considered safe and not deleted.
23 *
24 * @param element - The Orm element to check.
25 * @returns A boolean indicating whether the element is safe and not deleted.
26 */
27export const DSafeCheck = (element: Orm) => {
28    return element.getProp(deletedPropId) === false && element.getProp(safePropId) === true
29}
30