Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@quenty/adorneedata

Package Overview
Dependencies
Maintainers
0
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@quenty/adorneedata

Bridges attributes and serialization

  • 7.12.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
41
increased by2.5%
Maintainers
0
Weekly downloads
 
Created
Source

AdorneeData

Documentation status Discord Build and release status

Bridges attributes and serialization

Installation

npm install @quenty/adorneedata --save

Requirements

These are the requirements for this attribute data library.

  • Not like Tie in that it is focused on serialization/boundary between Roblox and our stuff (tie is interfaces separated by network boundary)
  • Easy to transform between data and attributes
  • No service bag requirements

Centralized definition with no server/client information

return AdorneeData.new({
  CurrencyColor = Color3.new();
  CurrencyNameTranslationKey = "";
  CurrencyFormatTranslationKey = "";
  CurrencyImageId = "";
  CurrencyShowType = CurrencyShowTypes.NONE;
  GivePlayerCurrency = false;
  CurrencySaves = false;
})

Easy to write/author

We should be able to create new data that is validated

CurrencyDefinitionData:CreateData({
  CurrencyKey = CurrencyDefinitionConstants.DEFAULT_CURRENCY_KEY
  CurrencyColor = Color3.fromRGB(55, 180, 74)
  CurrencyTranslationKey = "currency.default.name"
  CurrencyFormatTranslationKey = "currency.default.format"
  DoesSave = true
  ImageId = "rbxassetid://10049671651"
})

We should be able to create partial data

CurrencyDefinitionData:CreatePartialData({
  CurrencyKey = CurrencyDefinitionConstants.DEFAULT_CURRENCY_KEY
  CurrencyColor = Color3.fromRGB(55, 180, 74)
  CurrencyTranslationKey = "currency.default.name"
  CurrencyFormatTranslationKey = "currency.default.format"
  DoesSave = true
  ImageId = "rbxassetid://10049671651"
})
Additional authorship requirements
  • Should be able to set optional values

Easy to validate/assert/assign

We should be able to check data types

function CurrencyService:InitCurrencyDefinition(currencyDefinitionData)
  assert(CurrencyDefinitionData:IsData(currencyDefinitionData), "Bad currencyDefinitionData")

  local currencyDefinition = CurrencyDefinition:Create("Folder")
  CurrencyDefinitionData:SetAttributes(currencyDefinition, currencyDefinitionData)

  return currencyDefinition
end

Replacement files

Should replace following files:

  • CurrencyDefinitionDataUtils - Files with t interface asserting type
  • CurrencyDefinitionConstants - Files with constant attribute names
  • CurrencyDefinitionUtils - File that sets certain properties or attributes and do validation

Easy to serialize

Should be able to flash to constant

Keywords

FAQs

Package last updated on 04 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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