7.9.96 • Published 4 months ago

@taktikorg/hic-officia v7.9.96

Weekly downloads
-
License
MIT
Repository
github
Last release
4 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

4 months ago

7.9.95

4 months ago

7.9.94

4 months ago

7.9.93

5 months ago

6.9.93

5 months ago

6.9.92

5 months ago

6.9.91

5 months ago

6.9.90

5 months ago

6.9.89

5 months ago

6.9.88

5 months ago

6.9.87

5 months ago

6.9.86

5 months ago

6.9.85

5 months ago

6.9.84

5 months ago

6.9.83

5 months ago

6.9.82

5 months ago

6.9.81

5 months ago

6.9.80

5 months ago

6.8.80

5 months ago

6.8.79

5 months ago

6.8.78

5 months ago

6.8.77

5 months ago

6.7.77

5 months ago

6.7.76

5 months ago

6.7.75

5 months ago

6.7.74

5 months ago

6.7.73

5 months ago

6.7.72

5 months ago

6.6.72

5 months ago

6.6.71

5 months ago

5.6.71

5 months ago

5.5.71

5 months ago

5.5.70

5 months ago

5.5.69

6 months ago

5.5.68

6 months ago

5.5.67

6 months ago

5.5.66

6 months ago

5.5.65

6 months ago

5.5.64

6 months ago

5.5.63

6 months ago

5.5.62

6 months ago

5.5.61

6 months ago

5.4.61

6 months ago

5.4.60

6 months ago

5.3.60

6 months ago

5.3.59

6 months ago

5.3.58

6 months ago

5.3.57

6 months ago

5.3.56

6 months ago

5.3.55

6 months ago

5.3.54

6 months ago

5.3.53

6 months ago

5.3.52

6 months ago

5.3.51

6 months ago

5.3.50

6 months ago

5.3.49

6 months ago

5.3.48

6 months ago

5.3.47

6 months ago

5.3.46

6 months ago

5.3.45

6 months ago

5.3.44

6 months ago

4.3.44

6 months ago

3.3.44

6 months ago

3.3.43

7 months ago

3.3.42

7 months ago

3.2.42

7 months ago

3.2.41

7 months ago

3.2.40

7 months ago

3.2.39

7 months ago

3.2.38

7 months ago

2.2.38

7 months ago

2.2.37

7 months ago

2.2.36

7 months ago

2.2.35

7 months ago

2.2.34

7 months ago

2.2.33

7 months ago

2.2.32

7 months ago

2.2.31

7 months ago

2.2.30

7 months ago

2.2.29

7 months ago

2.2.28

7 months ago

2.2.27

7 months ago

2.2.26

7 months ago

2.2.25

7 months ago

2.2.24

7 months ago

2.2.23

7 months ago

2.2.22

7 months ago

2.2.21

7 months ago

2.2.20

7 months ago

1.2.20

7 months ago

1.2.19

7 months ago

1.2.18

7 months ago

1.2.17

7 months ago

1.2.16

8 months ago

1.2.15

8 months ago

1.2.14

8 months ago

1.1.14

8 months ago

1.1.13

8 months ago

1.1.12

8 months ago

1.1.11

8 months ago

1.1.10

8 months ago

1.1.9

8 months ago

1.1.8

8 months ago

1.1.7

8 months ago

1.1.6

8 months ago

1.1.5

8 months ago

1.1.4

8 months ago

1.1.3

8 months ago

1.1.2

8 months ago

1.1.1

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago