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

@trademe/ensure

Package Overview
Dependencies
Maintainers
2
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@trademe/ensure - npm Package Compare versions

Comparing version 0.1.0-beta.3 to 0.1.0-beta.4

11

dist/singleton/singleton.js

@@ -5,3 +5,2 @@ "use strict";

var ensure_error_1 = require("../ensure-error");
var core_1 = require("@angular/core");
function Singleton() {

@@ -17,11 +16,2 @@ return function (injectable) {

exports.Singleton = Singleton;
// @Singleton must appear before the @Injectable decorator on the class.
// This is so the service injection is applied to the original class.
function checkInjectable(injectable) {
var annotations = Reflect.getOwnMetadata('annotations', injectable);
var isInjectable = annotations && annotations.some(function (ann) { return ann.constructor === core_1.Injectable; });
if (!isInjectable) {
throw new ensure_error_1.EnsureError("\n @Singleton must appear before @Injectable:\n\n @Singleton()\n @Injectable()\n export class " + injectable.name + " { }\n ");
}
}
function createSingleton(injectable) {

@@ -31,3 +21,2 @@ var instantiated = null;

if (!instantiated) {
checkInjectable(injectable);
instantiated = true;

@@ -34,0 +23,0 @@ this._reset = function () { return instantiated = false; };

4

package.json
{
"name": "@trademe/ensure",
"version": "0.1.0-beta.3",
"version": "0.1.0-beta.4",
"description": "Utility decorators for Angular applications",

@@ -12,3 +12,3 @@ "main": "dist/index.js",

"compile": "ngc -p ./tsconfig.json && tsc -p ./tsconfig.json",
"cover": "ts-node node_modules/istanbul/lib/cli.js cover --config .istanbulrc.json _mocha -- --opts ./.mocharc \"src/**/*.spec.ts\"",
"cover": "ts-node node_modules/istanbul/lib/cli.js cover --config .istanbulrc.json node_modules/mocha/bin/_mocha -- --opts ./.mocharc \"src/**/*.spec.ts\"",
"test": "mocha --opts ./.mocharc \"src/**/*.spec.ts\""

@@ -15,0 +15,0 @@ },

Sorry, the diff of this file is not supported yet

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