Skip to content

Commit

Permalink
Remove full()
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Jan 6, 2019
1 parent c959e66 commit 2d594a1
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 286 deletions.
33 changes: 11 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,16 +210,16 @@ leaving permissions as is (omitting them or using `undefined`) and unsetting
them (using `-` or `false`). [`number`](#number) and [`stat`](#stat) do not
make this distinction. If you convert between them, you might lose this
information as we assume `-` and `0` in [`number`](#number) and [`stat`](#stat)
mean "leave permissions as is". However you can use [`full()`](#fullpermission)
and [`positive()`](#positivepermission) to overcome this issue.
mean "unset permissions". However you can use
[`positive()`](#positivepermission) to overcome this issue.

<!-- eslint-disable line-comment-position, no-inline-comments -->

```js
unixPermissions.convert.symbolic('001') // 'o+x'
unixPermissions.full(unixPermissions.convert.symbolic('001')) // 'o=x'
unixPermissions.convert.octal('o+x') // '0001'
unixPermissions.convert.octal('o=x') // '=0001'
unixPermissions.convert.symbolic('111') // 'a=x'
unixPermissions.positive(unixPermissions.convert.symbolic('111')) // 'a+x'
unixPermissions.convert.octal('o+x') // '+0001'
unixPermissions.convert.octal('o=x') // '0001'
```

## `type(permission)`
Expand Down Expand Up @@ -252,30 +252,19 @@ unixPermissions.normalize({ user: { read: undefined, write: true } })
unixPermissions.normalize('z+x') // Throws an exception
```

## `full(permission)`

Converts all the omitted permissions to negative permissions. See
[convert()](#convertoctalpermission) for more explanation.

<!-- eslint-disable line-comment-position, no-inline-comments -->

```js
unixPermissions.full('a+x') // 'a=x'
unixPermissions.convert.symbolic('001') // 'o+x'
unixPermissions.full(unixPermissions.convert.symbolic('001')) // 'ug=,o=x'
```

## `positive(permission)`

Inverse of [`full()`](#fullpermission). Only keep the positive permissions.
Remove all negative permissions. See
[convert()](#convertoctalpermission) for more explanation.

<!-- eslint-disable line-comment-position, no-inline-comments -->

```js
unixPermissions.positive('o=x') // 'o+x'
unixPermissions.positive('o+x,o-r') // 'o+x'
unixPermissions.invert('660') // '=0117'
unixPermissions.positive(unixPermissions.invert('660')) // '0117'
unixPermissions.invert('660') // '0117'
unixPermissions.positive('660') // '+0660'
unixPermissions.invert(unixPermissions.positive('660')) // '-0117'
```

## `contain(permission, permissions...)`
Expand Down
5 changes: 0 additions & 5 deletions src/cli/commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@
["normalize z+w", "Exit code: 1"]
]
},
{
"command": "full <permission>",
"describe": "Converts all the omitted permissions to negative permissions",
"examples": [["full a+rw", "Output: a=rw"]]
},
{
"command": "positive <permission>",
"describe": "Only keep the positive permissions.",
Expand Down
27 changes: 0 additions & 27 deletions src/functions/full.js

This file was deleted.

2 changes: 0 additions & 2 deletions src/functions/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict'

const { normalize } = require('./normalize')
const { full } = require('./full')
const { positive } = require('./positive')
const { contain } = require('./contain')
const { equal } = require('./equal')
Expand All @@ -12,7 +11,6 @@ const { min, max } = require('./min_max')

module.exports = {
normalize,
full,
positive,
contain,
equal,
Expand Down
9 changes: 0 additions & 9 deletions test/full.js

This file was deleted.

221 changes: 0 additions & 221 deletions test/snapshots/full.js.md

This file was deleted.

Binary file removed test/snapshots/full.js.snap
Binary file not shown.

0 comments on commit 2d594a1

Please sign in to comment.