Your Choice JavaScript News

TypeScript News Tuesday, March 27 Nem blockchain technology, Nem latest version, File & more…

TypeScript News TLDR / Table of Contents

  • NEM blockchain technology delivers a world-class platform for management of almost any kind of asset: currencies, supply chains, notarizations, ownership records and more.
  • NEMs power is exposed through a straightforward and secure developer interface so that you can deploy your blockchain solution in record time.
  • Is this your first time developing with NEM Catapult?
  • Start by setting up your working environment and then follow the first guide.
  • When working with the NEM Blockchain technology, it is essential to understand its core concepts, such as Blocks, Nodes, Accounts, Transactions, Namespaces and Mosaics.

Tags: nem blockchain technology, NEM latest version, , ,

  • To enable source maps generation we can use sourceMap option: – compilerOptions: { – sourceMap: true – }When you run the compiler, you will see that mapping files will be emitted by the compiler alongside their corresponding ts files.
  • So, if you have main.ts file, after the compilation you will have 3 the main.js file, you will see the URL to the source map file: – //# can modify the generated URL that is added to map files like this: – compilerOptions: { – mapRoot: produces the following path:…
  • ts – ],You can modify the root for the source file using sourceRoots option: – sourceRoot: /path/to/sources,which produces the following output: – sourceRoot: /path/to/sources, – sources: [ – main.ts – ],If you wish to put sources inside a mapping file (either because you want to save a browser a request…
  • js files using: – compilerOptions: { – inlineSourceMap: true – }In this way, instead of having a separate file, the contents of that file will be included into the main.js file like this: – //# sourceMappingURL is Data URI.
  • inlineSources can be used with either option.You might have guessed that by combining inlineSourceMap and inlineSources you can have only js file with source maps and sources included into it.

Tags: file, unquoted module declarations, TS supports decorators, candidate module location, Angular2 TS development

  • TypeScript 2.8 introduces a fantastic new feature called conditional types which is going to make TypeScript’s type system even more powerful and enable a huge range of type orperators which were previously not possible.
  • Here is a very simple (and slightly silly) example for using conditional types: – – A more interesting and more useful example is to implement JavaScript’s operator at TypeScript’s type level: – – One interesting rule about conditional types is how they interact with union types.
  • A conditional types distributes over a union type with the following distribution law: – – Let’s see how we can apply this law to the operator defined above: – – So we have a substitution rule by which we can evaluate conditional types where the argument is a union type….
  • , but makes sense when looking at an example: – – A useful application to this the type operator which removes the types and from a union type: – – It would seem like we could the inverse of the type operator with this technique – namely making all parameters…
  • Using recursive type definitions and conditional types, we can implement the coveted type operator with conditional and recursive types: – – So with conditional types, we can now write type operators we could not previously write and probably simplify a few other ones which were possible but difficult to write….

Tags: conditional types, new feature, non-uniform type mappings, fantastic new feature, exciting new feature