Socket
Socket
Sign inDemoInstall

@shapediver/sdk.sdtf-geometry

Package Overview
Dependencies
Maintainers
5
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shapediver/sdk.sdtf-geometry - npm Package Compare versions

Comparing version 1.4.0 to 1.4.1

14

dist/ISdtfGeometryTypes.d.ts

@@ -12,8 +12,2 @@ export interface SdtfGeometryArcType {

plane: SdtfGeometryPlaneType;
/**
* Holds the following data in this order:
* * Box: X-min, X-max
* * Box: Y-min, Y-max
* * Box: Z-min, Z-max
*/
extents: [

@@ -38,3 +32,2 @@ [

}
/** Holds the _real_ and _imaginary_ parts of a complex. */
export type SdtfGeometryComplexType = [number, number];

@@ -62,8 +55,2 @@ export interface SdtfGeometryConeType {

export type SdtfGeometryMatrixType = number[][];
/**
* Holds the following data in this order:
* * Origin
* * X-Axis
* * Y-Axis
*/
export type SdtfGeometryPlaneType = [

@@ -79,3 +66,2 @@ SdtfGeometryPoint3d,

export type SdtfGeometryPolylineType = SdtfGeometryPoint3d[];
/** Holds the _origin_ and _direction_ of a ray. */
export type SdtfGeometryRayType = [SdtfGeometryPoint3d, SdtfGeometryVector3d];

@@ -82,0 +68,0 @@ export interface SdtfGeometryRectangleType {

import { SdtfGeometryArcType, SdtfGeometryBoundingBoxType, SdtfGeometryBoxType, SdtfGeometryCircleType, SdtfGeometryComplexType, SdtfGeometryConeType, SdtfGeometryCylinderType, SdtfGeometryEllipseType, SdtfGeometryInterval2Type, SdtfGeometryIntervalType, SdtfGeometryLineType, SdtfGeometryMatrixType, SdtfGeometryPlaneType, SdtfGeometryPoint2d, SdtfGeometryPoint3d, SdtfGeometryPoint4d, SdtfGeometryPointType, SdtfGeometryPolylineType, SdtfGeometryRayType, SdtfGeometryRectangleType, SdtfGeometrySphereType, SdtfGeometryTorusType, SdtfGeometryTransformListType, SdtfGeometryTransformType, SdtfGeometryVector2d, SdtfGeometryVector3d, SdtfGeometryVector4d, SdtfGeometryVectorType } from "./ISdtfGeometryTypes";
export declare class SdtfGeometryTypeGuard {
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_ARC`. */
static assertArc(value: unknown): asserts value is SdtfGeometryArcType;
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_ARC`. */
static isArc(value: unknown): value is SdtfGeometryArcType;
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_BOUNDING_BOX`. */
static assertBoundingBox(value: unknown): asserts value is SdtfGeometryBoundingBoxType;
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_BOUNDING_BOX`. */
static isBoundingBox(value: unknown): value is SdtfGeometryBoundingBoxType;
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_BOX`. */
static assertBox(value: unknown): asserts value is SdtfGeometryBoxType;
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_BOX`. */
static isBox(value: unknown): value is SdtfGeometryBoxType;
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_CIRCLE`. */
static assertCircle(value: unknown): asserts value is SdtfGeometryCircleType;
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_CIRCLE`. */
static isCircle(value: unknown): value is SdtfGeometryCircleType;
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_COMPLEX`. */
static assertComplex(value: unknown): asserts value is SdtfGeometryComplexType;
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_COMPLEX`. */
static isComplex(value: unknown): value is SdtfGeometryComplexType;
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_CONE`. */
static assertCone(value: unknown): asserts value is SdtfGeometryConeType;
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_CONE`. */
static isCone(value: unknown): value is SdtfGeometryConeType;
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_CYLINDER`. */
static assertCylinder(value: unknown): asserts value is SdtfGeometryCylinderType;
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_CYLINDER`. */
static isCylinder(value: unknown): value is SdtfGeometryCylinderType;
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_ELLIPSE`. */
static assertEllipse(value: unknown): asserts value is SdtfGeometryEllipseType;
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_ELLIPSE`. */
static isEllipse(value: unknown): value is SdtfGeometryEllipseType;
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_INTERVAL`. */
static assertInterval(value: unknown): asserts value is SdtfGeometryIntervalType;
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_INTERVAL`. */
static isInterval(value: unknown): value is SdtfGeometryIntervalType;
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_INTERVAL2`. */
static assertInterval2(value: unknown): asserts value is SdtfGeometryInterval2Type;
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_INTERVAL2`. */
static isInterval2(value: unknown): value is SdtfGeometryInterval2Type;
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_LINE`. */
static assertLine(value: unknown): asserts value is SdtfGeometryLineType;
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_LINE`. */
static isLine(value: unknown): value is SdtfGeometryLineType;
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_MATRIX`. */
static assertMatrix(value: unknown): asserts value is SdtfGeometryMatrixType;
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_MATRIX`. */
static isMatrix(value: unknown): value is SdtfGeometryMatrixType;
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_PLANE`. */
static assertPlane(value: unknown): asserts value is SdtfGeometryPlaneType;
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_PLANE`. */
static isPlane(value: unknown): value is SdtfGeometryPlaneType;
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_POINT`. */
static assertPoint(value: unknown): asserts value is SdtfGeometryPointType;
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_POINT` with 2, 3 or 4 elements. */
static isPoint(value: unknown): value is SdtfGeometryPointType;
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_POINT`. */
static assertPoint2d(value: unknown): asserts value is SdtfGeometryPoint2d;
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_POINT` with 2 elements. */
static isPoint2d(value: unknown): value is SdtfGeometryPoint2d;
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_POINT`. */
static assertPoint3d(value: unknown): asserts value is SdtfGeometryPoint3d;
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_POINT` with 3 elements. */
static isPoint3d(value: unknown): value is SdtfGeometryPoint3d;
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_POINT`. */
static assertPoint4d(value: unknown): asserts value is SdtfGeometryPoint4d;
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_POINT` with 4 elements. */
static isPoint4d(value: unknown): value is SdtfGeometryPoint4d;
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_POLYLINE`. */
static assertPolyline(value: unknown): asserts value is SdtfGeometryPolylineType;
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_POLYLINE`. */
static isPolyline(value: unknown): value is SdtfGeometryPolylineType;
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_RAY`. */
static assertRay(value: unknown): asserts value is SdtfGeometryRayType;
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_RAY`. */
static isRay(value: unknown): value is SdtfGeometryRayType;
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_RECTANGLE`. */
static assertRectangle(value: unknown): asserts value is SdtfGeometryRectangleType;
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_RECTANGLE`. */
static isRectangle(value: unknown): value is SdtfGeometryRectangleType;
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_SPHERE`. */
static assertSphere(value: unknown): asserts value is SdtfGeometrySphereType;
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_SPHERE`. */
static isSphere(value: unknown): value is SdtfGeometrySphereType;
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_TORUS`. */
static assertTorus(value: unknown): asserts value is SdtfGeometryTorusType;
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_TORUS`. */
static isTorus(value: unknown): value is SdtfGeometryTorusType;
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_TRANSFORM`. */
static assertTransform(value: unknown): asserts value is SdtfGeometryTransformType;
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_TRANSFORM`. */
static isTransform(value: unknown): value is SdtfGeometryTransformType;
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_TRANSFORM_LIST`. */
static assertTransformList(value: unknown): asserts value is SdtfGeometryTransformListType;
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_TRANSFORM_LIST`. */
static isTransformList(value: unknown): value is SdtfGeometryTransformListType;
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_VECTOR`. */
static assertVector(value: unknown): asserts value is SdtfGeometryVectorType;
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_VECTOR` with 2, 3 or 4 elements. */
static isVector(value: unknown): value is SdtfGeometryVectorType;
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_VECTOR`. */
static assertVector2d(value: unknown): asserts value is SdtfGeometryVector2d;
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_VECTOR` with 2 elements. */
static isVector2d(value: unknown): value is SdtfGeometryVector2d;
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_VECTOR`. */
static assertVector3d(value: unknown): asserts value is SdtfGeometryVector3d;
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_VECTOR` with 3 elements. */
static isVector3d(value: unknown): value is SdtfGeometryVector3d;
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_VECTOR`. */
static assertVector4d(value: unknown): asserts value is SdtfGeometryVector4d;
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_VECTOR` with 4 elements. */
static isVector4d(value: unknown): value is SdtfGeometryVector4d;
}
//# sourceMappingURL=SdtfGeometryTypeGuard.d.ts.map

@@ -6,3 +6,2 @@ "use strict";

class SdtfGeometryTypeGuard {
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_ARC`. */
static assertArc(value) {

@@ -12,3 +11,2 @@ if (!this.isArc(value))

}
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_ARC`. */
static isArc(value) {

@@ -20,3 +18,2 @@ return (0, sdk_sdtf_core_1.isDataObject)(value) &&

}
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_BOUNDING_BOX`. */
static assertBoundingBox(value) {

@@ -26,3 +23,2 @@ if (!this.isBoundingBox(value))

}
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_BOUNDING_BOX`. */
static isBoundingBox(value) {

@@ -33,3 +29,2 @@ return (0, sdk_sdtf_core_1.isDataObject)(value) &&

}
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_BOX`. */
static assertBox(value) {

@@ -39,3 +34,2 @@ if (!this.isBox(value))

}
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_BOX`. */
static isBox(value) {

@@ -48,3 +42,2 @@ return (0, sdk_sdtf_core_1.isDataObject)(value) &&

}
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_CIRCLE`. */
static assertCircle(value) {

@@ -54,3 +47,2 @@ if (!this.isCircle(value))

}
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_CIRCLE`. */
static isCircle(value) {

@@ -61,3 +53,2 @@ return (0, sdk_sdtf_core_1.isDataObject)(value) &&

}
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_COMPLEX`. */
static assertComplex(value) {

@@ -67,7 +58,5 @@ if (!this.isComplex(value))

}
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_COMPLEX`. */
static isComplex(value) {
return (0, sdk_sdtf_core_1.isNumberArray)(value) && value.length === 2;
}
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_CONE`. */
static assertCone(value) {

@@ -77,3 +66,2 @@ if (!this.isCone(value))

}
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_CONE`. */
static isCone(value) {

@@ -85,3 +73,2 @@ return (0, sdk_sdtf_core_1.isDataObject)(value) &&

}
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_CYLINDER`. */
static assertCylinder(value) {

@@ -91,3 +78,2 @@ if (!this.isCylinder(value))

}
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_CYLINDER`. */
static isCylinder(value) {

@@ -98,3 +84,2 @@ return (0, sdk_sdtf_core_1.isDataObject)(value) &&

}
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_ELLIPSE`. */
static assertEllipse(value) {

@@ -104,3 +89,2 @@ if (!this.isEllipse(value))

}
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_ELLIPSE`. */
static isEllipse(value) {

@@ -112,3 +96,2 @@ return (0, sdk_sdtf_core_1.isDataObject)(value) &&

}
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_INTERVAL`. */
static assertInterval(value) {

@@ -118,7 +101,5 @@ if (!this.isInterval(value))

}
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_INTERVAL`. */
static isInterval(value) {
return (0, sdk_sdtf_core_1.isNumberArray)(value) && value.length === 2;
}
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_INTERVAL2`. */
static assertInterval2(value) {

@@ -128,3 +109,2 @@ if (!this.isInterval2(value))

}
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_INTERVAL2`. */
static isInterval2(value) {

@@ -135,3 +115,2 @@ return (0, sdk_sdtf_core_1.isDataObject)(value) &&

}
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_LINE`. */
static assertLine(value) {

@@ -141,3 +120,2 @@ if (!this.isLine(value))

}
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_LINE`. */
static isLine(value) {

@@ -149,3 +127,2 @@ return Array.isArray(value) &&

}
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_MATRIX`. */
static assertMatrix(value) {

@@ -155,11 +132,8 @@ if (!this.isMatrix(value))

}
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_MATRIX`. */
static isMatrix(value) {
if (!Array.isArray(value))
return false;
// All sub-arrays must have the same length with numeric content
const nItems = value[0].length;
return value.every(v => (0, sdk_sdtf_core_1.isNumberArray)(v) && v.length === nItems);
}
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_PLANE`. */
static assertPlane(value) {

@@ -169,3 +143,2 @@ if (!this.isPlane(value))

}
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_PLANE`. */
static isPlane(value) {

@@ -178,3 +151,2 @@ return Array.isArray(value) &&

}
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_POINT`. */
static assertPoint(value) {

@@ -184,7 +156,5 @@ if (!this.isPoint(value))

}
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_POINT` with 2, 3 or 4 elements. */
static isPoint(value) {
return (0, sdk_sdtf_core_1.isNumberArray)(value) && (value.length === 2 || value.length === 3 || value.length === 4);
}
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_POINT`. */
static assertPoint2d(value) {

@@ -194,7 +164,5 @@ if (!this.isPoint2d(value))

}
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_POINT` with 2 elements. */
static isPoint2d(value) {
return (0, sdk_sdtf_core_1.isNumberArray)(value) && value.length === 2;
}
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_POINT`. */
static assertPoint3d(value) {

@@ -204,7 +172,5 @@ if (!this.isPoint3d(value))

}
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_POINT` with 3 elements. */
static isPoint3d(value) {
return (0, sdk_sdtf_core_1.isNumberArray)(value) && value.length === 3;
}
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_POINT`. */
static assertPoint4d(value) {

@@ -214,7 +180,5 @@ if (!this.isPoint4d(value))

}
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_POINT` with 4 elements. */
static isPoint4d(value) {
return (0, sdk_sdtf_core_1.isNumberArray)(value) && value.length === 4;
}
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_POLYLINE`. */
static assertPolyline(value) {

@@ -224,7 +188,5 @@ if (!this.isPolyline(value))

}
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_POLYLINE`. */
static isPolyline(value) {
return Array.isArray(value) && value.every(v => this.isPoint3d(v));
}
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_RAY`. */
static assertRay(value) {

@@ -234,3 +196,2 @@ if (!this.isRay(value))

}
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_RAY`. */
static isRay(value) {

@@ -242,3 +203,2 @@ return Array.isArray(value) &&

}
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_RECTANGLE`. */
static assertRectangle(value) {

@@ -248,3 +208,2 @@ if (!this.isRectangle(value))

}
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_RECTANGLE`. */
static isRectangle(value) {

@@ -256,3 +215,2 @@ return (0, sdk_sdtf_core_1.isDataObject)(value) &&

}
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_SPHERE`. */
static assertSphere(value) {

@@ -262,3 +220,2 @@ if (!this.isSphere(value))

}
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_SPHERE`. */
static isSphere(value) {

@@ -269,3 +226,2 @@ return (0, sdk_sdtf_core_1.isDataObject)(value) &&

}
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_TORUS`. */
static assertTorus(value) {

@@ -275,3 +231,2 @@ if (!this.isTorus(value))

}
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_TORUS`. */
static isTorus(value) {

@@ -283,3 +238,2 @@ return (0, sdk_sdtf_core_1.isDataObject)(value) &&

}
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_TRANSFORM`. */
static assertTransform(value) {

@@ -289,7 +243,5 @@ if (!this.isTransform(value))

}
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_TRANSFORM`. */
static isTransform(value) {
return Array.isArray(value) && value.length === 4 && value.every(v => (0, sdk_sdtf_core_1.isNumberArray)(v) && v.length === 4);
}
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_TRANSFORM_LIST`. */
static assertTransformList(value) {

@@ -299,7 +251,5 @@ if (!this.isTransformList(value))

}
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_TRANSFORM_LIST`. */
static isTransformList(value) {
return Array.isArray(value) && value.every(v => this.isTransform(v));
}
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_VECTOR`. */
static assertVector(value) {

@@ -309,7 +259,5 @@ if (!this.isVector(value))

}
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_VECTOR` with 2, 3 or 4 elements. */
static isVector(value) {
return (0, sdk_sdtf_core_1.isNumberArray)(value) && (value.length === 2 || value.length === 3 || value.length === 4);
}
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_VECTOR`. */
static assertVector2d(value) {

@@ -319,7 +267,5 @@ if (!this.isVector2d(value))

}
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_VECTOR` with 2 elements. */
static isVector2d(value) {
return (0, sdk_sdtf_core_1.isNumberArray)(value) && value.length === 2;
}
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_VECTOR`. */
static assertVector3d(value) {

@@ -329,7 +275,5 @@ if (!this.isVector3d(value))

}
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_VECTOR` with 3 elements. */
static isVector3d(value) {
return (0, sdk_sdtf_core_1.isNumberArray)(value) && value.length === 3;
}
/** Runtime check that raises an error when the given value is not of type `SdtfGeometryTypeHintName.GEOMETRY_VECTOR`. */
static assertVector4d(value) {

@@ -339,3 +283,2 @@ if (!this.isVector4d(value))

}
/** Returns `true` when the given value is of type `SdtfGeometryTypeHintName.GEOMETRY_VECTOR` with 4 elements. */
static isVector4d(value) {

@@ -342,0 +285,0 @@ return (0, sdk_sdtf_core_1.isNumberArray)(value) && value.length === 4;

2

dist/SdtfGeometryTypeReader.js

@@ -23,7 +23,5 @@ "use strict";

const typeHint = (_a = component.typeHint) === null || _a === void 0 ? void 0 : _a.name;
// Make sure that the component consists of valid data
if (!this.validator.validateComponent(typeHint, component.value, component.accessor)) {
throw new sdk_sdtf_core_1.SdtfError(`Cannot read value of type '${typeHint}': Invalid component.`);
}
// All values of a geometry type are stored inside the JSON content.
switch (typeHint) {

@@ -30,0 +28,0 @@ case sdk_sdtf_core_1.SdtfGeometryTypeHintName.GEOMETRY_ARC:

import { ISdtfReadableAccessor, ISdtfWriteableAccessor, SdtfGeometryTypeHintName } from "@shapediver/sdk.sdtf-core";
/** Validates values that are of a type hint supported by this integration. */
export declare class SdtfGeometryTypeValidator {
/**
* Validates the given component of the given type.
* @throws {@link SdtfError} when the given type is not supported.
*/
validateComponent(typeHint: SdtfGeometryTypeHintName, value?: unknown, accessor?: ISdtfReadableAccessor | ISdtfWriteableAccessor): boolean;
}
//# sourceMappingURL=SdtfGeometryTypeValidator.d.ts.map

@@ -6,8 +6,3 @@ "use strict";

const SdtfGeometryTypeGuard_1 = require("./SdtfGeometryTypeGuard");
/** Validates values that are of a type hint supported by this integration. */
class SdtfGeometryTypeValidator {
/**
* Validates the given component of the given type.
* @throws {@link SdtfError} when the given type is not supported.
*/
validateComponent(typeHint, value, accessor) {

@@ -14,0 +9,0 @@ switch (typeHint) {

5

dist/SdtfGeometryTypeWriter.js

@@ -14,3 +14,2 @@ "use strict";

const typeHint = (_a = component.typeHint) === null || _a === void 0 ? void 0 : _a.name;
// All values of a geometry type are stored inside the JSON content.
switch (typeHint) {

@@ -45,3 +44,3 @@ case sdk_sdtf_core_1.SdtfGeometryTypeHintName.GEOMETRY_ARC:

case sdk_sdtf_core_1.SdtfGeometryTypeHintName.GEOMETRY_VECTOR4D:
delete component.accessor; // Stored in JSON content
delete component.accessor;
break;

@@ -51,3 +50,2 @@ default:

}
// Make sure that the component consists of valid data
if (!this.validator.validateComponent(typeHint, component.value, component.accessor)) {

@@ -58,3 +56,2 @@ throw new sdk_sdtf_core_1.SdtfError(`Cannot write component of type '${typeHint}': Invalid component.`);

postProcessComponents(components) {
// Nothing to do here
}

@@ -61,0 +58,0 @@ }

{
"name": "@shapediver/sdk.sdtf-geometry",
"version": "1.4.0",
"version": "1.4.1",
"description": "Extension containing sdTF geometry types",

@@ -41,9 +41,9 @@ "keywords": [

"dependencies": {
"@shapediver/sdk.sdtf-core": "~1.4.0"
"@shapediver/sdk.sdtf-core": "~1.4.1"
},
"devDependencies": {
"jest": "~29.5.0",
"lerna": "~6.6.2",
"typescript": "~4.9.5"
"jest": "~29.7.0",
"lerna": "~7.4.2",
"typescript": "~5.3.3"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc