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

cdocparser

Package Overview
Dependencies
Maintainers
4
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cdocparser - npm Package Compare versions

Comparing version 0.14.0 to 0.15.0

test/fixtures/linePreserveNested.test.scss

10

index.js

@@ -117,5 +117,15 @@ 'use strict';

var type;
var matches = comment.match(new RegExp(lineCommentRegExp.source, 'g'));
matches.shift();
var lines = comment.split(lineCommentRegExp);
lines.shift();
// Re-add second match within the same line
for (var i = lines.length - 2; i > -1; i = i - 1) {
var line = lines[i];
if (line.indexOf('\n') === -1) {
lines.splice(i, 2, lines[i] + matches[i] + lines[i + 1]);
}
}
if (lines[0] !== undefined && comment.trim().indexOf('////') === 0){

@@ -122,0 +132,0 @@ lines.shift(); // Remove line with stars

2

package.json
{
"name": "cdocparser",
"version": "0.14.0",
"version": "0.15.0",
"description": "Extract C style comments and extract context from source",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -80,3 +80,3 @@ CDocParser

type: 'block|line|poster',
commentRange: { start : 1, end : 2 },
commentRange: { start : 1, end : 2 },
context: [context object generated by contextParser]

@@ -103,3 +103,3 @@ }

parse : function (annotationLine, info, id) {
},

@@ -133,6 +133,6 @@ default : function(){

### Annotations API
### Annotations API
The annotations object is build up from two different kind of object. A `annotation` object and a
`alias`.
`alias`.

@@ -185,3 +185,3 @@ The global structure looks like:

/**
* @name Fabrice Weinberg
* @name Fabrice Weinberg
*/

@@ -198,3 +198,3 @@ ```

#### `default` method
#### `default` method
The `default` method is used to add a default value.

@@ -213,4 +213,4 @@

#### `autofill` method
The `autofill` method is used to extend hand written annotations by autofilled ones.
#### `autofill` method
The `autofill` method is used to extend hand written annotations by autofilled ones.

@@ -220,3 +220,3 @@ ##### Example:

function(comment){
// Access the parsed comment here.
// Access the parsed comment here.
}

@@ -232,7 +232,7 @@ ```

> Note: A warning will be emitted if a annotation is used more than once. Only the first value is used.
> Note: A warning will be emitted if a annotation is used more than once. Only the first value is used.
### `overwritePoster` key
The `overwritePoster` key is used to control if a this annotation used on an item will overwrite a poster comment.
The `overwritePoster` key is used to control if a this annotation used on an item will overwrite a poster comment.

@@ -245,3 +245,6 @@ ## Development

#### 0.15.0
* Allow restricting `lineCommentStyle` match to the beginning of a line. (See [PR#17](https://github.com/FWeinb/CDocParser/pull/17))
#### 0.13.0

@@ -253,11 +256,11 @@

#### 0.12.2
* Fix a bug where poster comments could be deteced inside strings.
#### 0.12.1
* Unify platform specify line breaks (like `\r\n`) to `\n` before processing
#### 0.12.0
* Add the options `lineComment` and `blockComment` as boolean states to disbale parsing of either of them.

@@ -271,9 +274,9 @@

* return a flat array of comments.
* added `indexBy` and `indexByType` to restore the previous behaviour.
* return a flat array of comments.
* added `indexBy` and `indexByType` to restore the previous behaviour.
#### 0.9.1
* Prevent negative indexes. (See [PR#10](https://github.com/FWeinb/CDocParser/pull/10))
* Unify error messages.
* Prevent negative indexes. (See [PR#10](https://github.com/FWeinb/CDocParser/pull/10))
* Unify error messages.

@@ -286,3 +289,3 @@ #### 0.9.0

* Fix regression in `lineNumberFor` reporting wrong line numbers.
* Fix regression in `lineNumberFor` reporting wrong line numbers.

@@ -295,6 +298,6 @@ #### 0.8.0

* Extend `type` key of each comment to differentiate between `line` and `block`.
* Extend `type` key of each comment to differentiate between `line` and `block`.
#### 0.6.0
* Include line numbers in each found comment block. (See [PR#6](https://github.com/FWeinb/CDocParser/pull/5))

@@ -307,8 +310,8 @@

#### 0.4.0
* Add `autofill` as an annotation feature.
* Remove the array wrapping of `default` values.
* Remove the array wrapping of `default` values.
#### 0.3.8
* Add type check for poster comments

@@ -347,17 +350,15 @@

#### 0.2.1
* Emits a `warning` if a annotation was not found instead of throwing an exception.
#### 0.2.0
#### 0.2.0
* Throw an error if annotation was not found
#### 0.1.1
* Ignore annotations that return `undefined`.
#### 0.1.0
#### 0.1.0
* Restructure annotation function. Add `default` value and `parse` function.

@@ -106,2 +106,7 @@ var fs = require('fs');

it('should preserve subsequent line comments on the same line', function(){
var comments = getCommentsFrom('linePreserveNested.test.scss');
assert.deepEqual(comments[0].lines, ['Preserves /// nested', '/// comments', '//// all /// over', 'the ////// place']);
});
});

@@ -108,0 +113,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