# get-properties-from-schema **Repository Path**: mirrors_regular/get-properties-from-schema ## Basic Information - **Project Name**: get-properties-from-schema - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-25 - **Last Updated**: 2026-07-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ``` const getProperties = require('get-properties-from-schema') const schema = { "description": "A 2D/3D rectangle or box with position, anchor (origin) and rotation", "type": "object", "required": [ "size", "type" ], "properties": { "type": { "const": "transform" }, "size": { "$ref": "#/definitions/vec3f" } }, "definitions": { "vec3f": { "type": "object", "required": [ "x", "y" ], "properties": { "x": { "type": "number" }, "y": { "type": "number" } } } } } test('get root properties', t => { const props = getProperties(schema) t.equal(props.length, 2) t.deepEqual(props[0], {key: 'type', value: {"const": "transform"}}) t.deepEqual(props[1], {key: 'size', value: schema.definitions.vec3f}) console.log(props[1]) const size_props = getProperties(props[1].value) t.equal(size_props.length, 2) t.deepEqual(size_props[0], {key: 'x', value: {type: 'number'}}) t.deepEqual(size_props[1], {key: 'y', value: {type: 'number'}}) t.end() }) ``` Note: Only local $ref references are supported