3.1.1 • Published 6 years ago

remove-dollar-inject v3.1.1

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

remove-dollar-inject

Travis npm Code Climate Code Climate Greenkeeper badge semantic-release

A library for removing $inject from Angular source files.

Install

yarn install -D remove-dollar-inject

or

npm install --save-dev remove-dollar-inject

Usage

ES6

import removeDollarInject from 'remove-dollar-inject';

const input = "ExampleService.$inject = ['$q']; angular.module('app.example').service('ExampleService', ExampleService);";
const output = removeDollarInject(input);
console.log(output)
/*
 * angular.module('app.example').service('ExampleService', ExampleService);
 */

ES5

const removeDollarInject = require('remove-dollar-inject');

const input = "ExampleService.$inject = ['$q']; angular.module('app.example').service('ExampleService', ExampleService);";
const output = removeDollarInject(input);
console.log(output)
/*
 * angular.module('app.example').service('ExampleService', ExampleService);
 */

API

Table of Contents

removeDollarInject

Removes any $inject assignment expressions from a given source string.

Will return an empty string for any null/undefined/void values.

Parameters

  • source string String from which to remove any $inject (optional, default '')

Returns string Source string without $inject assignment expressions

License

MIT (C) Richard Harrah

3.1.1

6 years ago

3.1.0

7 years ago

3.0.0

7 years ago

2.0.0

7 years ago

1.0.0

7 years ago