Comparing version 0.0.6 to 0.0.7
@@ -0,1 +1,5 @@ | ||
=== 0.0.7 2013-02-01 | ||
* support web browser #1 | ||
=== 0.0.6 2013-12-13 | ||
@@ -2,0 +6,0 @@ |
(function() { | ||
var Asearch; | ||
module.exports = Asearch = (function() { | ||
Asearch = (function() { | ||
var INITPAT, INITSTATE, MAXCHAR; | ||
@@ -37,4 +37,5 @@ | ||
function Asearch(pat) { | ||
function Asearch(source) { | ||
var c, mask, _i, _j, _len, _ref; | ||
this.source = source; | ||
this.shiftpat = []; | ||
@@ -47,3 +48,3 @@ this.epsilon = 0; | ||
} | ||
_ref = this.unpack(pat); | ||
_ref = this.unpack(this.source); | ||
for (_j = 0, _len = _ref.length; _j < _len; _j++) { | ||
@@ -106,3 +107,3 @@ c = _ref[_j]; | ||
bytes = []; | ||
_ref = str.split(/(?:)/); | ||
_ref = str.split(''); | ||
for (_i = 0, _len = _ref.length; _i < _len; _i++) { | ||
@@ -123,2 +124,8 @@ c = _ref[_i]; | ||
if ((typeof module !== "undefined" && module !== null) && (module.exports != null)) { | ||
module.exports = Asearch; | ||
} else if (typeof window !== "undefined" && window !== null) { | ||
window.Asearch = Asearch; | ||
} | ||
}).call(this); |
{ | ||
"name": "asearch", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"private": false, | ||
@@ -9,3 +9,3 @@ "description": "ambiguity text search", | ||
"scripts": { | ||
"test": "./node_modules/grunt-cli/bin/grunt test" | ||
"test": "grunt test" | ||
}, | ||
@@ -15,2 +15,4 @@ "author": "Sho Hashimoto <hashimoto@shokai.org>", | ||
"devDependencies": { | ||
"coffee-errors": "*", | ||
"coffee-script": "*", | ||
"mocha": "*", | ||
@@ -21,5 +23,5 @@ "grunt": "*", | ||
"grunt-contrib-coffee": "*", | ||
"grunt-cli": "*", | ||
"grunt-coffeelint": "git+https://github.com/geta6/grunt-coffeelint", | ||
"grunt-contrib-watch": "git+https://github.com/gruntjs/grunt-contrib-watch" | ||
"grunt-coffeelint": "*", | ||
"grunt-contrib-watch": "git+https://github.com/gruntjs/grunt-contrib-watch", | ||
"grunt-contrib-uglify": "*" | ||
}, | ||
@@ -26,0 +28,0 @@ "directories": { |
# Node Asearch | ||
ambiguity text search for JavaScript | ||
<a href="https://travis-ci.org/shokai/node-asearch"><img src="https://travis-ci.org/shokai/node-asearch.png"></a> | ||
[![Build Status](https://travis-ci.org/shokai/node-asearch.png?branch=master)](https://travis-ci.org/shokai/node-asearch) | ||
@@ -21,9 +21,9 @@ - https://github.com/shokai/node-asearch | ||
console.log a.match 'abcde' # => true | ||
console.log a.match 'AbCdE' # => true | ||
console.log a.match 'abcd' # => false | ||
console.log a.match 'abcd', 1 # => true | ||
console.log a.match 'abcde' # => true | ||
console.log a.match 'AbCdE' # => true | ||
console.log a.match 'abcd' # => false | ||
console.log a.match 'abcd', 1 # => true | ||
console.log a.match 'ab de', 1 # => true | ||
console.log a.match 'abe', 1 # => false | ||
console.log a.match 'abe', 2 # => true | ||
console.log a.match 'abe', 1 # => false | ||
console.log a.match 'abe', 2 # => true | ||
``` | ||
@@ -36,5 +36,6 @@ | ||
console.log a.match 'cheese burger' # => true | ||
console.log a.match 'cheese burger' # => true | ||
console.log a.match 'chess burger' # => false | ||
console.log a.match 'chess burger', 2 # => true | ||
console.log a.match 'chess', 2 # => false | ||
console.log a.match 'chess', 2 # => false | ||
``` | ||
@@ -55,3 +56,15 @@ | ||
### for browser | ||
- https://github.com/shokai/node-asearch/tree/master/samples/web | ||
```html | ||
<script src="asearch.min.js"></script> | ||
``` | ||
```javascript | ||
a = new Asearch('abcde'); | ||
a.match('abcd'); | ||
``` | ||
## Test | ||
@@ -63,2 +76,3 @@ | ||
$ npm i -g grunt-cli | ||
$ grunt | ||
$ grunt test | ||
$ grunt watch |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
93171
12
453
75
10
1