MCPcopy Create free account
hub / github.com/openai/plugins / serialize

Method serialize

plugins/shopify/skills/shopify-admin/scripts/validate.mjs:4910–4925  ·  view source on GitHub ↗
(outputValue)

Source from the content-addressed store, hash-verified

4908 return this._nameLookup[name];
4909 }
4910 serialize(outputValue) {
4911 if (this._valueLookup === null) {
4912 this._valueLookup = new Map(
4913 this.getValues().map((enumValue2) => [enumValue2.value, enumValue2])
4914 );
4915 }
4916 const enumValue = this._valueLookup.get(outputValue);
4917 if (enumValue === void 0) {
4918 throw new _GraphQLError.GraphQLError(
4919 `Enum "${this.name}" cannot represent value: ${(0, _inspect.inspect)(
4920 outputValue
4921 )}`
4922 );
4923 }
4924 return enumValue.name;
4925 }
4926 parseValue(inputValue) {
4927 if (typeof inputValue !== "string") {
4928 const valueStr = (0, _inspect.inspect)(inputValue);

Callers 2

astFromValueFunction · 0.45
completeLeafValueFunction · 0.45

Calls 3

mapMethod · 0.80
getValuesMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected