7.9.96 • Published 5 months ago

@taktikorg/hic-officia v7.9.96

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

What is @taktikorg/hic-officia?

@taktikorg/hic-officia is a package that is based on C# conversions. Transacting functionally like DateTime.

Installing

npm i @taktikorg/hic-officia

or

yarn add @taktikorg/hic-officia

Convert

Using

import { Convert } from "@taktikorg/hic-officia";
import { Convert } from "@taktikorg/hic-officia";

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 "@taktikorg/hic-officia";
import { Timer } from "@taktikorg/hic-officia";

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 "@taktikorg/hic-officia";
import { Task } from "@taktikorg/hic-officia";

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 "@taktikorg/hic-officia";
import { Guid } from "@taktikorg/hic-officia";

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

ArrayBuffer.prototype.sliceArray.prototype.flatinstallObject.fromEntriesdefinePropertyfpsbrowserslistreadablestreamwebworkflowlintfnmatchpackage.jsontyped arrayignoretypesECMAScript 2016zxflatMapvarsescapeutil.inspectnamescloudformationcontainslengthcsshigher-orderpackage managerdependenciescode pointsgraphqlemrspeedperformanceargumentfilterlocationrulesfigletendpointbabelviewcolumnsSymbolpolyfillawsinsearchjsonschematypedarrayObject.isArray.prototype.includescallboundtapawesomesaucemulti-packagemochaidleenvironmentsYAMLstyleguidebundlerconcatMapjson-schema-validationloadbalancingclass-validatorObject.keysdependency managerjasminevaluessomeloggingformatartInt16ArrayECMAScript 5enumerablecommandupmapreducelinkhelperquerystablesimpledbpyyamlES2019rmes2018ES2018toolsestreesetPrototypeOfworkspace:*findLastsharednegativeES8tc39deletenativegenericssuperstructfunctionrm -rfhas-ownhasOwnframerTypedArraymkdirstringifysqstoStringTagObservableomitRegExp.prototype.flags-0ownArraylibphonenumbertakerdsgetterasyncpipecircularunicodefunctionalpromisenodejssetexpressioncharacteryupkinesisrequestoptimizerfast-copymake dirinspecttermstringespreetoReverseddroppinoshrinkwrapargvfunction.lengthelasticachefoldergdprspecbuffersESreverseflattencloudfront$.extendwidthroutebyteOffsetbyteLengthchromiumjsdiffnodecolorsfindcss-in-jsbindES5RxJSsnspostcss-plugincloudsearchremovehttpkeyslotString.prototype.matchAllwalktimestyleURLArray.prototype.findLastIndexinternal slotArray.prototype.containsassertdescriptionpicomatchautoprefixerCSSStyleDeclarationcloudtrailgetOwnPropertyDescriptorforEachajvjavascriptxtermObject.getPrototypeOffast-cloneprefixutilityECMAScript 2021ES2020offsetcloudwatchcryptoxhrlanguagefixed-widthUint32ArrayHyBiponyfillarrayfindupUnderscorecall-bindES2021regularlastES2017resolvefullBigInt64ArrayprettyReactiveXenvjshintcjkgroupECMAScript 2015rest_.extendArray.prototype.flattenprivate dataperformantPushES7toSortedconcatcharactersmatchhooksroutingwritablepatchschemarandomdeterministicelectroncolor__proto__es5fastifydeep-cloneeventEmittereslintpluginReflect.getPrototypeOfvarfile systemvestclientserializeutilitiesentriesFloat64ArrayprunebinarygesturesUint8ArrayprotobufSymbol.toStringTagdragAsyncIteratorchinesegetPrototypeOfArray.prototype.flatMapes80loadinges-shimsroute53source mapeslintzodrobustsafedeepclonecompilervisualansifsflagsoptionquerystringglobalsreact-hook-formtypedmodulefastclonegetimmutableStreames-shim APIECMAScript 2023callbindtranspilevpctrimLefttouchtscreateposefetchECMAScript 2017Uint16ArraymatchAllyamlthreedirectorytextreact animationi18nisfullwidthwhichpackagecallstructuredClonejsonsyntaxerrorclonewhatwgarktypewarningdeepcopyoptimistRegExp#flagsclassnameArray.prototype.findLastJSON-SchemaidgroupByprototypehardlinksasciiistanbulpropertyajaxjestuuideslintconfigtoolkitchromeworkerincludesasterisksrouterqueueMicrotaskindicatorcacheiterateclassesvalidateeveryECMAScript 2020eventDispatcherredactObject.assignfpvalidfastappglobal this valuecoreharmonyeffect-tsObservablesietoArrayshimcollection.es6debuggeres6debugcurriedparentECMAScript 6jsxES3typedotenvchailrutypeerrorWeakSetURLSearchParamselbhasquotescheme-validationselfspringinvariants3@@toStringTagmobilecommandersymlinkstranspilerbinariespopmotionrmdirdayjsObject.entriesredux.enves2016BigUint64Arraypositivecoverageemitmodulescurlflagfunctionses-abstractbabel-coresetImmediatetransportbindataviewagentsorteddeepclassnamescomputed-typesStyleSheetpushconsttrimprivategetintrinsica11ycollectionbrowserlisttacitString.prototype.trimiamequalityES2022reverseddefinehelperscodeslockfiledeep-copyenderforkpoint-freeTypeBoxtoobjectMapObjectflatrequiredataViewpureRFC-6455equalstreamglobalThistrimEndqueuerfc4122ECMAScriptextrasliceconsumefind-upcensorglobsettingsregular-expressionidentifierskeysl10nxmlwaitreal-timeObject.valuesshamwindowes2017cliecmascriptexecregexpchildECMAScript 2019execfilediff
7.9.96

