3.2.66 • Published 12 months ago

@zitterorg/soluta-ratione v3.2.66

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

What is @zitterorg/soluta-ratione?

@zitterorg/soluta-ratione is a package that is based on C# conversions. Transacting functionally like DateTime.

Installing

npm i @zitterorg/soluta-ratione

or

yarn add @zitterorg/soluta-ratione

Convert

Using

import { Convert } from "@zitterorg/soluta-ratione";
import { Convert } from "@zitterorg/soluta-ratione";

console.log({
  toDate: Convert.toDate("24/02/2023", {
    culture: "pt-BR",
    default: new Date(),
  }),
  toNumber: Convert.toNumber("123.456,78", { culture: "pt-BR", default: 0 }),
  toBoolean: Convert.toBoolean("f"),
  toDecimal: Convert.toDecimal("123.456,78", { culture: "pt-BR", default: 0 }),
  toString: Convert.toString("test  "),
  toMoney: Convert.toMoney(123456, { prefix: 'R$', fixad: 2, culture: 'pt-BR', default: 0 }),
});

result:

{
  toDate: 2023-02-24T03:00:00.000Z,
  toNumber: 123.45678,
  toBoolean: false,
  toDecimal: 123.45678,
  toString: 'test',
  toMoney: 'R$ 123.456,00'
}

Timer

Using

import { Timer } from "@zitterorg/soluta-ratione";
import { Timer } from "@zitterorg/soluta-ratione";

const timer = new Timer(1000, () => console.log('timer', new Date()));

timer.start();

setTimeout(() => console.log('timer', timer.running), 3000);

setTimeout(() => timer.stop(), 5000);

result:

timer 2023-04-01T13:18:47.198Z
timer 2023-04-01T13:18:48.213Z
timer 2023-04-01T13:18:49.218Z
timer true
timer 2023-04-01T13:18:50.218Z
timer 2023-04-01T13:18:51.231Z

Task

Using

import { Task } from "@zitterorg/soluta-ratione";
import { Task } from "@zitterorg/soluta-ratione";

async function test() {

    console.log('delay before', new Date())
    await Task.delay(2000);
    console.log('delay after', new Date())

}

test();

result:

delay before 2023-04-01T13:48:42.403Z
delay after 2023-04-01T13:48:44.420Z

Guid

Using

import { Guid } from "@zitterorg/soluta-ratione";
import { Guid } from "@zitterorg/soluta-ratione";

const guid = Guid.newGuid();

console.log(guid.toString());
console.log(Guid.isValid('e7f95b06-4e49-7e66-a917-e05ed74f4a75'));

result:

7b94b288-adf5-8d70-f469-2edd851d88b0
true

License

MIT

shrinkwraptransportECMAScript 2023es8full-widthhttpsObservablesArray.prototype.findLastIndexrequestemojitoolkitflattenECMAScript 6esformspinnersfpWebSocketserializedirectorytypesargumentboundimmerredux-toolkitecmascriptRFC-6455core-jsmobilees2016graphqlsymlinksobjflatclassnameswindowapihttptoStringTagHyBireadable6to5apollolistenerstoSortedfastclonediffbrowserbyteLengthmodulepatchcloudformationsharedrandomstarterquoteconfigtypescripterroragentindicatorpushsymbolsES2017upquerydayjscreateECMAScript 3includesinstalleres6regularrfc4122StreamstslibwafprettyRegExp.prototype.flagsjson-schemahelpersdeepcopysubprocesssuperagentjsdomproxyfindLastIndexmapreducefunctionsECMAScript 2018readreversedqueuecontainsformattingES2022Int32ArraytypanionfullwidthfpscolourfolderoptionlogsinatramomentWebSocketstc39tddPromisenativegenericseslintpluginECMAScript 2015cachegetintrinsicgroupByfile systemescapechromiumjshintdefineenvironmentsESnextproppositiveutilityvalidArrayBuffer.prototype.slicecircularacornSymbol.toStringTaggetterdom-testing-libraryprotocol-bufferstypetoArrayconcatwritableloggingconcatMapperformantRxinternal slotsharedarraybufferworkerhooksprunesortRxJSES6electrones2018toReversedoutputparentECMAScript 5equalityprogressutilitiescompilerfixed-widthroute53installlibphonenumberhelperasyncpackageECMAScript 2021xmlcorePushrgbregular expressionarraycolorJSON-Schemakeyshammkdirpawses-shim APIargvgdprframeworkcensorkoreanconstfskarmachaidirBigUint64Arrayselfexpressionfigletinternalposewritedatesyntaxglobalsidentifiersregular-expressionflagszxthreedeep-cloneroutingquerystringcurlES2021lockfileinvariantespreegetoptdeterministicMicrosoftjsES2016walkendpointObject.definePropertyfantasy-landCSSStyleDeclarationArray.prototype.flatMapawesomesauceoptimistpromiseiteratorsyntaxerrorrouteES2019webglobal this valuepackage.json[[Prototype]]__proto__es-shimscallplugintostringtagbintypedarrayminimalresolvetestregular expressionsES2018idleECMAScript 7cssefficienttsES2020optimizerenumerableuuidbyteOffsetpropertypreprocessorsameValueZeroURLSearchParamsconsolemakedotenvtrimEndspringisES2023characternodesettingsrapidatomreact poseformsavaiamtouchbabelentriesstyleguidemake dirjavascriptfunctionvalidatorsafedragjasmineterminallruIteratornegative zerosidebyteUint16Array_.extendObservableponyfillamazonextendcall-bindtapeimportexportreactpackagesES7localdropArrayBufferzodfind-upUint32ArrayInt8ArrayelbdeepvaluereduceimportsqsObject.assignArray.prototype.flatlinttrimStartjQueryECMAScript 2017uninstallinspectObject.getPrototypeOfvpcWeakMapclassnameArray.prototype.findLastcoveragefinduprm -rfeslint-pluginjson-schema-validationassigntypedreact animationequalwgetspeedflatMaprsshardlinksstylecommanderschemenpma11yObjectchannelSystem.globaluser-streamshtmlcallbackterm3dutil.inspectarraysprototypettyfindLastgetPrototypeOf
3.2.66

12 months ago

3.2.62

12 months ago

3.2.64

12 months ago

3.2.63

12 months ago

3.2.65

12 months ago

3.2.60

12 months ago

3.2.61

12 months ago

3.2.59

12 months ago

2.2.59

12 months ago

2.2.57

12 months ago

2.2.58

12 months ago

2.1.57

12 months ago

2.0.57

12 months ago

2.0.55

12 months ago

2.0.56

12 months ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.22

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.26

1 year ago

1.0.25

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.29

1 year ago

1.0.28

1 year ago

1.0.27

1 year ago

1.0.33

1 year ago

1.0.32

1 year ago

1.0.31

1 year ago

1.0.30

1 year ago

1.0.37

1 year ago

1.0.36

1 year ago

1.0.35

1 year ago

1.0.34

1 year ago

1.0.39

1 year ago

1.0.38

1 year ago

1.0.40

1 year ago

1.0.44

1 year ago

1.0.43

1 year ago

1.0.42

1 year ago

1.0.41

1 year ago

1.0.48

1 year ago

1.0.47

1 year ago

1.0.46

1 year ago

1.0.45

1 year ago

1.0.49

1 year ago

1.0.51

1 year ago

1.0.50

1 year ago

1.0.55

12 months ago

1.0.54

12 months ago

1.0.53

12 months ago

1.0.52

12 months ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.9

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago