complete-assign
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "complete-assign", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "completeAssign", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,20 +0,1 @@ | ||
# astroboy-plugin-boilerplate | ||
Boilerplate for astroboy plugin | ||
[![NPM version][npm-image]][npm-url] | ||
[![build status][travis-image]][travis-url] | ||
[![David deps][david-image]][david-url] | ||
[![NPM download][download-image]][download-url] | ||
[![Gitter][gitter-image]][gitter-url] | ||
[npm-image]: https://img.shields.io/npm/v/astroboy-boilerplate-plugin.svg?style=flat-square | ||
[npm-url]: https://npmjs.org/package/astroboy-boilerplate-plugin | ||
[travis-image]: https://img.shields.io/travis/astroboy-lab/astroboy-boilerplate-plugin.svg?style=flat-square | ||
[travis-url]: https://travis-ci.org/astroboy-lab/astroboy-boilerplate-plugin | ||
[david-image]: https://img.shields.io/david/astroboy-lab/astroboy-boilerplate-plugin.svg?style=flat-square | ||
[david-url]: https://david-dm.org/astroboy-lab/astroboy-boilerplate-plugin | ||
[download-image]: https://img.shields.io/npm/dm/astroboy-boilerplate-plugin.svg?style=flat-square | ||
[download-url]: https://npmjs.org/package/astroboy-boilerplate-plugin | ||
[gitter-image]: https://img.shields.io/gitter/room/astroboy-lab/astroboy-boilerplate-plugin.svg?style=flat-square | ||
[gitter-url]: https://gitter.im/astroboy-lab/astroboy-boilerplate-plugin | ||
# complete-assign |
@@ -23,9 +23,37 @@ import test from 'ava'; | ||
test('completeAssign: function', t => { | ||
let target = {}; | ||
completeAssign(target, { | ||
foo() { | ||
return 'bar'; | ||
} | ||
}); | ||
t.is(target.foo(), 'bar'); | ||
let target = {}; | ||
completeAssign(target, { | ||
foo() { | ||
return 'bar'; | ||
} | ||
}); | ||
t.is(target.foo(), 'bar'); | ||
}); | ||
test('completeAssign: class and plain object', t => { | ||
class Foo {} | ||
completeAssign(Foo.prototype, { | ||
foo: 'bar' | ||
}); | ||
t.is(new Foo().foo, 'bar'); | ||
}); | ||
test('completeAssign: class & getter', t => { | ||
class Foo {} | ||
completeAssign(Foo.prototype, { | ||
get foo() { | ||
return 'bar'; | ||
} | ||
}); | ||
t.is(new Foo().foo, 'bar'); | ||
}); | ||
test('completeAssign: class & function', t => { | ||
class Foo {} | ||
completeAssign(Foo.prototype, { | ||
foo() { | ||
return 'bar'; | ||
} | ||
}); | ||
t.is(new Foo().foo(), 'bar'); | ||
}); |
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
69
4732
2
1