@fluid-experimental/property-properties 2.0.0-internal.3.0.2 → 2.0.0-internal.3.2.0
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/README.md +1 -0
- package/dist/containerSerializer.d.ts.map +1 -1
- package/dist/containerSerializer.js +5 -5
- package/dist/containerSerializer.js.map +1 -1
- package/dist/enableValidations.js.map +1 -1
- package/dist/index.d.ts +19 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/properties/abstractStaticCollectionProperty.d.ts +10 -10
- package/dist/properties/abstractStaticCollectionProperty.d.ts.map +1 -1
- package/dist/properties/abstractStaticCollectionProperty.js +70 -53
- package/dist/properties/abstractStaticCollectionProperty.js.map +1 -1
- package/dist/properties/arrayProperty.d.ts.map +1 -1
- package/dist/properties/arrayProperty.js +152 -103
- package/dist/properties/arrayProperty.js.map +1 -1
- package/dist/properties/baseProperty.d.ts +4 -4
- package/dist/properties/baseProperty.d.ts.map +1 -1
- package/dist/properties/baseProperty.js +69 -47
- package/dist/properties/baseProperty.js.map +1 -1
- package/dist/properties/boolProperty.d.ts.map +1 -1
- package/dist/properties/boolProperty.js +3 -3
- package/dist/properties/boolProperty.js.map +1 -1
- package/dist/properties/containerProperty.d.ts +8 -8
- package/dist/properties/containerProperty.d.ts.map +1 -1
- package/dist/properties/containerProperty.js +33 -26
- package/dist/properties/containerProperty.js.map +1 -1
- package/dist/properties/enumArrayProperty.d.ts.map +1 -1
- package/dist/properties/enumArrayProperty.js +14 -14
- package/dist/properties/enumArrayProperty.js.map +1 -1
- package/dist/properties/enumProperty.d.ts.map +1 -1
- package/dist/properties/enumProperty.js +17 -17
- package/dist/properties/enumProperty.js.map +1 -1
- package/dist/properties/floatProperties.js +4 -4
- package/dist/properties/floatProperties.js.map +1 -1
- package/dist/properties/index.d.ts +23 -23
- package/dist/properties/index.d.ts.map +1 -1
- package/dist/properties/index.js.map +1 -1
- package/dist/properties/indexedCollectionBaseProperty.d.ts.map +1 -1
- package/dist/properties/indexedCollectionBaseProperty.js +47 -37
- package/dist/properties/indexedCollectionBaseProperty.js.map +1 -1
- package/dist/properties/intProperties.d.ts.map +1 -1
- package/dist/properties/intProperties.js +10 -10
- package/dist/properties/intProperties.js.map +1 -1
- package/dist/properties/lazyLoadedProperties.js.map +1 -1
- package/dist/properties/mapProperty.d.ts.map +1 -1
- package/dist/properties/mapProperty.js +21 -17
- package/dist/properties/mapProperty.js.map +1 -1
- package/dist/properties/namedNodeProperty.d.ts.map +1 -1
- package/dist/properties/namedNodeProperty.js +3 -3
- package/dist/properties/namedNodeProperty.js.map +1 -1
- package/dist/properties/namedProperty.d.ts.map +1 -1
- package/dist/properties/namedProperty.js +7 -5
- package/dist/properties/namedProperty.js.map +1 -1
- package/dist/properties/nodeProperty.d.ts.map +1 -1
- package/dist/properties/nodeProperty.js +5 -3
- package/dist/properties/nodeProperty.js.map +1 -1
- package/dist/properties/primitiveTypeCasts.d.ts.map +1 -1
- package/dist/properties/primitiveTypeCasts.js +9 -9
- package/dist/properties/primitiveTypeCasts.js.map +1 -1
- package/dist/properties/referenceArrayProperty.d.ts.map +1 -1
- package/dist/properties/referenceArrayProperty.js +31 -25
- package/dist/properties/referenceArrayProperty.js.map +1 -1
- package/dist/properties/referenceMapProperty.d.ts.map +1 -1
- package/dist/properties/referenceMapProperty.js +18 -18
- package/dist/properties/referenceMapProperty.js.map +1 -1
- package/dist/properties/referenceProperty.d.ts.map +1 -1
- package/dist/properties/referenceProperty.js +33 -29
- package/dist/properties/referenceProperty.js.map +1 -1
- package/dist/properties/setProperty.d.ts.map +1 -1
- package/dist/properties/setProperty.js +31 -29
- package/dist/properties/setProperty.js.map +1 -1
- package/dist/properties/stringProperty.d.ts.map +1 -1
- package/dist/properties/stringProperty.js +56 -40
- package/dist/properties/stringProperty.js.map +1 -1
- package/dist/properties/uintProperties.js +5 -5
- package/dist/properties/uintProperties.js.map +1 -1
- package/dist/properties/valueArrayProperty.d.ts +1 -1
- package/dist/properties/valueArrayProperty.d.ts.map +1 -1
- package/dist/properties/valueArrayProperty.js +30 -29
- package/dist/properties/valueArrayProperty.js.map +1 -1
- package/dist/properties/valueMapProperty.d.ts.map +1 -1
- package/dist/properties/valueMapProperty.js +31 -29
- package/dist/properties/valueMapProperty.js.map +1 -1
- package/dist/properties/valueProperty.d.ts.map +1 -1
- package/dist/properties/valueProperty.js +11 -9
- package/dist/properties/valueProperty.js.map +1 -1
- package/dist/propertyFactory.d.ts.map +1 -1
- package/dist/propertyFactory.js +309 -252
- package/dist/propertyFactory.js.map +1 -1
- package/dist/propertyTemplate.d.ts +17 -17
- package/dist/propertyTemplate.d.ts.map +1 -1
- package/dist/propertyTemplate.js +64 -45
- package/dist/propertyTemplate.js.map +1 -1
- package/dist/propertyTemplateWrapper.d.ts.map +1 -1
- package/dist/propertyTemplateWrapper.js +40 -25
- package/dist/propertyTemplateWrapper.js.map +1 -1
- package/dist/propertyUtils.d.ts.map +1 -1
- package/dist/propertyUtils.js.map +1 -1
- package/dist/test/properties/arrayProperty.spec.js +566 -490
- package/dist/test/properties/arrayProperty.spec.js.map +1 -1
- package/dist/test/properties/baseProperty.spec.js +293 -280
- package/dist/test/properties/baseProperty.spec.js.map +1 -1
- package/dist/test/properties/containerProperty.spec.js +100 -94
- package/dist/test/properties/containerProperty.spec.js.map +1 -1
- package/dist/test/properties/customArrayProperty.spec.js +174 -147
- package/dist/test/properties/customArrayProperty.spec.js.map +1 -1
- package/dist/test/properties/enumArrayProperty.spec.js +67 -63
- package/dist/test/properties/enumArrayProperty.spec.js.map +1 -1
- package/dist/test/properties/enumProperty.spec.js +115 -97
- package/dist/test/properties/enumProperty.spec.js.map +1 -1
- package/dist/test/properties/float32.spec.js +5 -5
- package/dist/test/properties/float32.spec.js.map +1 -1
- package/dist/test/properties/int64ArrayProperty.spec.js +157 -93
- package/dist/test/properties/int64ArrayProperty.spec.js.map +1 -1
- package/dist/test/properties/int64MapProperty.spec.js +185 -166
- package/dist/test/properties/int64MapProperty.spec.js.map +1 -1
- package/dist/test/properties/int64Property.spec.js +109 -109
- package/dist/test/properties/int64Property.spec.js.map +1 -1
- package/dist/test/properties/isLeafNode.spec.js +75 -76
- package/dist/test/properties/isLeafNode.spec.js.map +1 -1
- package/dist/test/properties/mapProperty.spec.js +571 -531
- package/dist/test/properties/mapProperty.spec.js.map +1 -1
- package/dist/test/properties/namedNodeProperty.spec.js +31 -31
- package/dist/test/properties/namedNodeProperty.spec.js.map +1 -1
- package/dist/test/properties/nodeProperty.spec.js +805 -795
- package/dist/test/properties/nodeProperty.spec.js.map +1 -1
- package/dist/test/properties/referenceProperty.spec.js +729 -679
- package/dist/test/properties/referenceProperty.spec.js.map +1 -1
- package/dist/test/properties/relationshipProperty.spec.js +16 -16
- package/dist/test/properties/relationshipProperty.spec.js.map +1 -1
- package/dist/test/properties/setProperty.spec.js +288 -227
- package/dist/test/properties/setProperty.spec.js.map +1 -1
- package/dist/test/properties/stringProperty.spec.js +326 -318
- package/dist/test/properties/stringProperty.spec.js.map +1 -1
- package/dist/test/properties/uint64Property.spec.js +46 -36
- package/dist/test/properties/uint64Property.spec.js.map +1 -1
- package/dist/test/properties/valueMapProperty.spec.js +259 -246
- package/dist/test/properties/valueMapProperty.spec.js.map +1 -1
- package/dist/test/properties/valueProperty.spec.js +49 -43
- package/dist/test/properties/valueProperty.spec.js.map +1 -1
- package/dist/test/propertyFactory.spec.js +2038 -1631
- package/dist/test/propertyFactory.spec.js.map +1 -1
- package/dist/test/propertyTemplateWrapper.spec.js +72 -102
- package/dist/test/propertyTemplateWrapper.spec.js.map +1 -1
- package/dist/test/propertyUtils.spec.js +22 -21
- package/dist/test/propertyUtils.spec.js.map +1 -1
- package/dist/test/reversibleChangeset.spec.js +857 -703
- package/dist/test/reversibleChangeset.spec.js.map +1 -1
- package/dist/test/setup.js +5 -5
- package/dist/test/setup.js.map +1 -1
- package/dist/test/tsconfig.tsbuildinfo +1 -1
- package/dist/test/utils.spec.js +1334 -1144
- package/dist/test/utils.spec.js.map +1 -1
- package/dist/test/validation/badMissingSemverInTypeid.js +20 -20
- package/dist/test/validation/badMissingSemverInTypeid.js.map +1 -1
- package/dist/test/validation/badPrimitiveTypeid.js +12 -12
- package/dist/test/validation/badPrimitiveTypeid.js.map +1 -1
- package/dist/test/validation/goodColorId.js +91 -91
- package/dist/test/validation/goodColorId.js.map +1 -1
- package/dist/test/validation/goodColorPalette.js +4 -4
- package/dist/test/validation/goodColorPalette.js.map +1 -1
- package/dist/test/validation/goodPointId.js +20 -20
- package/dist/test/validation/goodPointId.js.map +1 -1
- package/dist/test/validation/reversibleChangeSetTestData.js +23841 -2
- package/dist/test/validation/reversibleChangeSetTestData.js.map +1 -1
- package/lib/containerSerializer.d.ts.map +1 -1
- package/lib/containerSerializer.js +5 -5
- package/lib/containerSerializer.js.map +1 -1
- package/lib/enableValidations.js.map +1 -1
- package/lib/index.d.ts +19 -19
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +19 -19
- package/lib/index.js.map +1 -1
- package/lib/properties/abstractStaticCollectionProperty.d.ts +10 -10
- package/lib/properties/abstractStaticCollectionProperty.d.ts.map +1 -1
- package/lib/properties/abstractStaticCollectionProperty.js +70 -53
- package/lib/properties/abstractStaticCollectionProperty.js.map +1 -1
- package/lib/properties/arrayProperty.d.ts.map +1 -1
- package/lib/properties/arrayProperty.js +152 -103
- package/lib/properties/arrayProperty.js.map +1 -1
- package/lib/properties/baseProperty.d.ts +4 -4
- package/lib/properties/baseProperty.d.ts.map +1 -1
- package/lib/properties/baseProperty.js +73 -51
- package/lib/properties/baseProperty.js.map +1 -1
- package/lib/properties/boolProperty.d.ts.map +1 -1
- package/lib/properties/boolProperty.js +3 -3
- package/lib/properties/boolProperty.js.map +1 -1
- package/lib/properties/containerProperty.d.ts +8 -8
- package/lib/properties/containerProperty.d.ts.map +1 -1
- package/lib/properties/containerProperty.js +33 -26
- package/lib/properties/containerProperty.js.map +1 -1
- package/lib/properties/enumArrayProperty.d.ts.map +1 -1
- package/lib/properties/enumArrayProperty.js +14 -14
- package/lib/properties/enumArrayProperty.js.map +1 -1
- package/lib/properties/enumProperty.d.ts.map +1 -1
- package/lib/properties/enumProperty.js +17 -17
- package/lib/properties/enumProperty.js.map +1 -1
- package/lib/properties/floatProperties.js +4 -4
- package/lib/properties/floatProperties.js.map +1 -1
- package/lib/properties/index.d.ts +23 -23
- package/lib/properties/index.d.ts.map +1 -1
- package/lib/properties/index.js +23 -23
- package/lib/properties/index.js.map +1 -1
- package/lib/properties/indexedCollectionBaseProperty.d.ts.map +1 -1
- package/lib/properties/indexedCollectionBaseProperty.js +47 -37
- package/lib/properties/indexedCollectionBaseProperty.js.map +1 -1
- package/lib/properties/intProperties.d.ts.map +1 -1
- package/lib/properties/intProperties.js +10 -10
- package/lib/properties/intProperties.js.map +1 -1
- package/lib/properties/lazyLoadedProperties.js.map +1 -1
- package/lib/properties/mapProperty.d.ts.map +1 -1
- package/lib/properties/mapProperty.js +21 -17
- package/lib/properties/mapProperty.js.map +1 -1
- package/lib/properties/namedNodeProperty.d.ts.map +1 -1
- package/lib/properties/namedNodeProperty.js +3 -3
- package/lib/properties/namedNodeProperty.js.map +1 -1
- package/lib/properties/namedProperty.d.ts.map +1 -1
- package/lib/properties/namedProperty.js +7 -5
- package/lib/properties/namedProperty.js.map +1 -1
- package/lib/properties/nodeProperty.d.ts.map +1 -1
- package/lib/properties/nodeProperty.js +5 -3
- package/lib/properties/nodeProperty.js.map +1 -1
- package/lib/properties/primitiveTypeCasts.d.ts.map +1 -1
- package/lib/properties/primitiveTypeCasts.js +9 -9
- package/lib/properties/primitiveTypeCasts.js.map +1 -1
- package/lib/properties/referenceArrayProperty.d.ts.map +1 -1
- package/lib/properties/referenceArrayProperty.js +31 -25
- package/lib/properties/referenceArrayProperty.js.map +1 -1
- package/lib/properties/referenceMapProperty.d.ts.map +1 -1
- package/lib/properties/referenceMapProperty.js +18 -18
- package/lib/properties/referenceMapProperty.js.map +1 -1
- package/lib/properties/referenceProperty.d.ts.map +1 -1
- package/lib/properties/referenceProperty.js +33 -29
- package/lib/properties/referenceProperty.js.map +1 -1
- package/lib/properties/setProperty.d.ts.map +1 -1
- package/lib/properties/setProperty.js +31 -29
- package/lib/properties/setProperty.js.map +1 -1
- package/lib/properties/stringProperty.d.ts.map +1 -1
- package/lib/properties/stringProperty.js +56 -40
- package/lib/properties/stringProperty.js.map +1 -1
- package/lib/properties/uintProperties.js +5 -5
- package/lib/properties/uintProperties.js.map +1 -1
- package/lib/properties/valueArrayProperty.d.ts +1 -1
- package/lib/properties/valueArrayProperty.d.ts.map +1 -1
- package/lib/properties/valueArrayProperty.js +30 -29
- package/lib/properties/valueArrayProperty.js.map +1 -1
- package/lib/properties/valueMapProperty.d.ts.map +1 -1
- package/lib/properties/valueMapProperty.js +31 -29
- package/lib/properties/valueMapProperty.js.map +1 -1
- package/lib/properties/valueProperty.d.ts.map +1 -1
- package/lib/properties/valueProperty.js +11 -9
- package/lib/properties/valueProperty.js.map +1 -1
- package/lib/propertyFactory.d.ts.map +1 -1
- package/lib/propertyFactory.js +309 -252
- package/lib/propertyFactory.js.map +1 -1
- package/lib/propertyTemplate.d.ts +17 -17
- package/lib/propertyTemplate.d.ts.map +1 -1
- package/lib/propertyTemplate.js +64 -45
- package/lib/propertyTemplate.js.map +1 -1
- package/lib/propertyTemplateWrapper.d.ts.map +1 -1
- package/lib/propertyTemplateWrapper.js +40 -25
- package/lib/propertyTemplateWrapper.js.map +1 -1
- package/lib/propertyUtils.d.ts.map +1 -1
- package/lib/propertyUtils.js.map +1 -1
- package/package.json +28 -28
- package/src/index.d.ts +2750 -2681
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propertyTemplateWrapper.js","sourceRoot":"","sources":["../src/propertyTemplateWrapper.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,SAAS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,CAAC,CAAC;oBAC7D,IAAI,cAAc,EAAE;wBAChB,UAAU,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;qBACnC;iBACJ;aACJ;YAED,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;gBACvB,KAAK,CAAC,SAAS,CAAC,GAAG,UAAU,CAAC;aACjC;QACL,CAAC,CAAC;QAEF,kBAAkB,CAAC,gBAAgB,EAAE,iBAAiB,EAAE,YAAY,CAAC,CAAC;QACtE,kBAAkB,CAAC,gBAAgB,EAAE,iBAAiB,EAAE,WAAW,CAAC,CAAC;IACzE,CAAC;CACJ","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Declaration of the PropertyTemplateWrapper module.\n * PropertyTemplateWrapper is used to wrap a property template and perform internal optimizations.\n */\nconst { MSG } = require('@fluid-experimental/property-common').constants;\nconst _ = require('lodash');\nconst { ContainerProperty } = require('./properties/containerProperty');\n\nconst reservedTypesWithoutTemplates = {\n 'BaseProperty': true,\n 'ContainerProperty': true,\n 'NodeProperty': true,\n 'Enum': true,\n};\n/**\n * Utility function that validates if the typeid is a reserved type without a template.\n * @param {string} in_typeid - The typeid to validate.\n * @return {boolean} True if the typeid is a reserved type without a template, false otherwise.\n */\nconst hasAssociatedTemplate = (in_typeid) => {\n return !reservedTypesWithoutTemplates[in_typeid];\n};\n\nexport class PropertyTemplateWrapper {\n /**\n * Constructor for creating a PropertyTemplateWrapper based on the given template.\n * @param {PropertyTemplate} in_remoteTemplate - A property template\n * @param {string} in_scope - The scope of the template\n *\n * @constructor\n * @package\n * @alias property-properties.PropertyTemplateWrapper\n * @category Properties\n */\n constructor(in_remoteTemplate, in_scope) {\n /** The property template this object is wrapping */\n this._propertyTemplate = in_remoteTemplate;\n\n /**\n * A property template created from this.propertyTemplate with the addition of all information\n * from templates this template inherits from.\n */\n this._compiledPropertyTemplate = undefined;\n\n /* What type of base object is created for this template */\n this._objectCreationType = undefined;\n\n /* The scope of this template */\n this._scope = in_scope;\n }\n\n /**\n * To get the property template that this is wrapping.\n * @return {property-properties.PropertyTemplate} The template this wrapper contains\n * @package\n */\n getPropertyTemplate() {\n return this._propertyTemplate;\n }\n\n /**\n * Gets the compiled template or creates it then returns it.\n * @param {property-properties.PropertyFactory} in_propertyFactory - The assosiated PropertyFactory.\n * @return {property-properties.PropertyTemplate} The compiled template\n * A compiled template is the template which is actually used for creating objects.\n * It has all information from parent Templates, and other changes.\n * @package\n */\n getCompiledTemplate(in_propertyFactory) {\n if (this._compiledPropertyTemplate === undefined) {\n this._compiledPropertyTemplate = this._contructCompiledTemplate(in_propertyFactory);\n }\n return this._compiledPropertyTemplate;\n }\n\n /**\n * Returns if the compiled template has been created.\n * @return {boolean} if the compiled template has been created\n * @package\n */\n hasCompiledTemplate() {\n return !!this._compiledPropertyTemplate;\n }\n\n /**\n * To get the creation type of the template this wraps.\n * @return {string} A typeid which represents the creation type of this template\n * @package\n */\n getCreationType() {\n return this._objectCreationType;\n }\n\n /**\n * If current creation type is undefined, sets it to in_typeid if in_typeid is a creation type.\n * If current creation type is defined, throws if in_typeid is a creation type.\n *\n * @param {string} in_typeid - A typeid\n * @package\n */\n setCreationType(in_typeid) {\n // This function could be moved somewhere else, an enum could be made if this information is widely needed.\n const isCreationType = (typeid) => {\n const creationTypes =\n ['ContainerProperty', 'NodeProperty', 'Enum', 'BinaryProperty', 'Binary', 'RepositoryReferenceProperty'];\n return creationTypes.includes(typeid);\n };\n\n if (isCreationType(in_typeid)) {\n const currentCreationType = this._objectCreationType;\n if (currentCreationType === undefined) {\n this._objectCreationType = in_typeid;\n } else if (currentCreationType !== in_typeid) {\n throw new Error(MSG.ONLY_ONE_CREATION_TYPE + currentCreationType + ', ' + in_typeid);\n }\n }\n }\n\n /**\n * Contructs the compiled template from the template this wraps\n * @param {property-properties.PropertyFactory} in_propertyFactory - The associated PropertyFactory.\n * @return {property-properties.PropertyTemplate} The compiled template\n * A compiled template is the template which is actually used for creating objects.\n * It has all information from parent Templates, and other changes.\n * @package\n */\n _contructCompiledTemplate(in_propertyFactory) {\n const originalTemplate = this.getPropertyTemplate();\n\n this.setCreationType(originalTemplate.typeid);\n\n /* Because we treat templates and contructor functions for base types the same way :( */\n if (_.isFunction(originalTemplate)) {\n return originalTemplate;\n }\n\n let parentTemplateIds = originalTemplate.inherits;\n\n /* template.inherits can be a string, if so convert it to array of strings */\n if (typeof parentTemplateIds === 'string') {\n parentTemplateIds = [parentTemplateIds];\n }\n\n /* Cloning the original template to avoid modifying it */\n const template = originalTemplate.clone();\n\n /* Copy the proccesed list of parents to not modify the original */\n const typeInheritence = parentTemplateIds ? parentTemplateIds.slice() : [];\n\n /* Look ups to efficiently check what properties/constants parents have */\n const parentsPropertiesById = {};\n const parentsConstantsById = {};\n\n if (parentTemplateIds !== undefined) {\n for (let i = 0; i < parentTemplateIds.length; ++i) {\n const parentTemplateId = parentTemplateIds[i];\n this.setCreationType(parentTemplateId);\n\n if (hasAssociatedTemplate(parentTemplateId)) {\n const parentTemplateWrapper = in_propertyFactory._getWrapper(parentTemplateId, undefined, this._scope);\n if (parentTemplateWrapper) {\n const parentTemplate = parentTemplateWrapper.getCompiledTemplate(in_propertyFactory);\n const parentCreationType = parentTemplateWrapper.getCreationType();\n\n if (parentCreationType !== 'ContainerProperty') {\n this.setCreationType(parentCreationType);\n }\n\n if (parentTemplate.inherits) {\n typeInheritence.concat(parentTemplateId);\n }\n\n /* Fills parentsPropertiesById and makes sure there are no two properties or constants with the same id */\n if (parentTemplate.hasNestedProperties()) {\n const parentProperties = parentTemplate.properties;\n for (let j = 0; j < parentProperties.length; ++j) {\n const parentProperty = parentProperties[j];\n /* Two parents has child property with same id */\n if (parentsPropertiesById[parentProperty.id] || parentsConstantsById[parentProperty.id]) {\n throw new Error(MSG.OVERWRITING_ID + parentProperty.id);\n }\n parentsPropertiesById[parentProperty.id] = parentProperty;\n }\n }\n\n /* Fills parentsConsantsById and makes sure there are no two properties or constants with the same id */\n if (parentTemplate.hasNestedConstants()) {\n const parentConstants = parentTemplate.constants;\n for (let j = 0; j < parentConstants.length; ++j) {\n const parentConstant = parentConstants[j];\n /* Two parents has child property with same id */\n if (parentsConstantsById[parentConstant.id] || parentsPropertiesById[parentConstant.id]) {\n throw new Error(MSG.OVERWRITING_ID + parentConstant.id);\n }\n parentsConstantsById[parentConstant.id] = parentConstant;\n }\n }\n }\n }\n }\n }\n\n if (this._objectCreationType === undefined) {\n this.setCreationType('ContainerProperty');\n }\n\n /* Merges properties from parents into the properties of the child */\n const constructSubProperties = (in_template, in_parentsPropertiesById, fieldName) => {\n const propertyKeys = Object.keys(in_parentsPropertiesById);\n\n if (in_template[fieldName] === undefined && propertyKeys.length !== 0) {\n in_template[fieldName] = [];\n }\n\n const properties = in_template[fieldName] || [];\n\n for (let i = 0; i < properties.length; ++i) {\n const property = properties[i];\n const id = property.id;\n if (in_parentsPropertiesById[id]) {\n this._mergeProperty(property, in_parentsPropertiesById[id]);\n delete in_parentsPropertiesById[id];\n }\n }\n\n for (let i = 0; i < propertyKeys.length; ++i) {\n const insertProperty = in_parentsPropertiesById[propertyKeys[i]];\n if (insertProperty) {\n properties.push(insertProperty);\n }\n }\n\n if (properties.length > 0) {\n template[fieldName] = properties;\n }\n };\n\n constructSubProperties(template, parentsPropertiesById, 'properties');\n constructSubProperties(template, parentsConstantsById, 'constants');\n\n if (typeInheritence.length > 0) {\n template.inherits = typeInheritence;\n }\n\n return template;\n }\n\n /**\n * A helper function which merges a child and parent property.\n * The changes are applied directly to the in_childProperty.\n * @param {object} in_childProperty - The child's property defition.\n * @param {object} in_parentProperty - The parent's property defition.\n * @package\n */\n _mergeProperty(in_childProperty, in_parentProperty) {\n const mergeField = (child, parent, fieldName, defaultValue) => {\n if (child[fieldName] === undefined) {\n if (parent[fieldName] !== undefined) {\n child[fieldName] = parent[fieldName];\n }\n } else if (child[fieldName] !== parent[fieldName] &&\n (child[fieldName] !== defaultValue || parent[fieldName] !== undefined)) {\n throw new Error(MSG.OVERRIDEN_PROP_MUST_HAVE_SAME_FIELD_VALUES_AS_BASE_TYPE + fieldName +\n ' as the base type: ' + child.id + ': ' + child[fieldName] + ' != ' + parent[fieldName]);\n }\n };\n\n mergeField(in_childProperty, in_parentProperty, 'context', 'single');\n mergeField(in_childProperty, in_parentProperty, 'contextKeyType', 'string');\n mergeField(in_childProperty, in_parentProperty, 'length', 0);\n mergeField(in_childProperty, in_parentProperty, 'optional', false);\n mergeField(in_childProperty, in_parentProperty, 'typeid', undefined);\n\n if (in_parentProperty.typedValue !== undefined) {\n if (in_childProperty.typedValue === undefined) {\n in_childProperty.typedValue = in_parentProperty.typedValue;\n }\n }\n\n if (in_parentProperty.value !== undefined) {\n if (in_childProperty.value === undefined) {\n in_childProperty.value = in_parentProperty.value;\n }\n }\n\n const mergeSubProperties = (child, parent, fieldName) => {\n const parentPropertiesById = {};\n let parentProperties = parent[fieldName];\n let properties = child[fieldName] || [];\n if (parentProperties) {\n for (let j = 0; j < parentProperties.length; ++j) {\n const parentProperty = parentProperties[j];\n parentPropertiesById[parentProperty.id] = parentProperty;\n }\n\n for (let i = 0; i < properties.length; ++i) {\n const property = properties[i];\n const id = property.id;\n if (parentPropertiesById[id]) {\n this._mergeProperty(property, parentPropertiesById[id]);\n delete parentPropertiesById[id];\n }\n }\n\n const propertyKeys = Object.keys(parentPropertiesById);\n for (let i = 0; i < propertyKeys.length; ++i) {\n const insertProperty = parentPropertiesById[propertyKeys[i]];\n if (insertProperty) {\n properties.push(insertProperty);\n }\n }\n }\n\n if (properties.length > 0) {\n child[fieldName] = properties;\n }\n };\n\n mergeSubProperties(in_childProperty, in_parentProperty, 'properties');\n mergeSubProperties(in_childProperty, in_parentProperty, 'constants');\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"propertyTemplateWrapper.js","sourceRoot":"","sources":["../src/propertyTemplateWrapper.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,EAA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B,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC7D,IAAI,cAAc,EAAE;wBACnB,UAAU,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;qBAChC;iBACD;aACD;YAED,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;gBAC1B,KAAK,CAAC,SAAS,CAAC,GAAG,UAAU,CAAC;aAC9B;QACF,CAAC,CAAC;QAEF,kBAAkB,CAAC,gBAAgB,EAAE,iBAAiB,EAAE,YAAY,CAAC,CAAC;QACtE,kBAAkB,CAAC,gBAAgB,EAAE,iBAAiB,EAAE,WAAW,CAAC,CAAC;IACtE,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Declaration of the PropertyTemplateWrapper module.\n * PropertyTemplateWrapper is used to wrap a property template and perform internal optimizations.\n */\nconst { MSG } = require(\"@fluid-experimental/property-common\").constants;\nconst _ = require(\"lodash\");\nconst { ContainerProperty } = require(\"./properties/containerProperty\");\n\nconst reservedTypesWithoutTemplates = {\n\tBaseProperty: true,\n\tContainerProperty: true,\n\tNodeProperty: true,\n\tEnum: true,\n};\n/**\n * Utility function that validates if the typeid is a reserved type without a template.\n * @param {string} in_typeid - The typeid to validate.\n * @return {boolean} True if the typeid is a reserved type without a template, false otherwise.\n */\nconst hasAssociatedTemplate = (in_typeid) => {\n\treturn !reservedTypesWithoutTemplates[in_typeid];\n};\n\nexport class PropertyTemplateWrapper {\n\t/**\n\t * Constructor for creating a PropertyTemplateWrapper based on the given template.\n\t * @param {PropertyTemplate} in_remoteTemplate - A property template\n\t * @param {string} in_scope - The scope of the template\n\t *\n\t * @constructor\n\t * @package\n\t * @alias property-properties.PropertyTemplateWrapper\n\t * @category Properties\n\t */\n\tconstructor(in_remoteTemplate, in_scope) {\n\t\t/** The property template this object is wrapping */\n\t\tthis._propertyTemplate = in_remoteTemplate;\n\n\t\t/**\n\t\t * A property template created from this.propertyTemplate with the addition of all information\n\t\t * from templates this template inherits from.\n\t\t */\n\t\tthis._compiledPropertyTemplate = undefined;\n\n\t\t/* What type of base object is created for this template */\n\t\tthis._objectCreationType = undefined;\n\n\t\t/* The scope of this template */\n\t\tthis._scope = in_scope;\n\t}\n\n\t/**\n\t * To get the property template that this is wrapping.\n\t * @return {property-properties.PropertyTemplate} The template this wrapper contains\n\t * @package\n\t */\n\tgetPropertyTemplate() {\n\t\treturn this._propertyTemplate;\n\t}\n\n\t/**\n\t * Gets the compiled template or creates it then returns it.\n\t * @param {property-properties.PropertyFactory} in_propertyFactory - The assosiated PropertyFactory.\n\t * @return {property-properties.PropertyTemplate} The compiled template\n\t * A compiled template is the template which is actually used for creating objects.\n\t * It has all information from parent Templates, and other changes.\n\t * @package\n\t */\n\tgetCompiledTemplate(in_propertyFactory) {\n\t\tif (this._compiledPropertyTemplate === undefined) {\n\t\t\tthis._compiledPropertyTemplate = this._contructCompiledTemplate(in_propertyFactory);\n\t\t}\n\t\treturn this._compiledPropertyTemplate;\n\t}\n\n\t/**\n\t * Returns if the compiled template has been created.\n\t * @return {boolean} if the compiled template has been created\n\t * @package\n\t */\n\thasCompiledTemplate() {\n\t\treturn !!this._compiledPropertyTemplate;\n\t}\n\n\t/**\n\t * To get the creation type of the template this wraps.\n\t * @return {string} A typeid which represents the creation type of this template\n\t * @package\n\t */\n\tgetCreationType() {\n\t\treturn this._objectCreationType;\n\t}\n\n\t/**\n\t * If current creation type is undefined, sets it to in_typeid if in_typeid is a creation type.\n\t * If current creation type is defined, throws if in_typeid is a creation type.\n\t *\n\t * @param {string} in_typeid - A typeid\n\t * @package\n\t */\n\tsetCreationType(in_typeid) {\n\t\t// This function could be moved somewhere else, an enum could be made if this information is widely needed.\n\t\tconst isCreationType = (typeid) => {\n\t\t\tconst creationTypes = [\n\t\t\t\t\"ContainerProperty\",\n\t\t\t\t\"NodeProperty\",\n\t\t\t\t\"Enum\",\n\t\t\t\t\"BinaryProperty\",\n\t\t\t\t\"Binary\",\n\t\t\t\t\"RepositoryReferenceProperty\",\n\t\t\t];\n\t\t\treturn creationTypes.includes(typeid);\n\t\t};\n\n\t\tif (isCreationType(in_typeid)) {\n\t\t\tconst currentCreationType = this._objectCreationType;\n\t\t\tif (currentCreationType === undefined) {\n\t\t\t\tthis._objectCreationType = in_typeid;\n\t\t\t} else if (currentCreationType !== in_typeid) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\tMSG.ONLY_ONE_CREATION_TYPE + currentCreationType + \", \" + in_typeid,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Contructs the compiled template from the template this wraps\n\t * @param {property-properties.PropertyFactory} in_propertyFactory - The associated PropertyFactory.\n\t * @return {property-properties.PropertyTemplate} The compiled template\n\t * A compiled template is the template which is actually used for creating objects.\n\t * It has all information from parent Templates, and other changes.\n\t * @package\n\t */\n\t_contructCompiledTemplate(in_propertyFactory) {\n\t\tconst originalTemplate = this.getPropertyTemplate();\n\n\t\tthis.setCreationType(originalTemplate.typeid);\n\n\t\t/* Because we treat templates and contructor functions for base types the same way :( */\n\t\tif (_.isFunction(originalTemplate)) {\n\t\t\treturn originalTemplate;\n\t\t}\n\n\t\tlet parentTemplateIds = originalTemplate.inherits;\n\n\t\t/* template.inherits can be a string, if so convert it to array of strings */\n\t\tif (typeof parentTemplateIds === \"string\") {\n\t\t\tparentTemplateIds = [parentTemplateIds];\n\t\t}\n\n\t\t/* Cloning the original template to avoid modifying it */\n\t\tconst template = originalTemplate.clone();\n\n\t\t/* Copy the proccesed list of parents to not modify the original */\n\t\tconst typeInheritence = parentTemplateIds ? parentTemplateIds.slice() : [];\n\n\t\t/* Look ups to efficiently check what properties/constants parents have */\n\t\tconst parentsPropertiesById = {};\n\t\tconst parentsConstantsById = {};\n\n\t\tif (parentTemplateIds !== undefined) {\n\t\t\tfor (let i = 0; i < parentTemplateIds.length; ++i) {\n\t\t\t\tconst parentTemplateId = parentTemplateIds[i];\n\t\t\t\tthis.setCreationType(parentTemplateId);\n\n\t\t\t\tif (hasAssociatedTemplate(parentTemplateId)) {\n\t\t\t\t\tconst parentTemplateWrapper = in_propertyFactory._getWrapper(\n\t\t\t\t\t\tparentTemplateId,\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\tthis._scope,\n\t\t\t\t\t);\n\t\t\t\t\tif (parentTemplateWrapper) {\n\t\t\t\t\t\tconst parentTemplate =\n\t\t\t\t\t\t\tparentTemplateWrapper.getCompiledTemplate(in_propertyFactory);\n\t\t\t\t\t\tconst parentCreationType = parentTemplateWrapper.getCreationType();\n\n\t\t\t\t\t\tif (parentCreationType !== \"ContainerProperty\") {\n\t\t\t\t\t\t\tthis.setCreationType(parentCreationType);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (parentTemplate.inherits) {\n\t\t\t\t\t\t\ttypeInheritence.concat(parentTemplateId);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/* Fills parentsPropertiesById and makes sure there are no two properties or constants with the same id */\n\t\t\t\t\t\tif (parentTemplate.hasNestedProperties()) {\n\t\t\t\t\t\t\tconst parentProperties = parentTemplate.properties;\n\t\t\t\t\t\t\tfor (let j = 0; j < parentProperties.length; ++j) {\n\t\t\t\t\t\t\t\tconst parentProperty = parentProperties[j];\n\t\t\t\t\t\t\t\t/* Two parents has child property with same id */\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\tparentsPropertiesById[parentProperty.id] ||\n\t\t\t\t\t\t\t\t\tparentsConstantsById[parentProperty.id]\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tthrow new Error(MSG.OVERWRITING_ID + parentProperty.id);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tparentsPropertiesById[parentProperty.id] = parentProperty;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/* Fills parentsConsantsById and makes sure there are no two properties or constants with the same id */\n\t\t\t\t\t\tif (parentTemplate.hasNestedConstants()) {\n\t\t\t\t\t\t\tconst parentConstants = parentTemplate.constants;\n\t\t\t\t\t\t\tfor (let j = 0; j < parentConstants.length; ++j) {\n\t\t\t\t\t\t\t\tconst parentConstant = parentConstants[j];\n\t\t\t\t\t\t\t\t/* Two parents has child property with same id */\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\tparentsConstantsById[parentConstant.id] ||\n\t\t\t\t\t\t\t\t\tparentsPropertiesById[parentConstant.id]\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tthrow new Error(MSG.OVERWRITING_ID + parentConstant.id);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tparentsConstantsById[parentConstant.id] = parentConstant;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this._objectCreationType === undefined) {\n\t\t\tthis.setCreationType(\"ContainerProperty\");\n\t\t}\n\n\t\t/* Merges properties from parents into the properties of the child */\n\t\tconst constructSubProperties = (in_template, in_parentsPropertiesById, fieldName) => {\n\t\t\tconst propertyKeys = Object.keys(in_parentsPropertiesById);\n\n\t\t\tif (in_template[fieldName] === undefined && propertyKeys.length !== 0) {\n\t\t\t\tin_template[fieldName] = [];\n\t\t\t}\n\n\t\t\tconst properties = in_template[fieldName] || [];\n\n\t\t\tfor (let i = 0; i < properties.length; ++i) {\n\t\t\t\tconst property = properties[i];\n\t\t\t\tconst id = property.id;\n\t\t\t\tif (in_parentsPropertiesById[id]) {\n\t\t\t\t\tthis._mergeProperty(property, in_parentsPropertiesById[id]);\n\t\t\t\t\tdelete in_parentsPropertiesById[id];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (let i = 0; i < propertyKeys.length; ++i) {\n\t\t\t\tconst insertProperty = in_parentsPropertiesById[propertyKeys[i]];\n\t\t\t\tif (insertProperty) {\n\t\t\t\t\tproperties.push(insertProperty);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (properties.length > 0) {\n\t\t\t\ttemplate[fieldName] = properties;\n\t\t\t}\n\t\t};\n\n\t\tconstructSubProperties(template, parentsPropertiesById, \"properties\");\n\t\tconstructSubProperties(template, parentsConstantsById, \"constants\");\n\n\t\tif (typeInheritence.length > 0) {\n\t\t\ttemplate.inherits = typeInheritence;\n\t\t}\n\n\t\treturn template;\n\t}\n\n\t/**\n\t * A helper function which merges a child and parent property.\n\t * The changes are applied directly to the in_childProperty.\n\t * @param {object} in_childProperty - The child's property defition.\n\t * @param {object} in_parentProperty - The parent's property defition.\n\t * @package\n\t */\n\t_mergeProperty(in_childProperty, in_parentProperty) {\n\t\tconst mergeField = (child, parent, fieldName, defaultValue) => {\n\t\t\tif (child[fieldName] === undefined) {\n\t\t\t\tif (parent[fieldName] !== undefined) {\n\t\t\t\t\tchild[fieldName] = parent[fieldName];\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\tchild[fieldName] !== parent[fieldName] &&\n\t\t\t\t(child[fieldName] !== defaultValue || parent[fieldName] !== undefined)\n\t\t\t) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\tMSG.OVERRIDEN_PROP_MUST_HAVE_SAME_FIELD_VALUES_AS_BASE_TYPE +\n\t\t\t\t\t\tfieldName +\n\t\t\t\t\t\t\" as the base type: \" +\n\t\t\t\t\t\tchild.id +\n\t\t\t\t\t\t\": \" +\n\t\t\t\t\t\tchild[fieldName] +\n\t\t\t\t\t\t\" != \" +\n\t\t\t\t\t\tparent[fieldName],\n\t\t\t\t);\n\t\t\t}\n\t\t};\n\n\t\tmergeField(in_childProperty, in_parentProperty, \"context\", \"single\");\n\t\tmergeField(in_childProperty, in_parentProperty, \"contextKeyType\", \"string\");\n\t\tmergeField(in_childProperty, in_parentProperty, \"length\", 0);\n\t\tmergeField(in_childProperty, in_parentProperty, \"optional\", false);\n\t\tmergeField(in_childProperty, in_parentProperty, \"typeid\", undefined);\n\n\t\tif (in_parentProperty.typedValue !== undefined) {\n\t\t\tif (in_childProperty.typedValue === undefined) {\n\t\t\t\tin_childProperty.typedValue = in_parentProperty.typedValue;\n\t\t\t}\n\t\t}\n\n\t\tif (in_parentProperty.value !== undefined) {\n\t\t\tif (in_childProperty.value === undefined) {\n\t\t\t\tin_childProperty.value = in_parentProperty.value;\n\t\t\t}\n\t\t}\n\n\t\tconst mergeSubProperties = (child, parent, fieldName) => {\n\t\t\tconst parentPropertiesById = {};\n\t\t\tlet parentProperties = parent[fieldName];\n\t\t\tlet properties = child[fieldName] || [];\n\t\t\tif (parentProperties) {\n\t\t\t\tfor (let j = 0; j < parentProperties.length; ++j) {\n\t\t\t\t\tconst parentProperty = parentProperties[j];\n\t\t\t\t\tparentPropertiesById[parentProperty.id] = parentProperty;\n\t\t\t\t}\n\n\t\t\t\tfor (let i = 0; i < properties.length; ++i) {\n\t\t\t\t\tconst property = properties[i];\n\t\t\t\t\tconst id = property.id;\n\t\t\t\t\tif (parentPropertiesById[id]) {\n\t\t\t\t\t\tthis._mergeProperty(property, parentPropertiesById[id]);\n\t\t\t\t\t\tdelete parentPropertiesById[id];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst propertyKeys = Object.keys(parentPropertiesById);\n\t\t\t\tfor (let i = 0; i < propertyKeys.length; ++i) {\n\t\t\t\t\tconst insertProperty = parentPropertiesById[propertyKeys[i]];\n\t\t\t\t\tif (insertProperty) {\n\t\t\t\t\t\tproperties.push(insertProperty);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (properties.length > 0) {\n\t\t\t\tchild[fieldName] = properties;\n\t\t\t}\n\t\t};\n\n\t\tmergeSubProperties(in_childProperty, in_parentProperty, \"properties\");\n\t\tmergeSubProperties(in_childProperty, in_parentProperty, \"constants\");\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propertyUtils.d.ts","sourceRoot":"","sources":["../src/propertyUtils.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;
|
|
1
|
+
{"version":3,"file":"propertyUtils.d.ts","sourceRoot":"","sources":["../src/propertyUtils.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;IACC;;;;;;OAMG;IACH,2EAHY,eAAe,CAYzB;CACF"}
|
package/lib/propertyUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propertyUtils.js","sourceRoot":"","sources":["../src/propertyUtils.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,OAAO,aAAa;;
|
|
1
|
+
{"version":3,"file":"propertyUtils.js","sourceRoot":"","sources":["../src/propertyUtils.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,OAAO,aAAa;;AACzB;;;;;;GAMG;AACI,8BAAgB,GAAG,UAAU,eAAe,EAAE,YAAY;IAChE,IAAI,kBAAkB,GAAG,EAAE,CAAC;IAC5B,eAAe,CAAC,YAAY,CAAC,UAAU,QAAQ,EAAE,IAAI;QACpD,IAAI,YAAY,CAAC,QAAQ,CAAC,EAAE;YAC3B,kBAAkB,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC;SACpC;IACF,CAAC,CAAC,CAAC;IAEH,OAAO,kBAAkB,CAAC;AAC3B,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport class PropertyUtils {\n\t/**\n\t * Gather all properties that pass an arbitrary predicate function\n\t * @param {property-properties.NodeProperty} in_rootProperty - The root property to traverse from\n\t * @param {function} in_predicate - The predicate function\n\t * @return {Array.<property-properties.BaseProperty>} The list of properties that passed the predicate\n\t * function\n\t */\n\tstatic gatherProperties = function (in_rootProperty, in_predicate) {\n\t\tvar gatheredProperties = {};\n\t\tin_rootProperty.traverseDown(function (property, path) {\n\t\t\tif (in_predicate(property)) {\n\t\t\t\tgatheredProperties[path] = property;\n\t\t\t}\n\t\t});\n\n\t\treturn gatheredProperties;\n\t};\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-experimental/property-properties",
|
|
3
|
-
"version": "2.0.0-internal.3.0
|
|
3
|
+
"version": "2.0.0-internal.3.2.0",
|
|
4
4
|
"description": "definitions of properties",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -18,29 +18,6 @@
|
|
|
18
18
|
"lib/**/*",
|
|
19
19
|
"src/index.d.ts"
|
|
20
20
|
],
|
|
21
|
-
"scripts": {
|
|
22
|
-
"build": "concurrently npm:build:compile npm:lint",
|
|
23
|
-
"build:commonjs": "npm run tsc && npm run build:test",
|
|
24
|
-
"build:compile": "concurrently npm:build:commonjs npm:build:esnext",
|
|
25
|
-
"build:esnext": "tsc --project ./tsconfig.esnext.json",
|
|
26
|
-
"build:full": "npm run build",
|
|
27
|
-
"build:full:compile": "npm run build:compile",
|
|
28
|
-
"build:test": "tsc --project ./src/test/tsconfig.json",
|
|
29
|
-
"clean": "rimraf dist lib *.tsbuildinfo *.build.log",
|
|
30
|
-
"coverage": "npx nyc --silent --cwd .. --nycrc-path `pwd`/.nycrc npm run test && npx nyc --no-clean --silent --cwd .. --nycrc-path `pwd`/.nycrc npm run test:changeset && npx nyc --no-clean --cwd .. --nycrc-path `pwd`/.nycrc npm run test:common",
|
|
31
|
-
"eslint": "eslint --format stylish src",
|
|
32
|
-
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
33
|
-
"format": "npm run prettier:fix",
|
|
34
|
-
"lint": "npm run eslint",
|
|
35
|
-
"lint:fix": "npm run eslint:fix",
|
|
36
|
-
"prettier": "prettier --check . --ignore-path ../../../.prettierignore",
|
|
37
|
-
"prettier:fix": "prettier --write . --ignore-path ../../../.prettierignore",
|
|
38
|
-
"test": "npm run test:mocha",
|
|
39
|
-
"test:coverage": "nyc npm test -- --reporter xunit --reporter-option output=nyc/junit-report.xml",
|
|
40
|
-
"test:mocha": "mocha --recursive dist/test -r node_modules/@fluidframework/mocha-test-setup --unhandled-rejections=strict",
|
|
41
|
-
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
|
|
42
|
-
"tsc": "tsc"
|
|
43
|
-
},
|
|
44
21
|
"nyc": {
|
|
45
22
|
"all": true,
|
|
46
23
|
"cache-dir": "nyc/.cache",
|
|
@@ -62,8 +39,8 @@
|
|
|
62
39
|
"temp-directory": "nyc/.nyc_output"
|
|
63
40
|
},
|
|
64
41
|
"dependencies": {
|
|
65
|
-
"@fluid-experimental/property-changeset": ">=2.0.0-internal.3.0
|
|
66
|
-
"@fluid-experimental/property-common": ">=2.0.0-internal.3.0
|
|
42
|
+
"@fluid-experimental/property-changeset": ">=2.0.0-internal.3.2.0 <2.0.0-internal.4.0.0",
|
|
43
|
+
"@fluid-experimental/property-common": ">=2.0.0-internal.3.2.0 <2.0.0-internal.4.0.0",
|
|
67
44
|
"ajv": "7.1.1",
|
|
68
45
|
"async": "^3.2.2",
|
|
69
46
|
"fastest-json-copy": "^1.0.1",
|
|
@@ -74,7 +51,7 @@
|
|
|
74
51
|
},
|
|
75
52
|
"devDependencies": {
|
|
76
53
|
"@fluidframework/build-common": "^1.1.0",
|
|
77
|
-
"@fluidframework/mocha-test-setup": ">=2.0.0-internal.3.0
|
|
54
|
+
"@fluidframework/mocha-test-setup": ">=2.0.0-internal.3.2.0 <2.0.0-internal.4.0.0",
|
|
78
55
|
"@types/mocha": "^9.1.1",
|
|
79
56
|
"@types/node": "^14.18.36",
|
|
80
57
|
"chai": "^4.2.0",
|
|
@@ -94,5 +71,28 @@
|
|
|
94
71
|
"version": "2.0.0-internal.2.2.0",
|
|
95
72
|
"baselineRange": "2.0.0-internal.2.0.0",
|
|
96
73
|
"broken": {}
|
|
74
|
+
},
|
|
75
|
+
"scripts": {
|
|
76
|
+
"build": "concurrently npm:build:compile npm:lint",
|
|
77
|
+
"build:commonjs": "npm run tsc && npm run build:test",
|
|
78
|
+
"build:compile": "concurrently npm:build:commonjs npm:build:esnext",
|
|
79
|
+
"build:esnext": "tsc --project ./tsconfig.esnext.json",
|
|
80
|
+
"build:full": "npm run build",
|
|
81
|
+
"build:full:compile": "npm run build:compile",
|
|
82
|
+
"build:test": "tsc --project ./src/test/tsconfig.json",
|
|
83
|
+
"clean": "rimraf dist lib *.tsbuildinfo *.build.log",
|
|
84
|
+
"coverage": "npx nyc --silent --cwd .. --nycrc-path `pwd`/.nycrc npm run test && npx nyc --no-clean --silent --cwd .. --nycrc-path `pwd`/.nycrc npm run test:changeset && npx nyc --no-clean --cwd .. --nycrc-path `pwd`/.nycrc npm run test:common",
|
|
85
|
+
"eslint": "eslint --format stylish src",
|
|
86
|
+
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
87
|
+
"format": "npm run prettier:fix",
|
|
88
|
+
"lint": "npm run prettier && npm run eslint",
|
|
89
|
+
"lint:fix": "npm run prettier:fix && npm run eslint:fix",
|
|
90
|
+
"prettier": "prettier --check . --ignore-path ../../../../.prettierignore",
|
|
91
|
+
"prettier:fix": "prettier --write . --ignore-path ../../../../.prettierignore",
|
|
92
|
+
"test": "npm run test:mocha",
|
|
93
|
+
"test:coverage": "nyc npm test -- --reporter xunit --reporter-option output=nyc/junit-report.xml",
|
|
94
|
+
"test:mocha": "mocha --recursive dist/test -r node_modules/@fluidframework/mocha-test-setup --unhandled-rejections=strict",
|
|
95
|
+
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
|
|
96
|
+
"tsc": "tsc"
|
|
97
97
|
}
|
|
98
|
-
}
|
|
98
|
+
}
|