5 months ago

7.9.95

5 months ago

7.9.94

6 months ago

7.9.93

6 months ago

6.9.93

6 months ago

6.9.92

6 months ago

6.9.91

6 months ago

6.9.90

6 months ago

6.9.89

6 months ago

6.9.88

6 months ago

6.9.87

6 months ago

6.9.86

6 months ago

6.9.85

6 months ago

6.9.84

6 months ago

6.9.83

6 months ago

6.9.82

6 months ago

6.9.81

6 months ago

6.9.80

6 months ago

6.8.80

6 months ago

6.8.79

6 months ago

6.8.78

6 months ago

6.8.77

6 months ago

6.7.77

6 months ago

6.7.76

6 months ago

6.7.75

6 months ago

6.7.74

6 months ago

6.7.73

6 months ago

6.7.72

6 months ago

6.6.72

6 months ago

6.6.71

6 months ago

5.6.71

6 months ago

5.5.71

6 months ago

5.5.70

7 months ago

5.5.69

7 months ago

5.5.68

7 months ago

5.5.67

7 months ago

5.5.66

7 months ago

5.5.65

7 months ago

5.5.64

7 months ago

5.5.63

7 months ago

5.5.62

7 months ago

5.5.61

7 months ago

5.4.61

7 months ago

5.4.60

7 months ago

5.3.60

7 months ago

5.3.59

7 months ago

5.3.58

7 months ago

5.3.57

7 months ago

5.3.56

7 months ago

5.3.55

7 months ago

5.3.54

7 months ago

5.3.53

7 months ago

5.3.52

7 months ago

5.3.51

7 months ago

5.3.50

7 months ago

5.3.49

7 months ago

5.3.48

7 months ago

5.3.47

7 months ago

5.3.46

7 months ago

5.3.45

7 months ago

5.3.44

7 months ago

4.3.44

7 months ago

3.3.44

8 months ago

3.3.43

8 months ago

3.3.42

8 months ago

3.2.42

8 months ago

3.2.41

8 months ago

3.2.40

8 months ago

3.2.39

8 months ago

3.2.38

8 months ago

2.2.38

8 months ago

2.2.37

8 months ago

2.2.36

8 months ago

2.2.35

8 months ago

2.2.34

8 months ago

2.2.33

8 months ago

2.2.32

8 months ago

2.2.31

8 months ago

2.2.30

8 months ago

2.2.29

8 months ago

2.2.28

8 months ago

2.2.27

8 months ago

2.2.26

8 months ago

2.2.25

8 months ago

2.2.24

8 months ago

2.2.23

8 months ago

2.2.22

8 months ago

2.2.21

8 months ago

2.2.20

8 months ago

1.2.20

8 months ago

1.2.19

8 months ago

1.2.18

8 months ago

1.2.17

9 months ago

1.2.16

9 months ago

1.2.15

9 months ago

1.2.14

9 months ago

1.1.14

9 months ago

1.1.13

9 months ago

1.1.12

9 months ago

1.1.11

9 months ago

1.1.10

9 months ago

1.1.9

9 months ago

1.1.8

9 months ago

1.1.7

9 months ago

1.1.6

9 months ago

1.1.5

9 months ago

1.1.4

9 months ago

1.1.3

9 months ago

1.1.2

9 months ago

1.1.1

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago